Documentation ¶
Index ¶
- Variables
- func HasOneOfRole(roles []string, apiKey *models.ApiKey) bool
- func HasRole(role string, apiKey *models.ApiKey) bool
- func NewApiKeyContext(ctx context.Context, apiKey *models.ApiKey) context.Context
- func NewAuthorizationContext(ctx context.Context, apiKey string) context.Context
- func NewRateLimiterContext(ctx context.Context, cache *cache.Redis, apiKey *models.ApiKey) context.Context
- func SetRateLimiterHeaders(ctx context.Context, w http.ResponseWriter) bool
- func ToApiKeyContext(ctx context.Context) (*models.ApiKey, bool)
- func ToRateLimiterContext(ctx context.Context) (*rate_limiter.RateLimiter, bool)
- func WithAcl(dbAdapter db.Adapter, cache *cache.Redis) zenrpc.MiddlewareFunc
- func WithHeaders() zenrpc.MiddlewareFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RateLimiterKeyContext string = "rate_limiter"
)
Functions ¶
func HasOneOfRole ¶
HasOneOfRole checks if the user has permission to access the given method based on multiple roles
func NewApiKeyContext ¶
func NewAuthorizationContext ¶
func NewRateLimiterContext ¶
func SetRateLimiterHeaders ¶ added in v0.9.6
func SetRateLimiterHeaders(ctx context.Context, w http.ResponseWriter) bool
func ToRateLimiterContext ¶
func ToRateLimiterContext(ctx context.Context) (*rate_limiter.RateLimiter, bool)
func WithAcl ¶
WithAcl is a middleware that performs access control based on the provided db.Adapter
func WithHeaders ¶
func WithHeaders() zenrpc.MiddlewareFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.