Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DependencySet = wire.NewSet( NewHookHTTPClient, NewHookDenoClient, wire.Struct(new(Service), "*"), wire.Struct(new(AccountMigrationWebHook), "*"), wire.Struct(new(AccountMigrationDenoHook), "*"), NewWebhookMiddlewareLogger, NewDenoMiddlewareLogger, )
View Source
var HookResponseSchema = validation.NewSimpleSchema(`
{
"type": "object",
"additionalProperties": false,
"properties": {
"identities": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"type" : {
"type": "string",
"enum" : ["login_id"]
},
"login_id": {
"type": "object",
"properties": {
"key": { "type": "string" },
"type": { "type": "string" },
"value": { "type": "string" }
},
"required": ["key", "type", "value"]
}
},
"required": ["type", "login_id"]
}
},
"authenticators": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"type" : {
"type": "string",
"enum" : ["oob_otp_email", "oob_otp_sms"]
},
"oobotp": {
"email": { "type": "string" },
"phone": { "type": "string" }
}
},
"allOf": [
{
"if": { "properties": { "type": { "const": "oob_otp_email" } } },
"then": {
"properties": {
"oobotp": {
"required": ["email"]
}
},
"required": ["oobotp"]
}
},
{
"if": { "properties": { "type": { "const": "oob_otp_sms" } } },
"then": {
"properties": {
"oobotp": {
"required": ["phone"]
}
},
"required": ["oobotp"]
}
}
]
}
}
},
"required": ["identities"]
}
`)
View Source
var InvalidConfiguration = apierrors.InternalError.WithReason("InvalidConfiguration")
Functions ¶
This section is empty.
Types ¶
type AccountMigrationDenoHook ¶
type AccountMigrationDenoHook struct { hook.DenoHook Client HookDenoClient Logger DenoMiddlewareLogger }
func (*AccountMigrationDenoHook) Call ¶
func (h *AccountMigrationDenoHook) Call(ctx context.Context, u *url.URL, hookReq *HookRequest) (*HookResponse, error)
type AccountMigrationWebHook ¶
type AccountMigrationWebHook struct { hook.WebHook Client HookHTTPClient Logger WebhookMiddlewareLogger }
func (*AccountMigrationWebHook) Call ¶
func (h *AccountMigrationWebHook) Call(ctx context.Context, u *url.URL, hookReq *HookRequest) (*HookResponse, error)
type DenoMiddlewareLogger ¶
func NewDenoMiddlewareLogger ¶
func NewDenoMiddlewareLogger(lf *log.Factory) DenoMiddlewareLogger
type Hook ¶
type Hook interface {
Call(ctx context.Context, u *url.URL, hookReq *HookRequest) (*HookResponse, error)
}
type HookDenoClient ¶
type HookDenoClient struct {
hook.DenoClient
}
func NewHookDenoClient ¶
func NewHookDenoClient(endpoint config.DenoEndpoint, logger hook.Logger, cfg *config.AccountMigrationHookConfig) HookDenoClient
type HookHTTPClient ¶
func NewHookHTTPClient ¶
func NewHookHTTPClient(cfg *config.AccountMigrationHookConfig) HookHTTPClient
type HookRequest ¶
type HookRequest struct {
MigrationToken string `json:"migration_token"`
}
type HookResponse ¶
type HookResponse struct { Identities []*identity.MigrateSpec Authenticators []*authenticator.MigrateSpec }
func ParseHookResponse ¶
func ParseHookResponse(r io.Reader) (*HookResponse, error)
type Service ¶
type Service struct { Config *config.AccountMigrationHookConfig DenoHook *AccountMigrationDenoHook WebHook *AccountMigrationWebHook }
type WebhookMiddlewareLogger ¶
func NewWebhookMiddlewareLogger ¶
func NewWebhookMiddlewareLogger(lf *log.Factory) WebhookMiddlewareLogger
Click to show internal directories.
Click to hide internal directories.