Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationProvider ¶
AuthorizationProvider defines structs that can provide Authorization headers
type IDSAuthorizationProvider ¶
type IDSAuthorizationProvider struct { // The latest token. May be expired. CurrentToken *IDSToken // TokenClient retrievees new tokens TokenClient OAuth2Client // The Credentials used to retrieve new tokens Credentials OAuth2Credentials }
Generates IDS Authorization Header values
func NewIDSAuthorizationProvider ¶
func NewIDSAuthorizationProvider( baseIDSURL url.URL, credentials OAuth2Credentials, ) (*IDSAuthorizationProvider, error)
Creates a new IDSAuthorizationProvider with the given credentials that retrieves tokens from the specified URL
func (*IDSAuthorizationProvider) GetAuthorizationHeader ¶
func (ip *IDSAuthorizationProvider) GetAuthorizationHeader() (string, error)
GetAuthorizationHeader creates an authorization header value for the current token, refreshing it if it has expired. Used for EdgeCast APIs that use IDS OAuth 2.0 tokens.
type IDSClient ¶
Calls the IDS token endpoint
func (IDSClient) GetToken ¶
func (c IDSClient) GetToken( credentials OAuth2Credentials, ) (*OAuth2TokenResponse, error)
Gets a new token from the IDS Token Endpoint
type OAuth2Client ¶
type OAuth2Client interface {
GetToken(credentials OAuth2Credentials) (*OAuth2TokenResponse, error)
}
Defines structs that can retrieve OAuth 2.0 Tokens
type OAuth2Credentials ¶
Holds a customer's OAuth 2.0 Credentials
type OAuth2ErrorResponse ¶ added in v1.0.0
type OAuth2ErrorResponse struct {
Error string `json:"error"`
}
OAuth2ErrorResponse represents an error response from an identity server
type OAuth2TokenResponse ¶
type OAuth2TokenResponse struct { AccessToken string `json:"access_token"` ExpiresIn float64 `json:"expires_in"` TokenType string `json:"token_type"` Scope string `json:"scope"` }
OAuth2TokenResponse represents the response from an identity server when retrieving a new token
type TokenAuthorizationProvider ¶
type TokenAuthorizationProvider struct {
APIToken string
}
TokenAuthorizationProvider creates authorization header values for legacy EdgeCast API calls
func NewTokenAuthorizationProvider ¶
func NewTokenAuthorizationProvider( apiToken string, ) (*TokenAuthorizationProvider, error)
NewTokenAuthorizationProvider -
func (*TokenAuthorizationProvider) GetAuthorizationHeader ¶
func (lp *TokenAuthorizationProvider) GetAuthorizationHeader() (string, error)
GetAuthorizationHeader gets the authorization header value for EdgeCast APIs that require an API Token