Documentation ¶
Index ¶
- Constants
- Variables
- func SchemaBuilderForPointerString(ptrStr string) (validation.SchemaBuilder, bool)
- func Validate(t T) error
- type ExtractOptions
- type LoginIDNormalizerFactory
- type Normalizer
- type T
- func (t T) CheckWrite(accessControl accesscontrol.T, role accesscontrol.Role, that T) error
- func (t T) Clone() T
- func (t T) FormattedName() string
- func (t T) FormattedNames() string
- func (t T) MergedWith(that T) T
- func (t T) MergedWithForm(ptrs map[string]string) (T, error)
- func (t T) MergedWithList(l attrs.List) (T, error)
- func (t T) NonIdentityAware() T
- func (t T) ReadWithAccessControl(accessControl accesscontrol.T, role accesscontrol.Role) T
- func (t T) Tidy() T
- func (t T) ToClaims() map[string]interface{}
- func (t T) WithDerivedAttributesRemoved() T
- func (t T) WithNameCopiedToGivenName() T
Constants ¶
View Source
const ( // Sub is not used because we do not always use sub as the unique identifier for // an user from the identity provider. // Sub = "sub" Email = "email" EmailVerified = "email_verified" PhoneNumber = "phone_number" PhoneNumberVerified = "phone_number_verified" PreferredUsername = "preferred_username" FamilyName = "family_name" GivenName = "given_name" MiddleName = "middle_name" Name = "name" Nickname = "nickname" Picture = "picture" Profile = "profile" Website = "website" Gender = "gender" Birthdate = "birthdate" Zoneinfo = "zoneinfo" Locale = "locale" Address = "address" Formatted = "formatted" StreetAddress = "street_address" Locality = "locality" Region = "region" PostalCode = "postal_code" Country = "country" UpdatedAt = "updated_at" )
Variables ¶
View Source
var AccessControlViolated = apierrors.Forbidden.WithReason("AccessControlViolated")
View Source
var DependencySet = wire.NewSet( wire.Struct(new(Normalizer), "*"), )
View Source
var NonIdentityAwareKeys []string = []string{ FamilyName, GivenName, MiddleName, Name, Nickname, Picture, Profile, Website, Gender, Birthdate, Zoneinfo, Locale, Address, }
View Source
var Schema *validation.SimpleSchema
View Source
var SchemaBuilder validation.SchemaBuilder
View Source
var SchemaBuilderAddress validation.SchemaBuilder
View Source
var SchemaBuilderAddressCountry = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderAddressFormatted = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderAddressLocality = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderAddressPostalCode = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderAddressRegion = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderAddressStreetAddress = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderBirthdate = validation.SchemaBuilder{}. Type(validation.TypeString). Format("birthdate")
View Source
var SchemaBuilderEmail = validation.SchemaBuilder{}. Type(validation.TypeString). Format("email")
View Source
var SchemaBuilderFamilyName = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderGender = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderGivenName = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderLocale = validation.SchemaBuilder{}. Type(validation.TypeString). Format("bcp47")
View Source
var SchemaBuilderMiddleName = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderName = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderNickName = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderPhoneNumber = validation.SchemaBuilder{}. Type(validation.TypeString). Format("phone")
View Source
var SchemaBuilderPicture = validation.SchemaBuilder{}. Type(validation.TypeString). Format("x_picture")
View Source
var SchemaBuilderPreferredUsername = validation.SchemaBuilder{}. Type(validation.TypeString). MinLength(1)
View Source
var SchemaBuilderProfile = validation.SchemaBuilder{}. Type(validation.TypeString). Format("uri")
View Source
var SchemaBuilderWebsite = validation.SchemaBuilder{}. Type(validation.TypeString). Format("uri")
View Source
var SchemaBuilderZoneinfo = validation.SchemaBuilder{}. Type(validation.TypeString). Format("timezone")
View Source
var StandardAttributesEmailRequired = apierrors.BadRequest.WithReason("StandardAttributesEmailRequired")
Functions ¶
func SchemaBuilderForPointerString ¶
func SchemaBuilderForPointerString(ptrStr string) (validation.SchemaBuilder, bool)
Types ¶
type ExtractOptions ¶
type ExtractOptions struct {
EmailRequired bool
}
type LoginIDNormalizerFactory ¶
type LoginIDNormalizerFactory interface {
NormalizerWithLoginIDType(loginIDKeyType model.LoginIDKeyType) loginid.Normalizer
}
type Normalizer ¶
type Normalizer struct {
LoginIDNormalizerFactory LoginIDNormalizerFactory
}
func (*Normalizer) Normalize ¶
func (n *Normalizer) Normalize(t T) error
type T ¶
type T map[string]interface{}
func Extract ¶
func Extract(claims map[string]interface{}, opts ExtractOptions) (T, error)
Extract extracts OIDC standard claims. The output is NOT normalized.
func (T) CheckWrite ¶
func (t T) CheckWrite(accessControl accesscontrol.T, role accesscontrol.Role, that T) error
func (T) FormattedName ¶
func (T) FormattedNames ¶
func (T) MergedWith ¶
MergedWith returns a T with that merged into t.
func (T) NonIdentityAware ¶
NonIdentityAware returns a copy of t with identity-aware attributes removed.
func (T) ReadWithAccessControl ¶
func (t T) ReadWithAccessControl(accessControl accesscontrol.T, role accesscontrol.Role) T
func (T) WithDerivedAttributesRemoved ¶
func (T) WithNameCopiedToGivenName ¶
Click to show internal directories.
Click to hide internal directories.