constants

package
v3.19.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 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"
	MsgErrAlreadyOnboardedUser = "alreadyOnboardedUser"
	MsgErrCantRegister         = "cantRegister"
	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"
	IDDocumentCountry                 = "idDocumentCountry"
	IDDocumentType                    = "idDocumentType"
	IDDocumentNumber                  = "idDocumentNumber"
	IDDocumentExpiration              = "idDocumentExpiration"
	Label                             = "label"
	Nationality                       = "nationality"
	UserID                            = "userId"
	Username                          = "username"
	User                              = "user"
	UserLabel                         = "userLabel"
	Email                             = "email"
	Firstname                         = "firstname"
	Lastname                          = "lastname"
	PhoneNumber                       = "phoneNumber"
	Gender                            = "gender"
	Birthdate                         = "birthdate"
	BirthLocation                     = "birthLocation"
	BusinessID                        = "businessID"
	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"
	OnboardingRedirectURI             = "onboardingRedirectURI"
	OnboardingClientID                = "onboardingClientID"
	SelfRegisterGroupNames            = "selfRegisterGroupNames"
	BarcodeType                       = "barcodeType"
	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("ENC_birthDate")
	AttrbBusinessID          = kc.AttributeKey("businessID")
	AttrbPendingChecks       = kc.AttributeKey("pendingChecks")
	AttrbGender              = kc.AttributeKey("ENC_gender")
	AttrbLabel               = kc.AttributeKey("label")
	AttrbLocale              = kc.AttributeKey("locale")
	AttrbNameID              = kc.AttributeKey("saml.persistent.name.id.for.*")
	AttrbOnboardingCompleted = kc.AttributeKey("onboardingCompleted")
	AttrbPhoneNumber         = kc.AttributeKey("phoneNumber")
	AttrbPhoneNumberVerified = kc.AttributeKey("phoneNumberVerified")
	AttrbSmsSent             = kc.AttributeKey("smsSent")
	AttrbSmsAttempts         = kc.AttributeKey("smsAttempts")
	AttrbSource              = kc.AttributeKey("src")
	AttrbTrustIDAuthToken    = kc.AttributeKey("trustIDAuthToken")
	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 = regExpLen255
	RegExpBool        = `^([Tt][Rr][Uu][Ee])|([Ff][Aa][Ll][Ss][Ee])$`

	// Client
	RegExpClientID = `^[a-zA-Z0-9-_.]{1,255}$`

	// User
	RegExpUsername            = `^[a-zA-Z0-9-_.]{1,128}$`
	RegExpEmail               = `^.+\@.+\..+$`
	RegExpNameSpecialChars    = `^([\p{Lu}\p{Ll}][\p{Lu}\p{Ll} /\\\.'-]{0,49})$`
	RegExpNameSpecialChars128 = `^([\p{Lu}\p{Ll}][\p{Lu}\p{Ll} /\\\.'-]{0,127})$`
	RegExpFirstName           = RegExpNameSpecialChars128
	RegExpLastName            = RegExpNameSpecialChars128
	RegExpLastNameSearch      = `^[=%]?([\p{Lu}\p{Ll}][\p{Lu}\p{Ll} /\\\.'-]{0,127}[%]?)$`
	RegExpPhoneNumber         = `^\+[1-9]\d{1,14}$`
	RegExpLabel               = regExpLen255
	RegExpGender              = `^[MFU]$`
	RegExpBirthDate           = `^(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$`
	RegExpBirthLocation       = `^([\p{Lu}\p{Ll}][\p{Lu}\p{Ll}\d ()/\\\.,'-]{0,49})$`
	RegExpLocale              = `^[a-z]{2}$`
	RegExpBusinessID          = regExpLen255
	RegExpCountryCode         = `^\w{2}$`
	RegExpIDDocumentNumber    = `^([\w\d]+([\. -][\w\d]+)*){1,50}$`

	// Password
	RegExpPassword = regExpLen255

	// RealmCustomConfiguration/RealmAdminConfiguration
	RegExpRedirectURI = `^\w+:(\/?\/?)[^\s]+$`
	RegExpTheme       = RegExpName

	// RequiredAction
	RegExpRequiredAction = `^[a-zA-Z0-9-_]{1,255}$`

	// Others
	RegExpRealmName = `^[a-zA-Z0-9_-]{1,36}$`
	RegExpSearch    = regExpLen128
	RegExpLifespan  = `^[0-9]{1,10}$`
	RegExpGroupIds  = `` /* 133-byte string literal not displayed */
	RegExpNumber    = `^\d+$`
)

Regular expressions for parameters validation

Variables

View Source
var (
	// AllowedDocumentTypes are the valid document type for identification
	AllowedDocumentTypes = map[string]bool{"ID_CARD": true, "PASSPORT": true, "RESIDENCE_PERMIT": true}
)
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