Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewJWTManager), fx.Provide( fx.Annotate( NewAclManager, fx.ParamTags(``, `optional:"true"`), ), ), )
Functions ¶
This section is empty.
Types ¶
type ACL ¶
type ACL interface { Configure(ctx context.Context, rsc string, role Role) error Delete(ctx context.Context, rsc string) error Authorized(ctx context.Context, rsc string, role Role) bool Allowed(ctx context.Context, rsc string) []Role }
func NewAclManager ¶
type Acl ¶
func (*Acl) GetNamespace ¶
type JWTManager ¶
type JWTManager interface { Generate(user User, timeout time.Duration) (string, error) Verify(accessToken string) (*UserClaims, error) }
func NewJWTManager ¶
func NewJWTManager(c config.Config) (JWTManager, error)
NewJWTManager returns a new JWT manager
type UserClaims ¶
type UserClaims struct { jwt.StandardClaims ID string `json:"id"` Role string `json:"role"` Mtdt map[string]interface{} `json:"mtdt"` }
UserClaims is a custom JWT claims that contains some user's information
Click to show internal directories.
Click to hide internal directories.