From 377005ac1e67d387c4e4ba66000fd3f2f35bda8b Mon Sep 17 00:00:00 2001 From: Joe Fitzgerald Date: Thu, 28 Jun 2018 17:31:38 -0600 Subject: [PATCH] :abc: Clean up identity zone field names, add documentation --- identity_zones.go | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/identity_zones.go b/identity_zones.go index 66c3f54..f76ed03 100644 --- a/identity_zones.go +++ b/identity_zones.go @@ -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"` @@ -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"` @@ -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"` @@ -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"` @@ -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"`