Documentation ¶
Index ¶
- func GetToken(endpoint string, insecure bool, credential Credential, ...) (*models.Token, error)
- func NewRawTokenAuthorizer(username, service string) modifier.Modifier
- func NewStandardTokenAuthorizer(client *http.Client, credential Credential, customizedTokenService ...string) modifier.Modifier
- func ParseChallengeFromResponse(resp *http.Response) []challenge.Challenge
- type Credential
- type UserAgentModifier
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 ¶
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` 请求中
Types ¶
type Credential ¶
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
Click to show internal directories.
Click to hide internal directories.