Documentation ¶
Index ¶
Constants ¶
View Source
const Header = "authorization"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interceptor ¶
type Interceptor interface { Unary() grpc.UnaryServerInterceptor Stream() grpc.StreamServerInterceptor }
func NewInterceptor ¶
func NewInterceptor(manager TokenManager, accessibleRoles map[string][]string, log *zap.Logger) Interceptor
type TokenManager ¶
type TokenManager interface { Generate(user, role string) (string, error) Verify(accessToken string) (*UserClaims, error) GetUserClaimsFromContext(ctx context.Context) (*UserClaims, bool) PutUserClaimsToContext(ctx context.Context, claims *UserClaims) context.Context }
func NewJWTManager ¶
func NewJWTManager(secretKey string, tokenDuration time.Duration) TokenManager
type UserClaims ¶
Click to show internal directories.
Click to hide internal directories.