management_api

package
v2.3.7+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegExpID          = `^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$`
	RegExpName        = `^[a-zA-Z0-9-_]{1,128}$`
	RegExpDescription = `^.{1,255}$`

	// 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}$`

	// 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 ConvertToDBAuthorizations

func ConvertToDBAuthorizations(realmID, groupID string, apiAuthorizations AuthorizationsRepresentation) []dto.Authorization

ConvertToDBAuthorizations creates an array of DB Authorization from an API AuthorizationsRepresentation

func ConvertToKCFedID

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

Types

type ActionRepresentation

type ActionRepresentation struct {
	Name  *string `json:"name"`
	Scope *string `json:"scope"`
}

ActionRepresentation struct

type AuthorizationsRepresentation

type AuthorizationsRepresentation struct {
	Matrix *map[string]map[string]map[string]struct{} `json:"matrix"`
}

AuthorizationsRepresentation struct

func ConvertToAPIAuthorizations

func ConvertToAPIAuthorizations(authorizations []dto.Authorization) AuthorizationsRepresentation

ConvertToAPIAuthorizations creates a API authorization representation from an array of DB Authorization

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 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"`
	APISelfMailEditingEnabled           *bool     `json:"api_self_mail_editing_enabled"`
	APISelfAccountDeletionEnabled       *bool     `json:"api_self_account_deletion_enabled"`
	ShowAuthenticatorsTab               *bool     `json:"show_authenticators_tab"`
	ShowPasswordTab                     *bool     `json:"show_password_tab"`
	ShowMailEditing                     *bool     `json:"show_mail_editing"`
	ShowAccountDeletionButton           *bool     `json:"show_account_deletion_button"`
	RegisterExecuteActions              *[]string `json:"register_execute_actions"`
	RedirectCancelledRegistrationURL    *string   `json:"redirect_cancelled_registration_url"`
	RedirectSuccessfulRegistrationURL   *string   `json:"redirect_successful_registration_url"`
}

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 RequiredActionRepresentation

type RequiredActionRepresentation struct {
	Alias         *string `json:"alias,omitempty"`
	DefaultAction *bool   `json:"defaultAction,omitempty"`
	Name          *string `json:"name,omitempty"`
}

func ConvertRequiredAction

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 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"`
	TrustIDGroups       *[]string `json:"trustIdGroups,omitempty"`
	Roles               *[]string `json:"roles,omitempty"`
	Locale              *string   `json:"locale,omitempty"`
	SmsSent             *int      `json:"smsSent,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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL