credential

package
v0.1.59 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserTokenPrefix  = "ol_user_"
	AgentTokenPrefix = "ol_agent_"
	RandomBytes      = 32
	PrefixLen        = len(UserTokenPrefix) + 4

	// BcryptCost is the default cost for persisted credential hashes.
	BcryptCost = 12

	FastTokenHashPrefix = "sha256:"
)

Variables

This section is empty.

Functions

func BcryptTokenInput

func BcryptTokenInput(token string) []byte

func FastTokenHash

func FastTokenHash(token string) string

func GenerateAgentToken

func GenerateAgentToken() (plaintext, prefix string, err error)

func GenerateUserToken

func GenerateUserToken() (plaintext, prefix string, err error)

func HasAnyPrefix

func HasAnyPrefix(token string, prefixes ...string) bool

func ValidLengthForPrefix

func ValidLengthForPrefix(token, tokenPrefix string) bool

func VerifyFastTokenHash

func VerifyFastTokenHash(storedHash, token string) bool

func VerifyTokenHash

func VerifyTokenHash(storedHash, token string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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