middleware

package
v0.4.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequiredScopes

type RequiredScopes map[string]oauth2.Scope

RequiredScopes defines the scope each endpoint requires

type ScopesMiddleware deprecated

type ScopesMiddleware struct {
	RequiredScopes RequiredScopes
}

Deprecated: ScopesMiddleware contains required scopes for each endpoint - For generated APIs use the generated AuthenticationBackend with oauth2.Authorizer and set a Scope

func NewScopesMiddleware deprecated

func NewScopesMiddleware(scopes RequiredScopes) *ScopesMiddleware

Deprecated: NewScopesMiddleware return a new scopes middleware - For generated APIs use the generated AuthenticationBackend with oauth2.Authorizer and set a scope

func (*ScopesMiddleware) Handler

func (m *ScopesMiddleware) Handler(next http.Handler) http.Handler

Handler checks if the token extracted from the request's context has the required scope for the requested route and returns a 401 response if not.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL