Ash Wilson | 70dfe0c | 2014-08-28 13:57:09 -0400 | [diff] [blame] | 1 | package gophercloud |
| 2 | |
Jamie Hannaford | b280dea | 2014-10-24 15:14:06 +0200 | [diff] [blame] | 3 | // AuthOptions allows anyone calling Authenticate to supply the required access |
| 4 | // credentials. Its fields are the union of those recognized by each identity |
| 5 | // implementation and provider. |
Ash Wilson | 70dfe0c | 2014-08-28 13:57:09 -0400 | [diff] [blame] | 6 | type AuthOptions struct { |
Jamie Hannaford | b280dea | 2014-10-24 15:14:06 +0200 | [diff] [blame] | 7 | // IdentityEndpoint specifies the HTTP endpoint that is required to work with |
| 8 | // the Identity API of the appropriate version. Required by the identity |
| 9 | // services, but often populated by a provider Client. |
Ash Wilson | 70dfe0c | 2014-08-28 13:57:09 -0400 | [diff] [blame] | 10 | IdentityEndpoint string |
| 11 | |
Jamie Hannaford | b280dea | 2014-10-24 15:14:06 +0200 | [diff] [blame] | 12 | // Username is required if using Identity V2 API. Consult with your provider's |
| 13 | // control panel to discover your account's username. In Identity V3, either |
| 14 | // UserID or a combination of Username and DomainID or DomainName. |
Ash Wilson | 70dfe0c | 2014-08-28 13:57:09 -0400 | [diff] [blame] | 15 | Username, UserID string |
| 16 | |
Jamie Hannaford | b280dea | 2014-10-24 15:14:06 +0200 | [diff] [blame] | 17 | // Exactly one of Password or ApiKey is required for the Identity V2 and V3 |
| 18 | // APIs. Consult with your provider's control panel to discover your account's |
| 19 | // preferred method of authentication. |
Ash Wilson | 70dfe0c | 2014-08-28 13:57:09 -0400 | [diff] [blame] | 20 | Password, APIKey string |
| 21 | |
Jamie Hannaford | b280dea | 2014-10-24 15:14:06 +0200 | [diff] [blame] | 22 | // At most one of DomainID and DomainName must be provided if using Username |
| 23 | // with Identity V3. Otherwise, either are optional. |
Ash Wilson | 70dfe0c | 2014-08-28 13:57:09 -0400 | [diff] [blame] | 24 | DomainID, DomainName string |
| 25 | |
| 26 | // The TenantID and TenantName fields are optional for the Identity V2 API. |
| 27 | // Some providers allow you to specify a TenantName instead of the TenantId. |
| 28 | // Some require both. Your provider's authentication policies will determine |
| 29 | // how these fields influence authentication. |
| 30 | TenantID, TenantName string |
| 31 | |
| 32 | // AllowReauth should be set to true if you grant permission for Gophercloud to |
| 33 | // cache your credentials in memory, and to allow Gophercloud to attempt to |
| 34 | // re-authenticate automatically if/when your token expires. If you set it to |
| 35 | // false, it will not cache these settings, but re-authentication will not be |
| 36 | // possible. This setting defaults to false. |
| 37 | AllowReauth bool |
| 38 | } |