{"modulePath":"github.com/GoCodeAlone/workflow-plugin-auth","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package adminidentity\n\nPackage adminidentity exposes reusable identity-administration HTTP handlers for Workflow auth consumers.\n\n## Constants\n\n```go\nconst (\n\tCredentialKindPasskey = \"passkey\"\n\tCredentialKindTOTP    = \"totp\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrSetupCodeNotFound   = errors.New(\"setup code not found\")\n\tErrSetupCodeWrongEmail = errors.New(\"setup code email mismatch\")\n\tErrSetupCodeExpired    = errors.New(\"setup code expired\")\n)\n```\n\n## Functions\n\n```go\nfunc NewHandler(options Options) (http.Handler, error)\n```\nNewHandler returns an HTTP handler for reusable auth identity administration.\n\n## Types\n\n```go\ntype AddPasskeyCredentialInput struct {\n\tCredentialID   string\n\tCredentialJSON string\n\tPublicKey      string\n\tLabel          string\n}\n```\n\n```go\ntype AddTOTPCredentialInput struct {\n\tSecret string\n\tLabel  string\n}\n```\n\n```go\ntype Authorizer interface {\n\tAuthorize(context.Context, Principal, string, string) error\n}\n```\n\n```go\ntype ConformanceOptions struct {\n\tHandler http.Handler\n\tBaseURL string\n\tClient  *http.Client\n\tRoutes  []RouteProbe\n}\n```\n\n```go\ntype ConformanceResult struct {\n\tPass     bool\n\tFailures []string\n}\n```\n\n```go\nfunc CheckConformance(options ConformanceOptions) ConformanceResult\n```\n\n```go\ntype Credential struct {\n\tID             string     `json:\"id\"`\n\tUserID         string     `json:\"user_id,omitempty\"`\n\tKind           string     `json:\"kind\"`\n\tLabel          string     `json:\"label,omitempty\"`\n\tCreatedAt      time.Time  `json:\"created_at,omitempty\"`\n\tLastUsedAt     *time.Time `json:\"last_used_at,omitempty\"`\n\tSecretMaterial string     `json:\"-\"`\n}\n```\n\n```go\ntype CredentialStore interface {\n\tListCredentials(context.Context, string) ([]Credential, error)\n\tAddTOTPCredential(context.Context, string, AddTOTPCredentialInput) (Credential, error)\n\tAddPasskeyCredential(context.Context, string, AddPasskeyCredentialInput) (Credential, error)\n}\n```\n\n```go\ntype IssueSetupCodeInput struct {\n\tEmail       string    `json:\"email\"`\n\tDisplayName string    `json:\"display_name,omitempty\"`\n\tRole        string    `json:\"role\"`\n\tTenantIDs   []string  `json:\"tenant_ids,omitempty\"`\n\tExpiresAt   time.Time `json:\"expires_at,omitempty\"`\n}\n```\n\n```go\ntype ListUsersFilter struct {\n\tPrincipal Principal\n}\n```\n\n```go\ntype Options struct {\n\tPagePath          string\n\tProfilePath       string\n\tCredentialsPath   string\n\tPasskeyBeginPath  string\n\tPasskeyFinishPath string\n\tTOTPBeginPath     string\n\tTOTPVerifyPath    string\n\tUsersPath         string\n\tSetupRedeemPath   string\n\tSetupLoginPath    string\n\tLogoutPath        string\n\n\tPrincipalResolver PrincipalResolver\n\tUserStore         UserStore\n\tCredentialStore   CredentialStore\n\tSetupCodeStore    SetupCodeStore\n\tSessionIssuer     SessionIssuer\n\tStepInvoker       StepInvoker\n\tAuthorizer        Authorizer\n\tLogoutHandler     http.Handler\n}\n```\nOptions configures the identity admin handler. The host owns persistence and policy by supplying typed adapters.\n\n```go\ntype Principal struct {\n\tUserID string\n\tEmail  string\n\tRole   string\n}\n```\n\n```go\ntype PrincipalResolver interface {\n\tCurrentPrincipal(*http.Request) (Principal, bool)\n}\n```\n\n```go\ntype ProfileUpdater interface {\n\tUpdateCurrentUser(context.Context, Principal, UpdateProfileInput) (User, error)\n}\n```\n\n```go\ntype RouteProbe struct {\n\tName           string\n\tMethod         string\n\tPath           string\n\tExpectedStatus int\n\tRequireBody    bool\n}\n```\n\n```go\nfunc DefaultRoutesForOptions(options Options) []RouteProbe\n```\n\n```go\ntype Session struct {\n\tToken     string    `json:\"token\"`\n\tExpiresAt time.Time `json:\"expires_at,omitempty\"`\n}\n```\n\n```go\ntype SessionIssuer interface {\n\tIssueSession(context.Context, SessionRequest) (Session, error)\n}\n```\n\n```go\ntype SessionRequest struct {\n\tUserID    string\n\tEmail     string\n\tRole      string\n\tTenantIDs []string\n}\n```\n\n```go\ntype SetupCode struct {\n\tID        string\n\tCode      string\n\tEmail     string\n\tUserID    string\n\tRole      string\n\tTenantIDs []string\n\tExpiresAt time.Time\n\tUsedAt    *time.Time\n}\n```\n\n```go\ntype SetupCodeStore interface {\n\tIssueSetupCode(context.Context, IssueSetupCodeInput) (SetupCode, error)\n\tRedeemSetupCode(context.Context, string, string) (SetupCode, error)\n}\n```\n\n```go\ntype StepCall struct {\n\tStepType string\n\tInput    map[string]any\n}\n```\n\n```go\ntype StepInvoker interface {\n\tInvokeStep(context.Context, StepCall) (map[string]any, error)\n}\n```\n\n```go\ntype UpdateProfileInput struct {\n\tDisplayName   string `json:\"display_name,omitempty\"`\n\tRecoveryEmail string `json:\"recovery_email,omitempty\"`\n}\n```\n\n```go\ntype User struct {\n\tID            string   `json:\"id\"`\n\tEmail         string   `json:\"email\"`\n\tDisplayName   string   `json:\"display_name,omitempty\"`\n\tRecoveryEmail string   `json:\"recovery_email,omitempty\"`\n\tRole          string   `json:\"role,omitempty\"`\n\tTenantIDs     []string `json:\"tenant_ids,omitempty\"`\n}\n```\n\n```go\ntype UserStore interface {\n\tCurrentUser(context.Context, Principal) (User, error)\n\tListUsers(context.Context, ListUsersFilter) ([]User, error)\n}\n```\n\n","path":"github.com/GoCodeAlone/workflow-plugin-auth/adminidentity","name":"adminidentity","synopsis":"Package adminidentity exposes reusable identity-administration HTTP handlers for Workflow auth consumers.","isRedistributable":true}
