blob: 971276e3fa0b18efeb4c0f69a7498ca164025901 [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 {
Ash Wilson89466cc2014-08-29 11:27:39 -04008
Ash Wilsonc6372fe2014-09-03 11:24:52 -04009 // IdentityEndpoint is the front door to an openstack provider.
10 // Generally this will be populated when you authenticate.
11 // It should be the *root* resource of the identity service, not of a specific identity version.
12 IdentityEndpoint string
13
Ash Wilson89466cc2014-08-29 11:27:39 -040014 // TokenID is the most recently valid token issued.
15 TokenID string
Ash Wilsonb8401a72014-09-08 17:07:49 -040016
17 // EndpointLocator describes how this provider discovers the endpoints for its constituent services.
18 EndpointLocator EndpointLocator
Ash Wilson89466cc2014-08-29 11:27:39 -040019}
20
Ash Wilsonc6372fe2014-09-03 11:24:52 -040021// AuthenticatedHeaders returns a map of HTTP headers that are common for all authenticated service requests.
Ash Wilson89466cc2014-08-29 11:27:39 -040022func (client *ProviderClient) AuthenticatedHeaders() map[string]string {
23 return map[string]string{"X-Auth-Token": client.TokenID}
24}