Documentation ¶
Index ¶
- Constants
- func GetUser(ctx context.Context) string
- func SetUser(ctx context.Context, user string) context.Context
- func StreamServerInterceptor() grpc.StreamServerInterceptor
- func UnaryServerInterceptor(authFunc AuthorizationFunc) grpc.UnaryServerInterceptor
- type Auth
- func (a *Auth) Authenticate(ctx context.Context) (context.Context, error)
- func (a *Auth) Authorize(ctx context.Context, method string, req interface{}) error
- func (a *Auth) Disable() bool
- func (a *Auth) GetRoleClient() authorization.RoleClient
- func (a *Auth) OpenEventbus() bool
- func (a *Auth) OpenSubscription() bool
- func (a *Auth) RegisterAuthorizeFunc(method string, authorizeFunc AuthorizeFunc)
- type AuthorizationFunc
- type AuthorizeFunc
- type Config
Constants ¶
View Source
const TokenType = "Bearer"
Variables ¶
This section is empty.
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor() grpc.StreamServerInterceptor
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(authFunc AuthorizationFunc) grpc.UnaryServerInterceptor
Types ¶
type Auth ¶
type Auth struct { Authentication authentication.Authentication Authorization authorization.Authorization RoleClient authorization.RoleClient TokenClient authentication.TokenClient // contains filtered or unexported fields }
func (*Auth) Authenticate ¶
func (*Auth) GetRoleClient ¶
func (a *Auth) GetRoleClient() authorization.RoleClient
func (*Auth) OpenEventbus ¶
func (*Auth) OpenSubscription ¶
func (*Auth) RegisterAuthorizeFunc ¶
func (a *Auth) RegisterAuthorizeFunc(method string, authorizeFunc AuthorizeFunc)
type AuthorizationFunc ¶
type AuthorizeFunc ¶
type AuthorizeFunc func(ctx context.Context, req interface{}) (authorization.ResourceKind, vanus.ID, authorization.Action)
Click to show internal directories.
Click to hide internal directories.