credential

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package credential defines the Credential entity: the material used to prove an identity (password hash, passkey public key, API key hash, ...).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential struct {
	ID        string     `json:"id"`
	UserID    string     `json:"user_id"`
	AccountID string     `json:"account_id"`
	Type      Type       `json:"type"`
	Secret    string     `json:"secret"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	RevokedAt *time.Time `json:"revoked_at,omitempty"`
}

Credential is authentication material bound to an account.

Secret never holds plaintext secrets: for passwords it stores the encoded hash produced by password.Hasher; plugins must apply equivalent care.

func (*Credential) Active

func (c *Credential) Active() bool

Active reports whether the credential has not been revoked.

type Type

type Type string

Type identifies the kind of credential material.

const TypePassword Type = "password"

TypePassword is the credential type for password hashes managed by the core. Plugins define their own types (e.g. "passkey", "api_key", "recovery_code").

Jump to

Keyboard shortcuts

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