auth

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToken

func GetToken(endpoint string, insecure bool, credential Credential,
	scopes []*token.ResourceActions) (*models.Token, error)

GetToken requests a token against the endpoint using credetial provided

func NewRawTokenAuthorizer

func NewRawTokenAuthorizer(username, service string) modifier.Modifier

NewRawTokenAuthorizer returns a token authorizer which calls method to create token directly

func NewStandardTokenAuthorizer

func NewStandardTokenAuthorizer(client *http.Client, credential Credential,
	customizedTokenService ...string) modifier.Modifier

NewStandardTokenAuthorizer returns a standard token authorizer. The authorizer will request a token from token server and add it to the origin request If customizedTokenService is set, the token request will be sent to it instead of the server get from authorizer

func ParseChallengeFromResponse

func ParseChallengeFromResponse(resp *http.Response) []challenge.Challenge

ParseChallengeFromResponse ...

Types

type Credential

type Credential interface {
	// AddAuthorization adds authorization information to request
	AddAuthorization(req *http.Request)
}

Credential ...

func NewBasicAuthCredential

func NewBasicAuthCredential(username, password string) Credential

NewBasicAuthCredential ...

func NewCookieCredential

func NewCookieCredential(c *http.Cookie) Credential

NewCookieCredential initialize a cookie based crendential handler, the cookie in parameter will be added to request to registry if this crendential is attached to a registry client.

Jump to

Keyboard shortcuts

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