auth

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizationFilterCode = "auth"

AuthorizationFilterCode is the code used to register this middleware

Variables

This section is empty.

Functions

func AuthorizationFilter

func AuthorizationFilter(opts AuthorizationOptions) middleware.Func

AuthorizationFilter is a middleware that handles authorization using an OpendID Connect server

func Forbidden

func Forbidden(writer http.ResponseWriter, err string)

Forbidden returns a StatusForbidden error

func InsufficientScope

func InsufficientScope(writer http.ResponseWriter, err string, scopes []string)

InsufficientScope adds to the response a WWW-Authenticate header and returns a StatusForbidden error

func UnauthorizedWithHeader

func UnauthorizedWithHeader(writer http.ResponseWriter, err string)

UnauthorizedWithHeader adds to the response a WWW-Authenticate header and returns a StatusUnauthorized error

Types

type AuthorizationEndpointOptions

type AuthorizationEndpointOptions struct {
	Audience          string            `mapstructure:"audience"`
	Disabled          bool              `mapstructure:"disabled"`
	ClaimsRequirement map[string]string `mapstructure:"claims_requirement"`
	AllowedScopes     []string          `mapstructure:"allowed_scopes"`
}

AuthorizationEndpointOptions are the options configured for each endpoint

type AuthorizationOptions

type AuthorizationOptions struct {
	Authority      string `mapstructure:"authority"`
	SecretProvider oidc.SecretProvider
}

AuthorizationOptions are the options configured for all endpoints

Jump to

Keyboard shortcuts

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