Documentation
¶
Index ¶
- Constants
- func ConvertToKCUser(user UserRepresentation) kc.UserRepresentation
- type ClientRepresentation
- type CredentialRepresentation
- type GroupRepresentation
- type PasswordRepresentation
- type RealmCustomConfiguration
- type RealmRepresentation
- type RequiredAction
- type RoleRepresentation
- type UserRepresentation
- type UsersPageRepresentation
Constants ¶
const ( RegExpID = `^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$` // Client RegExpClientID = `^[a-zA-Z0-9-_.]{1,255}$` // User RegExpUsername = `^[a-zA-Z0-9-_.]{1,128}$` RegExpEmail = `^.+\@.+\..+` RegExpFirstName = `^.{1,128}$` RegExpLastName = `^.{1,128}$` RegExpPhoneNumber = `^\+[1-9]\d{1,14}$` RegExpLabel = `^.{1,255}$` RegExpGender = `^[MF]$` RegExpBirthDate = `^(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$` RegExpLocale = `^[a-z]{2}$` // Role RegExpName = `^[a-zA-Z0-9-_]{1,128}$` RegExpDescription = `^.{1,255}$` // Password RegExpPassword = `^.{1,255}$` // RealmCustomConfiguration RegExpRedirectURI = `^\w+:(\/?\/?)[^\s]+$` // RequiredAction RegExpRequiredAction = `^[a-zA-Z0-9-_]{1,255}$` // Others RegExpRealmName = `^[a-zA-Z0-9_-]{1,36}$` RegExpSearch = `^.{1,128}$` RegExpLifespan = `^[0-9]{1,10}$` RegExpGroupIds = `` /* 133-byte string literal not displayed */ RegExpNumber = `^\d+$` )
Regular expressions for parameters validation
Variables ¶
This section is empty.
Functions ¶
func ConvertToKCUser ¶
func ConvertToKCUser(user UserRepresentation) kc.UserRepresentation
ConvertToKCUser creates a KC user representation from an API user
Types ¶
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 GroupRepresentation ¶
type GroupRepresentation struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` }
GroupRepresentation struct
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 RealmCustomConfiguration ¶
type RealmCustomConfiguration struct { DefaultClientId *string `json:"default_client_id,omitempty"` DefaultRedirectUri *string `json:"default_redirect_uri,omitempty"` SelfAuthenticatorMgmtEnabled *bool `json:"self_authenticator_mgmt_enabled"` SelfPasswordChangeEnabled *bool `json:"self_password_change_enabled"` }
RealmCustomConfiguration struct
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 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 UserRepresentation ¶
type UserRepresentation struct { Id *string `json:"id,omitempty"` Username *string `json:"username,omitempty"` Email *string `json:"email,omitempty"` Enabled *bool `json:"enabled,omitempty"` EmailVerified *bool `json:"emailVerified,omitempty"` PhoneNumberVerified *bool `json:"phoneNumberVerified,omitempty"` FirstName *string `json:"firstName,omitempty"` LastName *string `json:"lastName,omitempty"` PhoneNumber *string `json:"phoneNumber,omitempty"` Label *string `json:"label,omitempty"` Gender *string `json:"gender,omitempty"` BirthDate *string `json:"birthDate,omitempty"` CreatedTimestamp *int64 `json:"createdTimestamp,omitempty"` Groups *[]string `json:"groups,omitempty"` Roles *[]string `json:"roles,omitempty"` Locale *string `json:"locale,omitempty"` }
UserRepresentation struct
func ConvertToAPIUser ¶
func ConvertToAPIUser(userKc kc.UserRepresentation) 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 UsersPageRepresentation ¶
type UsersPageRepresentation struct { Users []UserRepresentation `json:"users"` Count *int `json:"count"` }
UsersPageRepresentation used to manage paging in GetUsers
func ConvertToAPIUsersPage ¶
func ConvertToAPIUsersPage(users kc.UsersPageRepresentation) UsersPageRepresentation
ConvertToAPIUsersPage converts paged users results from KC model to API one