account

package
v2.2.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: GPL-3.0 Imports: 4 Imported by: 2

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

	// Password
	RegExpPassword = `^.{1,255}$`
	// User
	RegExpUsername    = `^[a-zA-Z0-9-_.]{1,128}$`
	RegExpEmail       = `^.+\@.+\..+`
	RegExpFirstName   = `^.{1,128}$`
	RegExpLastName    = `^.{1,128}$`
	RegExpPhoneNumber = `^\+[1-9]\d{1,14}$`
)

Regular expressions for parameters validation

Variables

This section is empty.

Functions

func ConvertToKCUser

func ConvertToKCUser(user AccountRepresentation) kc.UserRepresentation

ConvertToKCUser creates a KC user representation from an API user

Types

type AccountRepresentation

type AccountRepresentation struct {
	Username    *string `json:"username,omitempty"`
	Email       *string `json:"email,omitempty"`
	FirstName   *string `json:"firstName,omitempty"`
	LastName    *string `json:"lastName,omitempty"`
	PhoneNumber *string `json:"phoneNumber,omitempty"`
}

AccountRepresentation struct

func ConvertToAPIAccount

func ConvertToAPIAccount(userKc kc.UserRepresentation) 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 Configuration

type Configuration struct {
	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"`
}

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