blob: 19ce5d4a99d654c86768021806e4c6fa1e68f685 [file] [log] [blame]
Ash Wilson70dfe0c2014-08-28 13:57:09 -04001package gophercloud
2
Ash Wilson730a5062014-10-31 15:13:35 -04003/*
4AuthOptions stores information needed to authenticate to an OpenStack cluster.
5You can populate one manually, or use a provider's AuthOptionsFromEnv() function
6to read relevant information from the standard environment variables. Pass one
7to a provider's AuthenticatedClient function to authenticate and obtain a
8ProviderClient representing an active session on that provider.
9
10Its fields are the union of those recognized by each identity implementation and
11provider.
12*/
Ash Wilson70dfe0c2014-08-28 13:57:09 -040013type AuthOptions struct {
Jamie Hannafordb280dea2014-10-24 15:14:06 +020014 // IdentityEndpoint specifies the HTTP endpoint that is required to work with
Ash Wilson730a5062014-10-31 15:13:35 -040015 // the Identity API of the appropriate version. While it's ultimately needed by
16 // all of the identity services, it will often be populated by a provider-level
17 // function.
Ash Wilson70dfe0c2014-08-28 13:57:09 -040018 IdentityEndpoint string
19
Jamie Hannafordb280dea2014-10-24 15:14:06 +020020 // Username is required if using Identity V2 API. Consult with your provider's
21 // control panel to discover your account's username. In Identity V3, either
Ash Wilson730a5062014-10-31 15:13:35 -040022 // UserID or a combination of Username and DomainID or DomainName are needed.
Ash Wilson70dfe0c2014-08-28 13:57:09 -040023 Username, UserID string
24
Ash Wilson730a5062014-10-31 15:13:35 -040025 // Exactly one of Password or APIKey is required for the Identity V2 and V3
Jamie Hannafordb280dea2014-10-24 15:14:06 +020026 // APIs. Consult with your provider's control panel to discover your account's
27 // preferred method of authentication.
Ash Wilson70dfe0c2014-08-28 13:57:09 -040028 Password, APIKey string
29
Jamie Hannafordb280dea2014-10-24 15:14:06 +020030 // At most one of DomainID and DomainName must be provided if using Username
31 // with Identity V3. Otherwise, either are optional.
Ash Wilson70dfe0c2014-08-28 13:57:09 -040032 DomainID, DomainName string
33
34 // The TenantID and TenantName fields are optional for the Identity V2 API.
35 // Some providers allow you to specify a TenantName instead of the TenantId.
Ash Wilson730a5062014-10-31 15:13:35 -040036 // Some require both. Your provider's authentication policies will determine
Ash Wilson70dfe0c2014-08-28 13:57:09 -040037 // how these fields influence authentication.
38 TenantID, TenantName string
39
40 // AllowReauth should be set to true if you grant permission for Gophercloud to
41 // cache your credentials in memory, and to allow Gophercloud to attempt to
42 // re-authenticate automatically if/when your token expires. If you set it to
43 // false, it will not cache these settings, but re-authentication will not be
44 // possible. This setting defaults to false.
Ash Wilson730a5062014-10-31 15:13:35 -040045 //
46 // This setting is speculative and is currently not respected!
Ash Wilson70dfe0c2014-08-28 13:57:09 -040047 AllowReauth bool
48}