security

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const PermissionsUrl = "%s/v3/service_instances/%s/permissions"

Variables

This section is empty.

Functions

func Anonymous

func Anonymous(*http.Request) (bool, *string)

Anonymous default authenticator for anonymous access

func BasicAuth

func BasicAuth(r *http.Request) (bool, *string)

func Initialize

func Initialize()

func Middleware

func Middleware(authenticators []authenticatorMatchers) mux.MiddlewareFunc

func UAA

func UAA(request *http.Request) (bool, *string)

Types

type Authenticator

type Authenticator func(*http.Request) (authenticated bool, challenges *string)

Authenticator an authenticator function signature, it should return if a request is authenticated and if not, which challenges, if any, to return to the client

type MatchBuilder

type MatchBuilder interface {
	MatchPrefix(pathPrefix string) MatchBuilder
	AuthenticateWith(authenticator Authenticator) MiddlewareBuilder
}

MatchBuilder interface to build matching rules to apply a specific authentication method

func MatchPrefix

func MatchPrefix(pathPrefix string) MatchBuilder

type MiddlewareBuilder

type MiddlewareBuilder interface {
	MatchPrefix(pathPrefix string) MatchBuilder
	Default(authenticator Authenticator) MiddlewareBuilder
	Build() mux.MiddlewareFunc
}

MiddlewareBuilder interface for security middleware builder functions

Jump to

Keyboard shortcuts

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