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
Types ¶
type Credential ¶
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
Click to show internal directories.
Click to hide internal directories.