blob: bc0ef65a91bce4943ba3d433a80a0ca607de2c4b [file] [log] [blame]
Ash Wilson70dfe0c2014-08-28 13:57:09 -04001package gophercloud
2
Jamie Hannafordb280dea2014-10-24 15:14:06 +02003// 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 Wilson70dfe0c2014-08-28 13:57:09 -04006type AuthOptions struct {
Jamie Hannafordb280dea2014-10-24 15:14:06 +02007 // 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 Wilson70dfe0c2014-08-28 13:57:09 -040010 IdentityEndpoint string
11
Jamie Hannafordb280dea2014-10-24 15:14:06 +020012 // 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 Wilson70dfe0c2014-08-28 13:57:09 -040015 Username, UserID string
16
Jamie Hannafordb280dea2014-10-24 15:14:06 +020017 // 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 Wilson70dfe0c2014-08-28 13:57:09 -040020 Password, APIKey string
21
Jamie Hannafordb280dea2014-10-24 15:14:06 +020022 // At most one of DomainID and DomainName must be provided if using Username
23 // with Identity V3. Otherwise, either are optional.
Ash Wilson70dfe0c2014-08-28 13:57:09 -040024 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}