management_api

package
v2.4.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BOConfKeyCustomers = "customers"
	BOConfKeyTeams     = "teams"
)

BackOffice configuration keys

View Source
const (
	RegExpID          = constants.RegExpID
	RegExpName        = constants.RegExpName
	RegExpDescription = constants.RegExpDescription

	// Client
	RegExpClientID = constants.RegExpClientID

	// User
	RegExpUsername    = constants.RegExpUsername
	RegExpEmail       = constants.RegExpEmail
	RegExpFirstName   = constants.RegExpFirstName
	RegExpLastName    = constants.RegExpLastName
	RegExpPhoneNumber = constants.RegExpPhoneNumber
	RegExpLabel       = constants.RegExpLabel
	RegExpGender      = constants.RegExpGender
	RegExpLocale      = constants.RegExpLocale

	// Password
	RegExpPassword = constants.RegExpPassword

	// RealmCustomConfiguration
	RegExpRedirectURI = constants.RegExpRedirectURI

	// RequiredAction
	RegExpRequiredAction = constants.RegExpRequiredAction

	// Others
	RegExpRealmName = constants.RegExpRealmName
	RegExpSearch    = constants.RegExpSearch
	RegExpLifespan  = constants.RegExpLifespan
	RegExpGroupIds  = constants.RegExpGroupIds
	RegExpNumber    = constants.RegExpNumber
)

Regular expressions for parameters validation

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

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 AccreditationRepresentation

type AccreditationRepresentation struct {
	Type       *string `json:"type"`
	ExpiryDate *string `json:"expiryDate"`
	Expired    *bool   `json:"expired,omitempty"`
}

AccreditationRepresentation is a representation of accreditations

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 []configuration.Authorization) AuthorizationsRepresentation

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

type BackOfficeConfiguration

type BackOfficeConfiguration map[string]map[string][]string

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"`
}

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

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"`
	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"`
}

RequiredActionRepresentation struct

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"`
	Accreditations      *[]AccreditationRepresentation `json:"accreditations,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