Documentation
¶
Overview ¶
Package auth contains authentication primitives shared by the HTTP and store layers.
Index ¶
- Constants
- func HashOpaqueToken(raw string) string
- func HashPassword(password string) (string, error)
- func NewOpaqueToken(prefix string) (raw, hash string, err error)
- func VerifyPassword(hash, password string) error
- func WithPrincipal(ctx context.Context, p Principal) context.Context
- type Principal
- type Role
- type SecretAssociatedData
- type SecretBox
Constants ¶
View Source
const SecretKeySize = 32
SecretKeySize is the required key length for AES-256-GCM.
Variables ¶
This section is empty.
Functions ¶
func HashOpaqueToken ¶
HashOpaqueToken returns a SHA-256 hash suitable for storing opaque token lookups.
func HashPassword ¶
HashPassword returns a bcrypt hash for password.
func NewOpaqueToken ¶
NewOpaqueToken creates a random token with prefix and returns the raw token plus its stable hash.
func VerifyPassword ¶
VerifyPassword compares password with a stored bcrypt hash.
Types ¶
type SecretAssociatedData ¶
SecretAssociatedData binds ciphertext to a tenant, subject, and credential kind.
type SecretBox ¶
type SecretBox struct {
// contains filtered or unexported fields
}
SecretBox seals and opens secrets using authenticated encryption.
func NewSecretBox ¶
NewSecretBox creates a SecretBox from a 32-byte key.
Click to show internal directories.
Click to hide internal directories.