middleware

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AdminPrefixRegexp     = regexp.MustCompile(`^/admin`)
	ChooserPrefixRegexp   = regexp.MustCompile(`^/chooser|^/$`)
	MlflowAimPrefixRegexp = regexp.MustCompile(`^/aim/api|^/ajax-api/2.0/mlflow|^/api/2.0/mlflow`)
)

regexps to detect requested API.

Functions

func GetBasicAuthTokenFromContext

func GetBasicAuthTokenFromContext(ctx context.Context) (*models.BasicAuthToken, error)

GetBasicAuthTokenFromContext returns Basic Auth Token from the context.

func GetNamespaceFromContext

func GetNamespaceFromContext(ctx context.Context) (*models.Namespace, error)

GetNamespaceFromContext returns models.Namespace object from the context.

func GetOIDCUserFromContext

func GetOIDCUserFromContext(ctx context.Context) (*auth.User, error)

GetOIDCUserFromContext returns OIDC User object from the context.

func NewBasicAuthMiddleware

func NewBasicAuthMiddleware(userPermissions *models.UserPermissions) fiber.Handler

NewBasicAuthMiddleware creates new Basic Auth middleware logic.

func NewNamespaceMiddleware

func NewNamespaceMiddleware(namespaceRepository repositories.NamespaceRepositoryProvider) fiber.Handler

NewNamespaceMiddleware creates new Middleware instance.

func NewOIDCMiddleware

func NewOIDCMiddleware(
	client auth.OIDCClientProvider,
	rolesRepository repositories.RoleRepositoryProvider,
) fiber.Handler

NewOIDCMiddleware creates new OIDC middleware logic.

Types

type BasicAuthMiddleware

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

BasicAuthMiddleware represents Basic Auth middleware.

func (BasicAuthMiddleware) Handle

func (m BasicAuthMiddleware) Handle() fiber.Handler

Handle handles OIDC middleware logic.

type OIDCMiddleware

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

OIDCMiddleware represents OIDC middleware.

func (OIDCMiddleware) Handle

func (m OIDCMiddleware) Handle() fiber.Handler

Handle handles OIDC middleware logic.

Jump to

Keyboard shortcuts

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