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 { |
Ash Wilson | 89466cc | 2014-08-29 11:27:39 -0400 | [diff] [blame] | 8 | |
| 9 | // Options remembers the original authentication parameters, if reauthentication is enabled. |
| 10 | Options AuthOptions |
| 11 | |
Ash Wilson | 89466cc | 2014-08-29 11:27:39 -0400 | [diff] [blame] | 12 | // TokenID is the most recently valid token issued. |
| 13 | TokenID string |
| 14 | } |
| 15 | |
Ash Wilson | 89466cc | 2014-08-29 11:27:39 -0400 | [diff] [blame] | 16 | // AuthenticatedHeaders returns a map of HTTP headers that are common for all authenticated service |
| 17 | // requests. |
| 18 | func (client *ProviderClient) AuthenticatedHeaders() map[string]string { |
| 19 | return map[string]string{"X-Auth-Token": client.TokenID} |
| 20 | } |