blob: 8d6834eb7609b7615a151498f36c15cbdcec4643 [file] [log] [blame]
Jon Perrittdb0ae142016-03-13 00:33:41 -06001package gophercloud
2
3type PasswordCredentialsV2 struct {
4 Username string `json:"username" required:"true"`
5 Password string `json:"password" required:"true"`
6}
7
8type TokenCredentialsV2 struct {
9 ID string `json:"id,omitempty" required:"true"`
10}
11
Jon Perritt2be387a2016-03-31 09:31:58 -050012// AuthOptionsV2 wraps a gophercloud AuthOptions in order to adhere to the AuthOptionsBuilder
Jon Perrittdb0ae142016-03-13 00:33:41 -060013// interface.
14type AuthOptionsV2 struct {
15 PasswordCredentials *PasswordCredentialsV2 `json:"passwordCredentials,omitempty" xor:"TokenCredentials"`
16
17 // The TenantID and TenantName fields are optional for the Identity V2 API.
18 // Some providers allow you to specify a TenantName instead of the TenantId.
19 // Some require both. Your provider's authentication policies will determine
20 // how these fields influence authentication.
21 TenantID string `json:"tenantId,omitempty"`
22 TenantName string `json:"tenantName,omitempty"`
23
24 // TokenCredentials allows users to authenticate (possibly as another user) with an
25 // authentication token ID.
26 TokenCredentials *TokenCredentialsV2 `json:"token,omitempty" xor:"PasswordCredentials"`
27}