blob: a57bc7a52af69632f398c19798169925b245073f [file] [log] [blame]
Ash Wilson89466cc2014-08-29 11:27:39 -04001package gophercloud
2
Ash Wilson89466cc2014-08-29 11:27:39 -04003// ProviderClient stores details that are required to interact with any services within a specific provider's API.
4//
5// Generally, you acquire a ProviderClient by calling the `NewClient()` method in the appropriate provider's child package,
6// providing whatever authentication credentials are required.
7type ProviderClient struct {
8 // Authority caches results of the most recent authentication.
9 Authority AuthResults
10
11 // Options remembers the original authentication parameters, if reauthentication is enabled.
12 Options AuthOptions
13
Ash Wilson6425a412014-08-29 12:30:35 -040014 // IdentityEndpoint is the base URL of the provider's identity endpoint.
15 IdentityEndpoint string
Ash Wilson89466cc2014-08-29 11:27:39 -040016
17 // TokenID is the most recently valid token issued.
18 TokenID string
19}
20
Ash Wilson89466cc2014-08-29 11:27:39 -040021// AuthenticatedHeaders returns a map of HTTP headers that are common for all authenticated service
22// requests.
23func (client *ProviderClient) AuthenticatedHeaders() map[string]string {
24 return map[string]string{"X-Auth-Token": client.TokenID}
25}