auth

package
v0.0.0-...-977965f Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 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 返回标准的 token 授权器,授权器会将 token 信息附加到 request` 请求中

func ParseChallengeFromResponse

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

ParseChallengeFromResponse ... Challenge-Response协议 基于挑战/应答(Challenge/Response)方式的身份认证系统就是每次认证时认证服务器端都给客户端发送一个不同的"挑战"字串, 客户端程序收到这个"挑战"字串后,做出相应的"应答",以此机制而研制的系统.

Types

type Credential

type Credential modifier.Modifier

Credential ...

func NewBasicAuthCredential

func NewBasicAuthCredential(username, password string) Credential

NewBasicAuthCredential ...

type UserAgentModifier

type UserAgentModifier struct {
	UserAgent string
}

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

func (*UserAgentModifier) Modify

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