Documentation ¶
Index ¶
- Variables
- func HandlerAuthMiddleware(pgx *db.PGClient, store *db.Storage) func(c *fiber.Ctx) error
- func HandlerTokenMiddleware(pgx *db.PGClient, store *db.Storage) func(c *fiber.Ctx) error
- func HandlerV1BasicAuthorizer(user, pass string) bool
- func HandlerV1BasicSignIn(pgx *db.PGClient, store *db.Storage) func(c *fiber.Ctx) error
- func HandlerV1BasicUnauthorized(c *fiber.Ctx) error
- func HandlerV1SignOut(pgx *db.PGClient, store *db.Storage) func(c *fiber.Ctx) error
- func HandlerV1UserInfo(pgx *db.PGClient) func(c *fiber.Ctx) error
- func PEMEncodeToMemory(privateKey *rsa.PrivateKey) ([]byte, []byte, error)
- func ParsePKCS1PrivateKey(privateKey []byte) (*rsa.PrivateKey, *rsa.PublicKey, error)
- type AccessToken
- type AuthToken
- type TokenClaims
- type UserAccount
- type UserPermission
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DBAccessToken map[string]*AccessToken SessionTimeout time.Duration = time.Hour * 4 )
Functions ¶
func HandlerAuthMiddleware ¶
func HandlerTokenMiddleware ¶
func HandlerV1BasicSignIn ¶
func HandlerV1BasicUnauthorized ¶
func HandlerV1BasicUnauthorized(c *fiber.Ctx) error
func HandlerV1SignOut ¶
func HandlerV1UserInfo ¶
func PEMEncodeToMemory ¶
func PEMEncodeToMemory(privateKey *rsa.PrivateKey) ([]byte, []byte, error)
func ParsePKCS1PrivateKey ¶
Types ¶
type AccessToken ¶
type TokenClaims ¶
type TokenClaims struct { Name string `json:"nae"` UUID string `json:"usr"` ID string `json:"jti"` Issuer string `json:"iss"` NotBefore int64 `json:"nbf"` IssuedAt int64 `json:"iat"` ExpiresAt int64 `json:"exp"` }
func (*TokenClaims) RefreshExpire ¶
func (c *TokenClaims) RefreshExpire()
type UserAccount ¶
type UserPermission ¶
type UserPermission struct {
Name string `json:"name"`
}
Click to show internal directories.
Click to hide internal directories.