runtime: github.com/go-openapi/runtime/security Index | Files

package security

import "github.com/go-openapi/runtime/security"

Index

Package Files

authenticator.go authorizer.go

Variables

var DefaultRealmName = "API"

func APIKeyAuth Uses

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 APIKeyAuthCtx Uses

func APIKeyAuthCtx(name, in string, authenticate TokenAuthenticationCtx) runtime.Authenticator

APIKeyAuthCtx creates an authenticator that uses a token for authorization with support for context.Context. This token can be obtained from either a header or a query string

func Authorized Uses

func Authorized() runtime.Authorizer

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

func BasicAuth Uses

func BasicAuth(authenticate UserPassAuthentication) runtime.Authenticator

BasicAuth creates a basic auth authenticator with the provided authentication function

func BasicAuthCtx Uses

func BasicAuthCtx(authenticate UserPassAuthenticationCtx) runtime.Authenticator

BasicAuthCtx creates a basic auth authenticator with the provided authentication function with support for context.Context

func BasicAuthRealm Uses

func BasicAuthRealm(realm string, authenticate UserPassAuthentication) runtime.Authenticator

BasicAuthRealm creates a basic auth authenticator with the provided authentication function and realm name

func BasicAuthRealmCtx Uses

func BasicAuthRealmCtx(realm string, authenticate UserPassAuthenticationCtx) runtime.Authenticator

BasicAuthRealmCtx creates a basic auth authenticator with the provided authentication function and realm name with support for context.Context

func BearerAuth Uses

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

BearerAuth for use with oauth2 flows

func BearerAuthCtx Uses

func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runtime.Authenticator

BearerAuthCtx for use with oauth2 flows with support for context.Context.

func FailedBasicAuth Uses

func FailedBasicAuth(r *http.Request) string

func FailedBasicAuthCtx Uses

func FailedBasicAuthCtx(ctx context.Context) string

func HttpAuthenticator Uses

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

HttpAuthenticator is a function that authenticates a HTTP request

func OAuth2SchemeName Uses

func OAuth2SchemeName(r *http.Request) string

func OAuth2SchemeNameCtx Uses

func OAuth2SchemeNameCtx(ctx context.Context) string

func ScopedAuthenticator Uses

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

type ScopedAuthRequest Uses

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

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

type ScopedTokenAuthentication Uses

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

ScopedTokenAuthentication authentication function

type ScopedTokenAuthenticationCtx Uses

type ScopedTokenAuthenticationCtx func(context.Context, string, []string) (context.Context, interface{}, error)

ScopedTokenAuthenticationCtx authentication function with context.Context

type TokenAuthentication Uses

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

TokenAuthentication authentication function

type TokenAuthenticationCtx Uses

type TokenAuthenticationCtx func(context.Context, string) (context.Context, interface{}, error)

TokenAuthenticationCtx authentication function with context.Context

type UserPassAuthentication Uses

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

UserPassAuthentication authentication function

type UserPassAuthenticationCtx Uses

type UserPassAuthenticationCtx func(context.Context, string, string) (context.Context, interface{}, error)

UserPassAuthenticationCtx authentication function with context.Context

Package security imports 5 packages (graph) and is imported by 68 packages. Updated 2019-08-18. Refresh now. Tools for package owners.