middleware

package
v0.0.0-...-ea90e7c Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendMongoCollection

func AppendMongoCollection(collectionName string) func(http.Handler) http.Handler

AppendMongoCollection attaches the collection needed for the request to the context of the request

func ExtractCollection

func ExtractCollection(r *http.Request) (collection *mongo.Collection, err error)

func ExtractUserInfo

func ExtractUserInfo(r *http.Request) (username string, fullName string, subject string, groups []string, err error)

ExtractUserInfo allows the retrieval of the available user information that has been set by the OpenIDConnectJWTAuthentication middleware. If any of the expected user information fields is empty, it will return an error

func OpenIDConnectJWTAuthentication

func OpenIDConnectJWTAuthentication(config configurationTypes.OpenIDConnectConfiguration) func(http.Handler) http.Handler

OpenIDConnectJWTAuthentication uses the Access Token present in the request headers to authenticate and check the authorization of the user making a call to the backend. To check a request for authorization, the middleware validates the access token via the JWKS uri and checks the information contained in the access token. Furthermore, it will also check that the access token contains the correct scopes to allow access to the backend. To allow the individual access control to some routes, the middleware attaches all scopes found to the request context. This way, the routes may filter the scopes further, if needed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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