stdattrs

package
v0.0.0-...-ac88f99 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

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 StandardAttributesEmailRequired = apierrors.BadRequest.WithReason("StandardAttributesEmailRequired")

Functions

func SchemaBuilderAddress

func SchemaBuilderAddress() validation.SchemaBuilder

func SchemaBuilderAddressCountry

func SchemaBuilderAddressCountry() validation.SchemaBuilder

func SchemaBuilderAddressFormatted

func SchemaBuilderAddressFormatted() validation.SchemaBuilder

func SchemaBuilderAddressLocality

func SchemaBuilderAddressLocality() validation.SchemaBuilder

func SchemaBuilderAddressPostalCode

func SchemaBuilderAddressPostalCode() validation.SchemaBuilder

func SchemaBuilderAddressRegion

func SchemaBuilderAddressRegion() validation.SchemaBuilder

func SchemaBuilderAddressStreetAddress

func SchemaBuilderAddressStreetAddress() validation.SchemaBuilder

func SchemaBuilderBirthdate

func SchemaBuilderBirthdate() validation.SchemaBuilder

func SchemaBuilderEmail

func SchemaBuilderEmail() validation.SchemaBuilder

func SchemaBuilderFamilyName

func SchemaBuilderFamilyName() validation.SchemaBuilder

func SchemaBuilderForPointerString

func SchemaBuilderForPointerString(ptrStr string) (validation.SchemaBuilder, bool)

func SchemaBuilderGender

func SchemaBuilderGender() validation.SchemaBuilder

func SchemaBuilderGivenName

func SchemaBuilderGivenName() validation.SchemaBuilder

func SchemaBuilderLocale

func SchemaBuilderLocale() validation.SchemaBuilder

func SchemaBuilderMiddleName

func SchemaBuilderMiddleName() validation.SchemaBuilder

func SchemaBuilderName

func SchemaBuilderName() validation.SchemaBuilder

func SchemaBuilderNickName

func SchemaBuilderNickName() validation.SchemaBuilder

func SchemaBuilderPhoneNumber

func SchemaBuilderPhoneNumber() validation.SchemaBuilder

func SchemaBuilderPicture

func SchemaBuilderPicture() validation.SchemaBuilder

func SchemaBuilderPreferredUsername

func SchemaBuilderPreferredUsername() validation.SchemaBuilder

func SchemaBuilderProfile

func SchemaBuilderProfile() validation.SchemaBuilder

func SchemaBuilderWebsite

func SchemaBuilderWebsite() validation.SchemaBuilder

func SchemaBuilderZoneinfo

func SchemaBuilderZoneinfo() validation.SchemaBuilder

func Validate

func Validate(t T) error

Types

type ExtractOptions

type ExtractOptions struct {
	EmailRequired bool
}

type LoginIDNormalizerFactory

type LoginIDNormalizerFactory interface {
	NormalizerWithLoginIDType(loginIDKeyType model.LoginIDKeyType) internalinterface.LoginIDNormalizer
}

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

func (t T) Clone() T

func (T) FormattedName

func (t T) FormattedName() string

func (T) FormattedNames

func (t T) FormattedNames() string

func (T) MergedWith

func (t T) MergedWith(that T) T

MergedWith returns a T with that merged into t.

func (T) MergedWithForm

func (t T) MergedWithForm(ptrs map[string]string) (T, error)

func (T) MergedWithList

func (t T) MergedWithList(l attrs.List) (T, error)

func (T) NonIdentityAware

func (t T) NonIdentityAware() T

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

func (t T) Tidy() T

func (T) ToClaims

func (t T) ToClaims() map[string]interface{}

func (T) WithDerivedAttributesRemoved

func (t T) WithDerivedAttributesRemoved() T

func (T) WithNameCopiedToGivenName

func (t T) WithNameCopiedToGivenName() T

Jump to

Keyboard shortcuts

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