credential

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package credential owns private primitives shared by stored authentication credentials. Public packages preserve their own typed persistence boundaries.

Index

Constants

View Source
const EncodedSecretBytes = 43
View Source
const SecretBytes = 32

Variables

This section is empty.

Functions

func AddressKey

func AddressKey(namespace keyspace.Namespace, guard, provider, table string) (string, error)

func CheckCreation

func CheckCreation[T any](ctx context.Context, check func(context.Context, *database.Tx) error, create func(func(context.Context, *database.Tx) error) (T, error)) (T, error)

CheckCreation ensures a synchronous adapter called the supplied check exactly once and did not suppress its failure. Adapter transaction correctness remains its contract; metadata inspection cannot undo a misbehaving adapter's commit.

func InSchema

func InSchema(ctx context.Context, tx *database.Tx, db *database.DB, schema string, fn func(*database.Tx) error) error

InSchema reuses the shared infrastructure savepoint and schema boundary.

func IsNil

func IsNil(v any) bool

func SubjectKey

func SubjectKey(scope, table string, identity model.Identity) (string, error)

func ValidateAddress

func ValidateAddress(namespace keyspace.Namespace, guard, provider, table string) error

Types

type Digest

type Digest struct {
	// contains filtered or unexported fields
}

func Fingerprint

func Fingerprint(parts ...string) Digest

Fingerprint hashes exact ordered UTF-8 components using the same unambiguous encoding as credential addresses. Callers validate their own size/shape limits.

func Hash

func Hash(value secret.String) (Digest, error)

func New

func New() (secret.String, Digest, error)

func ParseDigest

func ParseDigest(text string) (Digest, error)

func (Digest) Equal

func (d Digest) Equal(other Digest) bool

func (Digest) Hex

func (d Digest) Hex() string

func (Digest) IsZero

func (d Digest) IsZero() bool

type Gate

type Gate struct {
	// contains filtered or unexported fields
}

Gate owns callback capacity until actual exit, including cancellation/Goexit. It does not own the borrowed backend or retry uncertain operations. A burst queues for at most admission.Wait(timeout); an unsatisfied wait reports fault.Overloaded before the operation starts.

func NewGate

func NewGate(maximum int, timeout time.Duration) *Gate

func (*Gate) Execute

func (g *Gate) Execute(ctx context.Context, fn func(context.Context) error) error

Jump to

Keyboard shortcuts

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