constants

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: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgErrInvalidParam         = "invalidParameter"
	MsgErrMissingParam         = "missingParameter"
	MsgErrWrongTypeRequest     = "wrongTypeRequest"
	MsgErrInvalidJSONRequest   = "invalidJSONRequest"
	MsgErrInvalidBase64Object  = "invalidBase64Object"
	MsgErrInvalidLength        = "invalidLength"
	MsgErrCannotObtain         = "cannotObtain"
	MsgErrCannotMarshal        = "cannotMarshal"
	MsgErrCannotSaveConfigInDB = "cannotSaveConfigInDB"
	MsgErrCannotUpdate         = "cannotUpdate"
	MsgErrUnknown              = "unknowError"
	MsgErrNotConfigured        = "notConfigured"
	MsgErrUnverified           = "unverifiedFlag"

	BodyContent                       = "bodyContent"
	RealmConfiguration                = "realmConfiguration"
	RealmAdminConfiguration           = "realmAdminConfiguration"
	Authorization                     = "authorization"
	CurrentPassword                   = "currentPassword"
	NewPassword                       = "newPassword"
	ConfirmPassword                   = "confirmPassword"
	Password                          = "password"
	Type                              = "type"
	ID                                = "id"
	Label                             = "label"
	UserID                            = "userId"
	Username                          = "username"
	User                              = "user"
	UserLabel                         = "userLabel"
	Email                             = "email"
	Firstname                         = "firstname"
	Lastname                          = "lastname"
	PhoneNumber                       = "phoneNumber"
	Gender                            = "gender"
	Birthdate                         = "birthdate"
	GroupID                           = "groupId"
	GroupName                         = "groupName"
	Name                              = "name"
	GroupIDs                          = "groupIds"
	RoleID                            = "roleId"
	CredentialID                      = "credentialID"
	Locale                            = "locale"
	Description                       = "description"
	ContainerID                       = "containerId"
	DefaultClientID                   = "defaultClientId"
	DefaultRedirectURI                = "defaultRedirectURI"
	RedirectCancelledRegistrationURL  = "redirectCancelledRegistrationURL"
	RedirectSuccessfulRegistrationURL = "redirectSuccessfulRegistrationURL"
	RequiredAction                    = "requiredAction"
	DurationLabel                     = "durationLabel"
	Body                              = "body"
	Flatbuffer                        = "flatbuffer"
	Realm                             = "realm"
	KeycloakRealms                    = "keycloakRealms"
	Config                            = "config"
	Response                          = "response"
	ListOfRealms                      = "listOfRealms"
	Groups                            = "groups"
	ClientID                          = "clientId"
	RedirectURI                       = "redirectURI"
	Exclude                           = "exclude"
	Unit                              = "unit"
	Max                               = "max"
	Timeshift                         = "timeshift"
	IdentityProvider                  = "identityProvider"
	TrustIDGroupName                  = "trustIDGroupName"
)

Normalized error messages

View Source
const (
	AttrbAccreditations      = kc.AttributeKey("accreditations")
	AttrbBirthDate           = kc.AttributeKey("birthDate")
	AttrbGender              = kc.AttributeKey("gender")
	AttrbLabel               = kc.AttributeKey("label")
	AttrbLocale              = kc.AttributeKey("locale")
	AttrbPhoneNumber         = kc.AttributeKey("phoneNumber")
	AttrbPhoneNumberVerified = kc.AttributeKey("phoneNumberVerified")
	AttrbSmsSent             = kc.AttributeKey("smsSent")
	AttrbTrustIDGroups       = kc.AttributeKey("trustIDGroups")
)

Attribute keys definition

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            = `^.+\@.+\..+$`
	RegExpNameSpecialChars = `^([\wàáâäçèéêëìíîïñòóôöùúûüß]+([ '-][\wàáâäçèéêëìíîïñòóôöùúûüß]+)*){1,50}$`
	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

View Source
var (
	SupportedDateLayouts = []string{"02.01.2006", "2006-01-02"}
)

Date layout management: first date layout is the one used to format dates in Keycloak. Following one are other supported format when parsing

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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