middleware

package
v0.37.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: BSD-3-Clause Imports: 14 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControl added in v0.10.4

type AccessControl struct {
	// contains filtered or unexported fields
}

AccessControl middleware to restrict to make POST/PUT/DELETE requests by admin only

func NewAccessControl added in v0.10.4

func NewAccessControl(getUser GetUser) *AccessControl

NewAccessControl instance constructor

func (*AccessControl) Handler added in v0.10.4

func (a *AccessControl) Handler(h http.Handler) http.Handler

Handler method of the middleware which forbids all modify requests for non admin users

type AuthMiddleware added in v0.15.0

type AuthMiddleware struct {
	// contains filtered or unexported fields
}

AuthMiddleware middleware to verify personal access tokens (PAT) and JWT tokens

func NewAuthMiddleware added in v0.15.0

func NewAuthMiddleware(
	authManager auth.Manager,
	ensureAccount EnsureAccountFunc,
	syncUserJWTGroups SyncUserJWTGroupsFunc,
) *AuthMiddleware

NewAuthMiddleware instance constructor

func (*AuthMiddleware) Handler added in v0.15.0

func (m *AuthMiddleware) Handler(h http.Handler) http.Handler

Handler method of the middleware which authenticates a user either by JWT claims or by PAT

type EnsureAccountFunc added in v0.37.0

type EnsureAccountFunc func(ctx context.Context, userAuth nbcontext.UserAuth) (string, string, error)

type GetUser added in v0.20.0

type GetUser func(ctx context.Context, userAuth nbcontext.UserAuth) (*types.User, error)

GetUser function defines a function to fetch user from Account by jwtclaims.AuthorizationClaims

type SyncUserJWTGroupsFunc added in v0.37.0

type SyncUserJWTGroupsFunc func(ctx context.Context, userAuth nbcontext.UserAuth) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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