security

package
v0.0.0-...-6c4fc3a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIKeyAuth

func APIKeyAuth(name, in string, authenticate TokenAuthentication) runtime.Authenticator

APIKeyAuth creates an authenticator that uses a token for authorization. This token can be obtained from either a header or a query string

func Authorized

func Authorized() runtime.Authorizer

Authorized provides a default implementation of the Authorizer interface where all requests are authorized (successful)

func BasicAuth

func BasicAuth(authenticate UserPassAuthentication) runtime.Authenticator

BasicAuth creates a basic auth authenticator with the provided authentication function

func BearerAuth

func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Authenticator

BearerAuth for use with oauth2 flows

func HttpAuthenticator

func HttpAuthenticator(handler func(*http.Request) (bool, interface{}, error)) runtime.Authenticator

HttpAuthenticator is a function that authenticates a HTTP request

func ScopedAuthenticator

func ScopedAuthenticator(handler func(*ScopedAuthRequest) (bool, interface{}, error)) runtime.Authenticator

ScopedAuthenticator is a function that authenticates a HTTP request against a list of valid scopes

Types

type ScopedAuthRequest

type ScopedAuthRequest struct {
	Request        *http.Request
	RequiredScopes []string
}

ScopedAuthRequest contains both a http request and the required scopes for a particular operation

type ScopedTokenAuthentication

type ScopedTokenAuthentication func(string, []string) (interface{}, error)

ScopedTokenAuthentication authentication function

type TokenAuthentication

type TokenAuthentication func(string) (interface{}, error)

TokenAuthentication authentication function

type UserPassAuthentication

type UserPassAuthentication func(string, string) (interface{}, error)

UserPassAuthentication authentication function

Jump to

Keyboard shortcuts

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