Documentation ¶
Index ¶
- Constants
- Variables
- func AuthFromMD(ctx context.Context, expectedScheme string) (string, error)
- func AuthFunction(ctx context.Context, jwtValidator *validator.Validator, config *config.Config) (ctxResult context.Context, err error)
- func Get(config *config.Config) (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)
- func GetJWTValidator(config *config.Config) *validator.Validator
- func PprofUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func TimeoutUnaryServerInterceptor(timeout time.Duration) grpc.UnaryServerInterceptor
- func TxCtxUnaryServerInterceptor(timeout time.Duration) grpc.UnaryServerInterceptor
- type CustomClaim
- type Organization
- type RateLimiter
- type User
Constants ¶
Variables ¶
View Source
var ( DefaultTimeout = 5 * time.Second MaximumTimeout = 300 * time.Second )
Functions ¶
func AuthFunction ¶
func Get ¶
func Get(config *config.Config) (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)
func PprofUnaryServerInterceptor ¶
func PprofUnaryServerInterceptor() grpc.UnaryServerInterceptor
func TimeoutUnaryServerInterceptor ¶
func TimeoutUnaryServerInterceptor(timeout time.Duration) grpc.UnaryServerInterceptor
TimeoutUnaryServerInterceptor returns a new unary server interceptor that sets request timeout if it's not set in the context
func TxCtxUnaryServerInterceptor ¶
func TxCtxUnaryServerInterceptor(timeout time.Duration) grpc.UnaryServerInterceptor
Types ¶
type CustomClaim ¶
type CustomClaim struct { Roles []string `json:"https://tigris-db-api/r"` Org Organization `json:"https://tigris-db-api/o"` User User `json:"https://tigris-db-api/u"` }
type Organization ¶
type Organization struct {
Code string `json:"code"`
}
type RateLimiter ¶
type RateLimiter struct { }
Click to show internal directories.
Click to hide internal directories.