Documentation ¶
Index ¶
- Constants
- Variables
- type AuthenticatorService
- type CustomAttributesService
- type Detail
- type IdentityService
- type Job
- type JobManager
- type Logger
- type MFA
- func (m MFA) Email() (*string, bool)
- func (m MFA) MaybePassword() (value map[string]interface{}, exist bool, ok bool)
- func (m MFA) MaybeTOTP() (value map[string]interface{}, exist bool, ok bool)
- func (m MFA) Password() (map[string]interface{}, bool)
- func (m MFA) PhoneNumber() (*string, bool)
- func (m MFA) Redact()
- func (m MFA) TOTP() (map[string]interface{}, bool)
- type Options
- type Outcome
- type Password
- type Record
- func (m Record) CustomAttributesList() (attrsList attrs.List)
- func (m Record) Disabled() (bool, bool)
- func (m Record) Email() (*string, bool)
- func (m Record) EmailVerified() (bool, bool)
- func (m Record) Groups() ([]string, bool)
- func (m Record) MFA() (map[string]interface{}, bool)
- func (m Record) MaybeMFA() (value map[string]interface{}, exist bool, ok bool)
- func (m Record) MaybePassword() (value map[string]interface{}, exist bool, ok bool)
- func (m Record) NonIdentityAwareStandardAttributesList() (attrsList attrs.List)
- func (m Record) Password() (map[string]interface{}, bool)
- func (m Record) PhoneNumber() (*string, bool)
- func (m Record) PhoneNumberVerified() (bool, bool)
- func (m Record) PreferredUsername() (*string, bool)
- func (m Record) Redact()
- func (m Record) Roles() ([]string, bool)
- type Request
- type Response
- type Result
- type ReusedSchemaBuilders
- type RolesGroupsCommands
- type SearchReindexService
- type StandardAttributesService
- type Store
- type StoreRedis
- type Summary
- type TOTP
- type TaskProducer
- type UsageLimiter
- type UserCommands
- type UserImportService
- type UserQueries
- type VerifiedClaimService
- type Warning
Constants ¶
View Source
const ( IdentifierEmail = "email" IdentifierPreferredUsername = "preferred_username" IdentifierPhoneNumber = "phone_number" )
View Source
const JobTTL = 24 * time.Hour
View Source
const (
PasswordTypeBcrypt = "bcrypt"
)
View Source
const RedactPlaceholder = "REDACTED"
Variables ¶
View Source
var BodyMaxSize int64 = 500 * 1000
BodyMaxSize is 500KB.
View Source
var DependencySet = wire.NewSet( wire.Struct(new(UserImportService), "*"), wire.Struct(new(StoreRedis), "*"), wire.Struct(new(JobManager), "*"), wire.Bind(new(Store), new(*StoreRedis)), NewLogger, )
View Source
var RecordSchemaForIdentifierEmail *validation.SimpleSchema
View Source
var RecordSchemaForIdentifierPhoneNumber *validation.SimpleSchema
View Source
var RecordSchemaForIdentifierPreferredUsername *validation.SimpleSchema
View Source
var RequestSchema = validation.NewSimpleSchema(`
{
"type": "object",
"additionalProperties": false,
"properties": {
"upsert": {
"type": "boolean"
},
"identifier": {
"type": "string",
"enum": ["preferred_username", "email", "phone_number"]
},
"records": {
"type": "array",
"minItems": 1,
"items": {
"type": "object"
}
}
},
"required": ["identifier", "records"]
}
`)
Functions ¶
This section is empty.
Types ¶
type AuthenticatorService ¶
type AuthenticatorService interface { New(ctx context.Context, spec *authenticator.Spec) (*authenticator.Info, error) Create(ctx context.Context, info *authenticator.Info, markVerified bool) error List(ctx context.Context, userID string, filters ...authenticator.Filter) ([]*authenticator.Info, error) Delete(ctx context.Context, info *authenticator.Info) error }
type CustomAttributesService ¶
type IdentityService ¶
type IdentityService interface { New(ctx context.Context, userID string, spec *identity.Spec, options identity.NewIdentityOptions) (*identity.Info, error) UpdateWithSpec(ctx context.Context, info *identity.Info, spec *identity.Spec, options identity.NewIdentityOptions) (*identity.Info, error) Create(ctx context.Context, info *identity.Info) error Delete(ctx context.Context, info *identity.Info) error Update(ctx context.Context, oldInfo *identity.Info, newInfo *identity.Info) error CheckDuplicated(ctx context.Context, info *identity.Info) (dup *identity.Info, err error) ListByClaim(ctx context.Context, name string, value string) ([]*identity.Info, error) ListByUser(ctx context.Context, userID string) ([]*identity.Info, error) }
type JobManager ¶
type JobManager struct { AppID config.AppID Clock clock.Clock AdminAPIFeatureConfig *config.AdminAPIFeatureConfig TaskProducer TaskProducer UsageLimiter UsageLimiter Store Store }
func (*JobManager) EnqueueJob ¶
type Options ¶
func (*Options) RecordSchema ¶
func (o *Options) RecordSchema() *validation.SimpleSchema
type Password ¶
type Password map[string]interface{}
func (Password) ExpireAfter ¶
func (Password) PasswordHash ¶
type Record ¶
type Record map[string]interface{}
func (Record) CustomAttributesList ¶
func (Record) EmailVerified ¶
func (Record) MaybePassword ¶
func (Record) NonIdentityAwareStandardAttributesList ¶
func (Record) PhoneNumber ¶
func (Record) PhoneNumberVerified ¶
func (Record) PreferredUsername ¶
type Request ¶
type Request struct { Upsert bool `json:"upsert,omitempty"` Identifier string `json:"identifier,omitempty"` // Records is json.RawMessage because we want to delay the deserialization until we actually process the record. Records []json.RawMessage `json:"records,omitempty"` }
type Response ¶
type Response struct { ID string `json:"id,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` CompletedAt *time.Time `json:"completed_at,omitempty"` Status redisqueue.TaskStatus `json:"status,omitempty"` Error *apierrors.APIError `json:"error,omitempty"` Summary *Summary `json:"summary,omitempty"` Details []Detail `json:"details,omitempty"` }
func NewResponseFromJob ¶
func NewResponseFromTask ¶
func NewResponseFromTask(task *redisqueue.Task) (*Response, error)
func (*Response) AggregateTaskResult ¶
func (r *Response) AggregateTaskResult(taskOffset int, task *redisqueue.Task) error
type ReusedSchemaBuilders ¶
type ReusedSchemaBuilders struct { Email validation.SchemaBuilder PhoneNumber validation.SchemaBuilder PreferredUsername validation.SchemaBuilder FamilyName validation.SchemaBuilder GivenName validation.SchemaBuilder MiddleName validation.SchemaBuilder Name validation.SchemaBuilder Nickname validation.SchemaBuilder Picture validation.SchemaBuilder Profile validation.SchemaBuilder Website validation.SchemaBuilder Gender validation.SchemaBuilder Birthdate validation.SchemaBuilder Zoneinfo validation.SchemaBuilder Locale validation.SchemaBuilder Address validation.SchemaBuilder }
type RolesGroupsCommands ¶
type RolesGroupsCommands interface { ResetUserGroup(ctx context.Context, options *rolesgroups.ResetUserGroupOptions) error ResetUserRole(ctx context.Context, options *rolesgroups.ResetUserRoleOptions) error }
type SearchReindexService ¶
type StoreRedis ¶
type TaskProducer ¶
type TaskProducer interface { NewTask(appID string, input json.RawMessage, taskIDPrefix string) *redisqueue.Task EnqueueTask(ctx context.Context, task *redisqueue.Task) error GetTask(ctx context.Context, item *redisqueue.QueueItem) (*redisqueue.Task, error) }
type UsageLimiter ¶
type UsageLimiter interface {
ReserveN(ctx context.Context, name usage.LimitName, n int, config *config.UsageLimitConfig) (*usage.Reservation, error)
}
type UserCommands ¶
type UserImportService ¶
type UserImportService struct { AppDatabase *appdb.Handle LoginIDConfig *config.LoginIDConfig Identities IdentityService Authenticators AuthenticatorService UserCommands UserCommands UserQueries UserQueries VerifiedClaims VerifiedClaimService StandardAttributes StandardAttributesService CustomAttributes CustomAttributesService RolesGroupsCommands RolesGroupsCommands SearchReindexService SearchReindexService Logger Logger }
func (*UserImportService) ImportRecords ¶
func (s *UserImportService) ImportRecords(ctx context.Context, request *Request) *Result
type UserQueries ¶
type VerifiedClaimService ¶
type VerifiedClaimService interface { NewVerifiedClaim(ctx context.Context, userID string, claimName string, claimValue string) *verification.Claim MarkClaimVerified(ctx context.Context, claim *verification.Claim) error GetClaims(ctx context.Context, userID string) ([]*verification.Claim, error) DeleteClaim(ctx context.Context, claim *verification.Claim) error }
Click to show internal directories.
Click to hide internal directories.