Documentation ¶
Index ¶
- Constants
- func ConvertToDBAuthorizations(realmID, groupName string, apiAuthorizations AuthorizationsRepresentation) []configuration.Authorization
- func ConvertToKCFedID(fedID FederatedIdentityRepresentation) kc.FederatedIdentityRepresentation
- func ConvertToKCGroup(group GroupRepresentation) kc.GroupRepresentation
- func ConvertToKCUser(user UserRepresentation) kc.UserRepresentation
- func ConvertUpdatableToKCUser(user UpdatableUserRepresentation) kc.UserRepresentation
- type AccreditationRepresentation
- type ActionRepresentation
- type AttackDetectionStatusRepresentation
- type AuthorizationsRepresentation
- type BackOfficeConfiguration
- type ClientRepresentation
- type CredentialRepresentation
- type FederatedIdentityRepresentation
- type GroupRepresentation
- type PasswordRepresentation
- type RealmAdminAccreditation
- type RealmAdminConfiguration
- type RealmCustomConfiguration
- type RealmRepresentation
- type RequiredAction
- type RequiredActionRepresentation
- type RoleRepresentation
- type UpdatableUserRepresentation
- type UserCheck
- type UserRepresentation
- type UserStatus
- type UsersPageRepresentation
Constants ¶
const ( BOConfKeyCustomers = "customers" BOConfKeyTeams = "teams" )
BackOffice configuration keys
Variables ¶
This section is empty.
Functions ¶
func ConvertToDBAuthorizations ¶
func ConvertToDBAuthorizations(realmID, groupName string, apiAuthorizations AuthorizationsRepresentation) []configuration.Authorization
ConvertToDBAuthorizations creates an array of DB Authorization from an API AuthorizationsRepresentation
func ConvertToKCFedID ¶
func ConvertToKCFedID(fedID FederatedIdentityRepresentation) kc.FederatedIdentityRepresentation
ConvertToKCFedID creates a KC federated identity representation from an API federated identity representation
func ConvertToKCGroup ¶
func ConvertToKCGroup(group GroupRepresentation) kc.GroupRepresentation
ConvertToKCGroup creates a KC group representation from an API group
func ConvertToKCUser ¶
func ConvertToKCUser(user UserRepresentation) kc.UserRepresentation
ConvertToKCUser creates a KC user representation from an API user
func ConvertUpdatableToKCUser ¶
func ConvertUpdatableToKCUser(user UpdatableUserRepresentation) kc.UserRepresentation
ConvertUpdatableToKCUser creates a KC user representation from an API user
Types ¶
type AccreditationRepresentation ¶
type AccreditationRepresentation struct { Type *string `json:"type"` ExpiryDate *string `json:"expiryDate"` Revoked *bool `json:"revoked,omitempty"` Expired *bool `json:"expired,omitempty"` }
AccreditationRepresentation is a representation of accreditations
type ActionRepresentation ¶
ActionRepresentation struct
type AttackDetectionStatusRepresentation ¶
type AttackDetectionStatusRepresentation struct { NumFailures *int64 `json:"numFailures,omitempty"` Disabled *bool `json:"disabled,omitempty"` LastIPFailure *string `json:"lastIPFailure,omitempty"` LastFailure *int64 `json:"lastFailure,omitempty"` }
AttackDetectionStatusRepresentation struct
func ConvertAttackDetectionStatus ¶
func ConvertAttackDetectionStatus(status map[string]interface{}) AttackDetectionStatusRepresentation
ConvertAttackDetectionStatus creates a brute force status from a map
type AuthorizationsRepresentation ¶
type AuthorizationsRepresentation struct {
Matrix *map[string]map[string]map[string]struct{} `json:"matrix"`
}
AuthorizationsRepresentation struct
func ConvertToAPIAuthorizations ¶
func ConvertToAPIAuthorizations(authorizations []configuration.Authorization) AuthorizationsRepresentation
ConvertToAPIAuthorizations creates a API authorization representation from an array of DB Authorization
type BackOfficeConfiguration ¶
BackOfficeConfiguration type
func NewBackOfficeConfigurationFromJSON ¶
func NewBackOfficeConfigurationFromJSON(confJSON string) (BackOfficeConfiguration, error)
NewBackOfficeConfigurationFromJSON creates and validates a new BackOfficeConfiguration from a JSON value
type ClientRepresentation ¶
type ClientRepresentation struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` BaseURL *string `json:"baseUrl,omitempty"` ClientID *string `json:"clientId,omitempty"` Protocol *string `json:"protocol,omitempty"` Enabled *bool `json:"enabled,omitempty"` }
ClientRepresentation struct
type CredentialRepresentation ¶
type CredentialRepresentation struct { ID *string `json:"id,omitempty"` Type *string `json:"type,omitempty"` UserLabel *string `json:"userLabel,omitempty"` CreatedDate *int64 `json:"createdDate,omitempty"` CredentialData *string `json:"credentialData,omitempty"` Value *string `json:"value,omitempty"` Temporary *bool `json:"temporary,omitempty"` }
CredentialRepresentation struct
func ConvertCredential ¶
func ConvertCredential(credKc *kc.CredentialRepresentation) CredentialRepresentation
ConvertCredential creates an API credential from a KC credential
type FederatedIdentityRepresentation ¶
type FederatedIdentityRepresentation struct { UserID *string `json:"userID,omitempty"` Username *string `json:"username,omitempty"` }
FederatedIdentityRepresentation struct
func (FederatedIdentityRepresentation) Validate ¶
func (fedID FederatedIdentityRepresentation) Validate() error
Validate is a validator for FederatedIdentityRepresentation
type GroupRepresentation ¶
type GroupRepresentation struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` }
GroupRepresentation struct
func (GroupRepresentation) Validate ¶
func (group GroupRepresentation) Validate() error
Validate is a validator for GroupRepresentation
type PasswordRepresentation ¶
type PasswordRepresentation struct {
Value *string `json:"value,omitempty"`
}
PasswordRepresentation struct
func (PasswordRepresentation) Validate ¶
func (password PasswordRepresentation) Validate() error
Validate is a validator for PasswordRepresentation
type RealmAdminAccreditation ¶
type RealmAdminAccreditation struct { Type *string `json:"type"` Validity *string `json:"validity"` Condition *string `json:"condition"` }
RealmAdminAccreditation struct
func ConvertRealmAccreditationsFromDBStruct ¶
func ConvertRealmAccreditationsFromDBStruct(accreds []configuration.RealmAdminAccreditation) []RealmAdminAccreditation
ConvertRealmAccreditationsFromDBStruct converts an array of accreditation from DB struct to API struct
func (RealmAdminAccreditation) Validate ¶
func (acc RealmAdminAccreditation) Validate() error
Validate is a validator for RealmAdminAccreditation
type RealmAdminConfiguration ¶
type RealmAdminConfiguration struct { Mode *string `json:"mode"` AvailableChecks map[string]bool `json:"available_checks"` Accreditations []RealmAdminAccreditation `json:"accreditations"` SelfRegisterEnabled *bool `json:"self_register_enabled"` Theme *string `json:"theme"` NeedVerifiedContact *bool `json:"need_verified_contact"` ConsentRequiredSocial *bool `json:"consent_required_social"` ConsentRequiredCorporate *bool `json:"consent_required_corporate"` ShowGlnEditing *bool `json:"show_gln_editing"` }
RealmAdminConfiguration struct
func ConvertRealmAdminConfigurationFromDBStruct ¶
func ConvertRealmAdminConfigurationFromDBStruct(conf configuration.RealmAdminConfiguration) RealmAdminConfiguration
ConvertRealmAdminConfigurationFromDBStruct converts a RealmAdminConfiguration from DB struct to API struct
func CreateDefaultRealmAdminConfiguration ¶
func CreateDefaultRealmAdminConfiguration() RealmAdminConfiguration
CreateDefaultRealmAdminConfiguration creates a default admin configuration
func (RealmAdminConfiguration) ConvertRealmAccreditationsToDBStruct ¶
func (rac RealmAdminConfiguration) ConvertRealmAccreditationsToDBStruct() []configuration.RealmAdminAccreditation
ConvertRealmAccreditationsToDBStruct converts a slice of realm admin accreditation into its database version
func (RealmAdminConfiguration) ConvertToDBStruct ¶
func (rac RealmAdminConfiguration) ConvertToDBStruct() configuration.RealmAdminConfiguration
ConvertToDBStruct converts a realm admin configuration into its database version
func (RealmAdminConfiguration) Validate ¶
func (rac RealmAdminConfiguration) Validate() error
Validate is a validator for RealmAdminConfiguration
type RealmCustomConfiguration ¶
type RealmCustomConfiguration struct { DefaultClientID *string `json:"default_client_id"` DefaultRedirectURI *string `json:"default_redirect_uri"` APISelfAuthenticatorDeletionEnabled *bool `json:"api_self_authenticator_deletion_enabled"` APISelfPasswordChangeEnabled *bool `json:"api_self_password_change_enabled"` APISelfAccountEditingEnabled *bool `json:"api_self_account_editing_enabled"` APISelfAccountDeletionEnabled *bool `json:"api_self_account_deletion_enabled"` ShowAuthenticatorsTab *bool `json:"show_authenticators_tab"` ShowPasswordTab *bool `json:"show_password_tab"` ShowProfileTab *bool `json:"show_profile_tab"` ShowAccountDeletionButton *bool `json:"show_account_deletion_button"` RedirectCancelledRegistrationURL *string `json:"redirect_cancelled_registration_url"` RedirectSuccessfulRegistrationURL *string `json:"redirect_successful_registration_url"` OnboardingRedirectURI *string `json:"onboarding_redirect_uri"` OnboardingClientID *string `json:"onboarding_client_id"` SelfRegisterGroupNames *[]string `json:"self_register_group_names"` BarcodeType *string `json:"barcode_type"` }
RealmCustomConfiguration struct
func ConvertRealmCustomConfigurationFromDBStruct ¶
func ConvertRealmCustomConfigurationFromDBStruct(config configuration.RealmConfiguration) RealmCustomConfiguration
ConvertRealmCustomConfigurationFromDBStruct converts a RealmCustomConfiguration from DB struct to API struct
func CreateDefaultRealmCustomConfiguration ¶
func CreateDefaultRealmCustomConfiguration() RealmCustomConfiguration
CreateDefaultRealmCustomConfiguration creates a default custom configuration
func (RealmCustomConfiguration) Validate ¶
func (config RealmCustomConfiguration) Validate() error
Validate is a validator for RealmCustomConfiguration
type RealmRepresentation ¶
type RealmRepresentation struct { ID *string `json:"id,omitempty"` KeycloakVersion *string `json:"keycloakVersion,omitempty"` Realm *string `json:"realm,omitempty"` DisplayName *string `json:"displayName,omitempty"` Enabled *bool `json:"enabled,omitempty"` }
RealmRepresentation struct
type RequiredAction ¶
type RequiredAction string
RequiredAction type
func (RequiredAction) Validate ¶
func (requiredAction RequiredAction) Validate() error
Validate is a validator for RequiredAction
type RequiredActionRepresentation ¶
type RequiredActionRepresentation struct { Alias *string `json:"alias,omitempty"` DefaultAction *bool `json:"defaultAction,omitempty"` Name *string `json:"name,omitempty"` }
RequiredActionRepresentation struct
func ConvertRequiredAction ¶
func ConvertRequiredAction(ra *kc.RequiredActionProviderRepresentation) RequiredActionRepresentation
ConvertRequiredAction creates an API requiredAction from a KC requiredAction
type RoleRepresentation ¶
type RoleRepresentation struct { ClientRole *bool `json:"clientRole,omitempty"` Composite *bool `json:"composite,omitempty"` ContainerID *string `json:"containerId,omitempty"` Description *string `json:"description,omitempty"` ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` }
RoleRepresentation struct
func (RoleRepresentation) Validate ¶
func (role RoleRepresentation) Validate() error
Validate is a validator for RoleRepresentation
type UpdatableUserRepresentation ¶
type UpdatableUserRepresentation struct { ID *string `json:"id,omitempty"` Username *string `json:"username,omitempty"` Gender *string `json:"gender,omitempty"` FirstName *string `json:"firstName,omitempty"` LastName *string `json:"lastName,omitempty"` Email csjson.OptionalString `json:"email,omitempty"` EmailVerified *bool `json:"emailVerified,omitempty"` PhoneNumber csjson.OptionalString `json:"phoneNumber,omitempty"` PhoneNumberVerified *bool `json:"phoneNumberVerified,omitempty"` BirthDate *string `json:"birthDate,omitempty"` BirthLocation *string `json:"birthLocation,omitempty"` Nationality *string `json:"nationality,omitempty"` IDDocumentType *string `json:"idDocumentType,omitempty"` IDDocumentNumber *string `json:"idDocumentNumber,omitempty"` IDDocumentExpiration *string `json:"idDocumentExpiration,omitempty"` IDDocumentCountry *string `json:"idDocumentCountry,omitempty"` Groups *[]string `json:"groups,omitempty"` TrustIDGroups *[]string `json:"trustIdGroups,omitempty"` Roles *[]string `json:"roles,omitempty"` Locale *string `json:"locale,omitempty"` BusinessID csjson.OptionalString `json:"businessId,omitempty"` SmsSent *int `json:"smsSent,omitempty"` SmsAttempts *int `json:"smsAttempts,omitempty"` Enabled *bool `json:"enabled,omitempty"` Label *string `json:"label,omitempty"` PendingChecks *[]string `json:"pendingChecks,omitempty"` Accreditations *[]AccreditationRepresentation `json:"accreditations,omitempty"` CreatedTimestamp *int64 `json:"createdTimestamp,omitempty"` }
UpdatableUserRepresentation struct
func (UpdatableUserRepresentation) Validate ¶
func (user UpdatableUserRepresentation) Validate() error
Validate is a validator for UpdatableUserRepresentation
type UserCheck ¶
type UserCheck struct { Operator *string `json:"operator,omitempty"` CheckDate *string `json:"checkDate,omitempty"` Status *string `json:"status,omitempty"` Type *string `json:"type,omitempty"` Nature *string `json:"nature,omitempty"` ProofType *string `json:"proofType,omitempty"` Comment *string `json:"comment,omitempty"` }
UserCheck is a representation of a user check
func ConvertToAPIUserChecks ¶
ConvertToAPIUserChecks converts user checks from DB struct to API struct
type UserRepresentation ¶
type UserRepresentation struct { ID *string `json:"id,omitempty"` Username *string `json:"username,omitempty"` Gender *string `json:"gender,omitempty"` FirstName *string `json:"firstName,omitempty"` LastName *string `json:"lastName,omitempty"` Email *string `json:"email,omitempty"` EmailVerified *bool `json:"emailVerified,omitempty"` PhoneNumber *string `json:"phoneNumber,omitempty"` PhoneNumberVerified *bool `json:"phoneNumberVerified,omitempty"` BirthDate *string `json:"birthDate,omitempty"` BirthLocation *string `json:"birthLocation,omitempty"` Nationality *string `json:"nationality,omitempty"` IDDocumentType *string `json:"idDocumentType,omitempty"` IDDocumentNumber *string `json:"idDocumentNumber,omitempty"` IDDocumentExpiration *string `json:"idDocumentExpiration,omitempty"` IDDocumentCountry *string `json:"idDocumentCountry,omitempty"` Groups *[]string `json:"groups,omitempty"` TrustIDGroups *[]string `json:"trustIdGroups,omitempty"` Roles *[]string `json:"roles,omitempty"` Locale *string `json:"locale,omitempty"` BusinessID *string `json:"businessId,omitempty"` SmsSent *int `json:"smsSent,omitempty"` SmsAttempts *int `json:"smsAttempts,omitempty"` Enabled *bool `json:"enabled,omitempty"` Label *string `json:"label,omitempty"` PendingChecks *[]string `json:"pendingChecks,omitempty"` Accreditations *[]AccreditationRepresentation `json:"accreditations,omitempty"` NameID *string `json:"nameId,omitempty"` OnboardingCompleted *bool `json:"onboardingCompleted,omitempty"` CreatedTimestamp *int64 `json:"createdTimestamp,omitempty"` }
UserRepresentation struct
func ConvertToAPIUser ¶
func ConvertToAPIUser(ctx context.Context, userKc kc.UserRepresentation, logger keycloakb.Logger) UserRepresentation
ConvertToAPIUser creates an API user representation from a KC user representation
func (UserRepresentation) Validate ¶
func (user UserRepresentation) Validate() error
Validate is a validator for UserRepresentation
type UserStatus ¶
type UserStatus struct { Email *string `json:"email,omitempty"` Enabled *bool `json:"enabled,omitempty"` EmailVerified *bool `json:"emailVerified,omitempty"` PhoneNumberVerified *bool `json:"phoneNumberVerified,omitempty"` OnboardingCompleted *bool `json:"onboardingCompleted,omitempty"` NumberOfCredentials *int `json:"numberOfCredentials,omitempty"` }
UserStatus struct
type UsersPageRepresentation ¶
type UsersPageRepresentation struct { Users []UserRepresentation `json:"users"` Count *int `json:"count"` }
UsersPageRepresentation used to manage paging in GetUsers
func ConvertToAPIUsersPage ¶
func ConvertToAPIUsersPage(ctx context.Context, users kc.UsersPageRepresentation, logger keycloakb.Logger) UsersPageRepresentation
ConvertToAPIUsersPage converts paged users results from KC model to API one