auth

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Public = &public{}

Public is the auth strategy that does not add any authorization

Functions

This section is empty.

Types

type Strategy

type Strategy interface {
	// DecorateRequest decorates an HTTP
	// request with an authorization method
	// for the given scope
	DecorateRequest(request *http.Request)

	// WithScope transforms the strategy into
	// a new Strategy that uses the requested scope
	WithScope(scope string) Strategy
}

Strategy represents an authorization method

func AccessKey

func AccessKey(s string) Strategy

AccessKey creates a authorization strategy that uses the specified access key

func AccessToken

func AccessToken(s string) Strategy

AccessToken returns an authorization strategy that uses the specified access token to authorize

func AccessTokenWithManager

func AccessTokenWithManager(s string, manager tokens.Manager) Strategy

AccessTokenWithManager returns an authorization strategy that uses the specified access token to authorize and that uses the specified manager to fetch new tokens if required.

func BasicAuth

func BasicAuth(username, password string) Strategy

AccessKey creates a authorization strategy that uses the specified access key

Jump to

Keyboard shortcuts

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