Documentation
¶
Overview ¶
Package auth issues and validates panel credentials.
Index ¶
- Variables
- func CheckPassword(hash, plain string) bool
- func HashPassword(plain string) (string, error)
- func HashToken(token string) string
- func NewNodeToken() (token, digest, preview string, err error)
- func RandomSecret(n int) string
- func TokenMatches(digest, token string) bool
- type Claims
- type Issuer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidToken = errors.New("invalid token")
Functions ¶
func CheckPassword ¶
func HashPassword ¶
HashPassword uses bcrypt, which keeps verification slow enough to make an offline attack on a leaked dump expensive.
func HashToken ¶
HashToken digests a node token. Node tokens are high-entropy random strings, so a plain SHA-256 is enough and keeps agent handshakes cheap.
func NewNodeToken ¶
NewNodeToken returns a fresh enrolment secret together with the digest stored in the database and a preview safe to show in the UI.
func RandomSecret ¶
RandomSecret returns a URL-safe random string of the given byte length.
func TokenMatches ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.