Trim unused fields out of (Provider|Service)Client.
diff --git a/provider_client.go b/provider_client.go
index 17fefa0..7f8b892 100644
--- a/provider_client.go
+++ b/provider_client.go
@@ -6,15 +6,19 @@
// providing whatever authentication credentials are required.
type ProviderClient struct {
- // Options remembers the original authentication parameters, if reauthentication is enabled.
- Options AuthOptions
+ // IdentityEndpoint is the front door to an openstack provider.
+ // Generally this will be populated when you authenticate.
+ // It should be the *root* resource of the identity service, not of a specific identity version.
+ IdentityEndpoint string
+
+ // Reauthenticate is a callback that will be invoked to reauthenticate this client, if reauthentication is enabled.
+ Reauthenticate func() error
// TokenID is the most recently valid token issued.
TokenID string
}
-// AuthenticatedHeaders returns a map of HTTP headers that are common for all authenticated service
-// requests.
+// AuthenticatedHeaders returns a map of HTTP headers that are common for all authenticated service requests.
func (client *ProviderClient) AuthenticatedHeaders() map[string]string {
return map[string]string{"X-Auth-Token": client.TokenID}
}
diff --git a/service_client.go b/service_client.go
index 2dccde1..cca5a74 100644
--- a/service_client.go
+++ b/service_client.go
@@ -5,14 +5,15 @@
// ServiceClient stores details required to interact with a specific service API implemented by a provider.
// Generally, you'll acquire these by calling the appropriate `New` method on a ProviderClient.
type ServiceClient struct {
- // ProviderClient is a reference to the provider that implements this service.
- ProviderClient
+ // Provider is a reference to the provider that implements this service.
+ Provider *ProviderClient
// Endpoint is the base URL of the service's API, acquired from a service catalog.
+ // It should NOT end with a /.
Endpoint string
}
// ServiceURL constructs a URL for a resource belonging to this provider.
func (client *ServiceClient) ServiceURL(parts ...string) string {
- return client.Endpoint + strings.Join(parts, "/")
+ return client.Endpoint + "/" + strings.Join(parts, "/")
}