apiaccount

package
v3.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RegExpID         = constants.RegExpID
	RegExpIDNullable = `^([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})$|^(null)$`
	RegExpLabel      = `^.{0,255}$`
	RegExpType       = `^[a-zA-Z0-9-_]{1,128}$`
	RegExpRealmName  = constants.RegExpRealmName

	// Password
	RegExpPassword = constants.RegExpPassword
	// User
	RegExpUsername    = constants.RegExpUsername
	RegExpEmail       = constants.RegExpEmail
	RegExpFirstName   = constants.RegExpFirstName
	RegExpLastName    = constants.RegExpLastName
	RegExpPhoneNumber = constants.RegExpPhoneNumber
	RegExpLocale      = `^\w{2}(-\w{2})?$`
)

Regular expressions for parameters validation

Variables

This section is empty.

Functions

func ConvertToKCUser

ConvertToKCUser creates a KC user representation from an API user

Types

type AccountRepresentation

type AccountRepresentation struct {
	Gender               *string                        `json:"gender,omitempty"`
	FirstName            *string                        `json:"firstName,omitempty"`
	LastName             *string                        `json:"lastName,omitempty"`
	Username             *string                        `json:"username,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"`
	Locale               *string                        `json:"locale,omitempty"`
	BusinessID           *string                        `json:"businessId,omitempty"`
	Accreditations       *[]AccreditationRepresentation `json:"accreditations,omitempty"`
}

AccountRepresentation struct

func ConvertToAPIAccount

func ConvertToAPIAccount(ctx context.Context, userKc kc.UserRepresentation, logger keycloakb.Logger) AccountRepresentation

ConvertToAPIAccount creates an API account representation from a KC user representation

func (AccountRepresentation) Validate

func (user AccountRepresentation) Validate() error

Validate is a validator for AccountRepresentation

type AccreditationRepresentation

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

AccreditationRepresentation is a representation of accreditations

type Configuration

type Configuration struct {
	EditingEnabled                    *bool           `json:"editing_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"`
	RedirectSuccessfulRegistrationURL *string         `json:"redirect_successful_registration_url"`
	AvailableChecks                   map[string]bool `json:"available-checks"`
	BarcodeType                       *string         `json:"barcode_type"`
	Theme                             *string         `json:"theme"`
	SupportedLocales                  *[]string       `json:"supportedLocales,omitempty"`
	ShowGlnEditing                    *bool           `json:"show_gln_editing,omitempty"`
}

Configuration 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

func (CredentialRepresentation) Validate

func (credential CredentialRepresentation) Validate() error

Validate is a validator for CredentialRepresentation

type LabelBody

type LabelBody struct {
	Label string `json:"label,omitempty"`
}

LabelBody struct

type UpdatableAccountRepresentation

type UpdatableAccountRepresentation struct {
	Gender               *string                        `json:"gender,omitempty"`
	FirstName            *string                        `json:"firstName,omitempty"`
	LastName             *string                        `json:"lastName,omitempty"`
	Username             *string                        `json:"username,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"`
	Locale               *string                        `json:"locale,omitempty"`
	BusinessID           csjson.OptionalString          `json:"businessId,omitempty"`
	Accreditations       *[]AccreditationRepresentation `json:"accreditations,omitempty"`
}

UpdatableAccountRepresentation struct

func (UpdatableAccountRepresentation) Validate

func (user UpdatableAccountRepresentation) Validate() error

Validate is a validator for UpdatableAccountRepresentation

type UpdatePasswordBody

type UpdatePasswordBody struct {
	CurrentPassword string `json:"currentPassword"`
	NewPassword     string `json:"newPassword"`
	ConfirmPassword string `json:"confirmPassword"`
}

UpdatePasswordBody is the definition of the expected body content of UpdatePassword method

func (UpdatePasswordBody) Validate

func (updatePwd UpdatePasswordBody) Validate() error

Validate is a validator for UpdatePasswordBody

Jump to

Keyboard shortcuts

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