auth

package
v1.8.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 18 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 modifier.Modifier

Credential ...

func NewBasicAuthCredential

func NewBasicAuthCredential(username, password string) Credential

NewBasicAuthCredential ...

type UserAgentModifier added in v1.7.0

type UserAgentModifier struct {
	UserAgent string
}

UserAgentModifier adds the "User-Agent" header to the request

func (*UserAgentModifier) Modify added in v1.7.0

func (u *UserAgentModifier) Modify(req *http.Request) error

Modify adds user-agent header to the request

Jump to

Keyboard shortcuts

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