Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPasswordHash(hash, password string) bool
- func ConvertTokenKeyToHash(token string) (string, error)
- func ExtractTokenFromRequest(req *http.Request) string
- func HashPassword(password string) (string, error)
- func IsExpired(token *mgmtv1.Token) bool
- func SetTokenExpiresAt(token *mgmtv1.Token)
- func SplitTokenParts(tokenID string) (string, string)
- func VerifyToken(token *mgmtv1.Token, tokenName, tokenKey string) (int, error)
- type Manager
Constants ¶
View Source
const ( LabelAuthUserId = "auth.management.llmos.ai/user-id" LabelAuthTokenKind = "auth.management.llmos.ai/kind" LocalProviderName = "local" CookieName = "L_SESS" CSRFCookie = "CSRF" )
View Source
const ( AuthHeaderName = "Authorization" AuthValuePrefix = "Bearer" BasicAuthPrefix = "Basic" )
Variables ¶
View Source
var (
ErrInvalidTokenFormat = errors.New("invalid token format")
)
Functions ¶
func CheckPasswordHash ¶
func ConvertTokenKeyToHash ¶
ConvertTokenKeyToHash helps to convert token key to hash
func ExtractTokenFromRequest ¶
func HashPassword ¶
func SetTokenExpiresAt ¶
func SplitTokenParts ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) NewAPIKeyToken ¶
Click to show internal directories.
Click to hide internal directories.