Ash Wilson | 89466cc | 2014-08-29 11:27:39 -0400 | [diff] [blame] | 1 | package gophercloud |
| 2 | |
Ash Wilson | 89466cc | 2014-08-29 11:27:39 -0400 | [diff] [blame] | 3 | // 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. |
| 7 | type 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 Wilson | 6425a41 | 2014-08-29 12:30:35 -0400 | [diff] [blame] | 14 | // IdentityEndpoint is the base URL of the provider's identity endpoint. |
| 15 | IdentityEndpoint string |
Ash Wilson | 89466cc | 2014-08-29 11:27:39 -0400 | [diff] [blame] | 16 | |
| 17 | // TokenID is the most recently valid token issued. |
| 18 | TokenID string |
| 19 | } |
| 20 | |
Ash Wilson | 89466cc | 2014-08-29 11:27:39 -0400 | [diff] [blame] | 21 | // AuthenticatedHeaders returns a map of HTTP headers that are common for all authenticated service |
| 22 | // requests. |
| 23 | func (client *ProviderClient) AuthenticatedHeaders() map[string]string { |
| 24 | return map[string]string{"X-Auth-Token": client.TokenID} |
| 25 | } |