Skip to content

Commit

Permalink
🔤 Clean up identity zone field names, add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
joefitzgerald committed Jun 28, 2018
1 parent 737d53e commit 377005a
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions identity_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type IdentityZone struct {
LastModified int `json:"last_modified,omitempty"`
}

// ClientSecretPolicy is an identity zone client secret policy.
type ClientSecretPolicy struct {
MinLength int `json:"minLength,omitempty"`
MaxLength int `json:"maxLength,omitempty"`
Expand All @@ -25,35 +26,41 @@ type ClientSecretPolicy struct {
RequireSpecialCharacter int `json:"requireSpecialCharacter,omitempty"`
}

// TokenPolicy is an identity zone token policy.
type TokenPolicy struct {
AccessTokenValidity int `json:"accessTokenValidity,omitempty"`
RefreshTokenValidity int `json:"refreshTokenValidity,omitempty"`
JwtRevocable bool `json:"jwtRevocable,omitempty"`
JWTRevocable bool `json:"jwtRevocable,omitempty"`
RefreshTokenUnique bool `json:"refreshTokenUnique,omitempty"`
RefreshTokenFormat string `json:"refreshTokenFormat,omitempty"`
ActiveKeyID string `json:"activeKeyId,omitempty"`
}

// SAMLKey is an identity zone SAML key.
type SAMLKey struct {
Key string `json:"key,omitempty"`
Passphrase string `json:"passphrase,omitempty"`
Certificate string `json:"certificate,omitempty"`
}

// SAMLConfig is an identity zone SAMLConfig.
type SAMLConfig struct {
AssertionSigned bool `json:"assertionSigned,omitempty"`
RequestSigned bool `json:"requestSigned,omitempty"`
WantAssertionSigned bool `json:"wantAssertionSigned,omitempty"`
WantAuthnRequestSigned bool `json:"wantAuthnRequestSigned,omitempty"`
AssertionTimeToLiveSeconds int `json:"assertionTimeToLiveSeconds,omitempty"`
ActiveKeyID string `json:"activeKeyId,omitempty"`
Keys struct {
Key1 struct {
Certificate string `json:"certificate,omitempty"`
} `json:"key1,omitempty"`
} `json:"keys,omitempty"`
DisableInResponseToCheck bool `json:"disableInResponseToCheck,omitempty"`
AssertionSigned bool `json:"assertionSigned,omitempty"`
RequestSigned bool `json:"requestSigned,omitempty"`
WantAssertionSigned bool `json:"wantAssertionSigned,omitempty"`
WantAuthnRequestSigned bool `json:"wantAuthnRequestSigned,omitempty"`
AssertionTimeToLiveSeconds int `json:"assertionTimeToLiveSeconds,omitempty"`
ActiveKeyID string `json:"activeKeyId,omitempty"`
Keys map[string]SAMLKey `json:"keys,omitempty"`
DisableInResponseToCheck bool `json:"disableInResponseToCheck,omitempty"`
}

// CORSPolicy is an identity zone CORSPolicy.
type CORSPolicy struct {
XhrConfiguration struct {
XHRConfiguration struct {
AllowedOrigins []string `json:"allowedOrigins,omitempty"`
AllowedOriginPatterns []interface{} `json:"allowedOriginPatterns,omitempty"`
AllowedUris []string `json:"allowedUris,omitempty"`
AllowedURIs []string `json:"allowedUris,omitempty"`
AllowedURIPatterns []interface{} `json:"allowedUriPatterns,omitempty"`
AllowedHeaders []string `json:"allowedHeaders,omitempty"`
AllowedMethods []string `json:"allowedMethods,omitempty"`
Expand All @@ -63,7 +70,7 @@ type CORSPolicy struct {
DefaultConfiguration struct {
AllowedOrigins []string `json:"allowedOrigins,omitempty"`
AllowedOriginPatterns []interface{} `json:"allowedOriginPatterns,omitempty"`
AllowedUris []string `json:"allowedUris,omitempty"`
AllowedURIs []string `json:"allowedUris,omitempty"`
AllowedURIPatterns []interface{} `json:"allowedUriPatterns,omitempty"`
AllowedHeaders []string `json:"allowedHeaders,omitempty"`
AllowedMethods []string `json:"allowedMethods,omitempty"`
Expand All @@ -72,6 +79,7 @@ type CORSPolicy struct {
} `json:"defaultConfiguration,omitempty"`
}

// IdentityZoneLinks is an identity zone link.
type IdentityZoneLinks struct {
Logout struct {
RedirectURL string `json:"redirectUrl,omitempty"`
Expand All @@ -87,27 +95,32 @@ type IdentityZoneLinks struct {
} `json:"selfService,omitempty"`
}

// Prompt is a UAA prompt.
type Prompt struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Text string `json:"text,omitempty"`
}

// Branding is the branding for a UAA identity zone.
type Branding struct {
CompanyName string `json:"companyName,omitempty"`
ProductLogo string `json:"productLogo,omitempty"`
SquareLogo string `json:"squareLogo,omitempty"`
}

// IdentityZoneUserConfig is the user configuration for an identity zone.
type IdentityZoneUserConfig struct {
DefaultGroups []string `json:"defaultGroups,omitempty"`
}

// IdentityZoneMFAConfig is the MFA configuration for an identity zone.
type IdentityZoneMFAConfig struct {
Enabled *bool `json:"enabled,omitempty"`
ProviderName string `json:"providerName,omitempty"`
}

// IdentityZoneConfig is the configuration for an identity zone.
type IdentityZoneConfig struct {
ClientSecretPolicy *ClientSecretPolicy `json:"clientSecretPolicy,omitempty"`
TokenPolicy *TokenPolicy `json:"tokenPolicy,omitempty"`
Expand Down

0 comments on commit 377005a

Please sign in to comment.