Documentation
¶
Index ¶
- Constants
- func Permission(resource, action, id string) string
- type AuthenticationManager
- type AuthorizationManager
- type LocalAuthorization
- func (a *LocalAuthorization) AddPermission(ctx context.Context, username string, permission string) error
- func (a *LocalAuthorization) HasPermission(ctx context.Context, username string, permission string) bool
- func (a *LocalAuthorization) Init(ctx context.Context) error
- func (a *LocalAuthorization) ListPermissions(ctx context.Context, username string) ([]string, error)
- func (a *LocalAuthorization) ListUsersHasPermission(ctx context.Context, permissionRegexp string) ([]string, error)
- func (a *LocalAuthorization) RemovePermission(ctx context.Context, username string, permission string) error
- type UnVerifyJWTAuthenticationManager
- type UserInfo
Constants ¶
View Source
const ( PermissionAdmin = "*:*:*" PermissionNone = "" )
Variables ¶
This section is empty.
Functions ¶
func Permission ¶
Types ¶
type AuthenticationManager ¶
type AuthorizationManager ¶
type AuthorizationManager interface { AddPermission(ctx context.Context, username string, permissions string) error ListPermissions(ctx context.Context, username string) ([]string, error) ListUsersHasPermission(ctx context.Context, permission string) ([]string, error) RemovePermission(ctx context.Context, username string, permissions string) error HasPermission(ctx context.Context, username string, permission string) bool }
type LocalAuthorization ¶
type LocalAuthorization struct {
// contains filtered or unexported fields
}
func NewLocalAuthorization ¶
func NewLocalAuthorization(ctx context.Context, db *mongo.Database) *LocalAuthorization
func (*LocalAuthorization) AddPermission ¶
func (*LocalAuthorization) HasPermission ¶
func (*LocalAuthorization) ListPermissions ¶
func (*LocalAuthorization) ListUsersHasPermission ¶
func (*LocalAuthorization) RemovePermission ¶
type UnVerifyJWTAuthenticationManager ¶
type UnVerifyJWTAuthenticationManager struct{}
func NewUnVerifyJWTAuthenticationManager ¶
func NewUnVerifyJWTAuthenticationManager() *UnVerifyJWTAuthenticationManager
Click to show internal directories.
Click to hide internal directories.