fix auth v2 unit tests
diff --git a/openstack/identity/v2/tokens/requests.go b/openstack/identity/v2/tokens/requests.go
index 73e0b91..1c4ba7c 100644
--- a/openstack/identity/v2/tokens/requests.go
+++ b/openstack/identity/v2/tokens/requests.go
@@ -35,10 +35,16 @@
ToTokenV2CreateMap() (map[string]interface{}, error)
}
-// AuthOptions wraps a gophercloud AuthOptions in order to adhere to the AuthOptionsBuilder
-// interface.
+// AuthOptions are the valid options for Openstack Identity v2 authentication.
+// For field descriptions, see gophercloud.AuthOptions.
type AuthOptions struct {
- gophercloud.AuthOptions
+ IdentityEndpoint string `json:"-"`
+ Username string `json:"username,omitempty"`
+ Password string `json:"password,omitempty"`
+ TenantID string `json:"tenantId,omitempty"`
+ TenantName string `json:"tenantName,omitempty"`
+ AllowReauth bool `json:"-"`
+ TokenID string
}
// ToTokenV2CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder
diff --git a/openstack/identity/v2/tokens/requests_test.go b/openstack/identity/v2/tokens/requests_test.go
index 0cbb00c..a6d16f3 100644
--- a/openstack/identity/v2/tokens/requests_test.go
+++ b/openstack/identity/v2/tokens/requests_test.go
@@ -13,7 +13,7 @@
defer th.TeardownHTTP()
HandleTokenPost(t, requestJSON)
- return Create(client.ServiceClient(), AuthOptions{options})
+ return Create(client.ServiceClient(), options)
}
func tokenPostErr(t *testing.T, options gophercloud.AuthOptions, expectedErr error) {
@@ -21,7 +21,7 @@
defer th.TeardownHTTP()
HandleTokenPost(t, "")
- actualErr := Create(client.ServiceClient(), AuthOptions{options}).Err
+ actualErr := Create(client.ServiceClient(), options).Err
th.CheckDeepEquals(t, expectedErr, actualErr)
}