Documentation ¶
Index ¶
- Variables
- func AccessCheckMiddleware(a access.Helper, permissions ...string) endpoint.Middleware
- func AccessClaimsFactory() jwt.Claims
- func KitAdapterMiddleware(j Service) endpoint.Middleware
- func Middleware(j Service, a access.Helper, permissions ...string) endpoint.Middleware
- func ValidatorFactory(a access.Helper, permissions ...string) func(acc access.Access) bool
- type AccessClaims
- type ClaimsFactory
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var (
)
View Source
var (
ValidMethodsEC = []string{jwt.SigningMethodES256.Name}
)
Functions ¶
func AccessCheckMiddleware ¶
func AccessCheckMiddleware(a access.Helper, permissions ...string) endpoint.Middleware
func AccessClaimsFactory ¶
func AccessClaimsFactory() jwt.Claims
func KitAdapterMiddleware ¶
func KitAdapterMiddleware(j Service) endpoint.Middleware
func Middleware ¶
Types ¶
type AccessClaims ¶
type AccessClaims struct { jwt.RegisteredClaims UserID uint32 `json:"user_id"` AccountID uint32 `json:"account_id"` Access access.Access `json:"access"` }
func NewAccessClaims ¶
func (AccessClaims) Valid ¶
func (c AccessClaims) Valid() error
type ClaimsFactory ¶
type ClaimsFactory func() jwt.Claims
type Service ¶
type Service interface { AccessToken(userID, accID uint32, acc access.Access, aud []string, duration time.Duration) (string, error) VerifyAccessToken(token string) (jwt.Claims, error) ClaimsFactory() ClaimsFactory SigningMethod() jwt.SigningMethod Key() *ecdsa.PrivateKey PublicKey() *ecdsa.PublicKey }
Click to show internal directories.
Click to hide internal directories.