Ash Wilson | 85d8265 | 2014-08-28 13:57:46 -0400 | [diff] [blame] | 1 | package v3 |
| 2 | |
Ash Wilson | 8a85a91 | 2014-08-28 15:09:58 -0400 | [diff] [blame] | 3 | import ( |
Ash Wilson | 6425a41 | 2014-08-29 12:30:35 -0400 | [diff] [blame^] | 4 | "time" |
| 5 | |
Ash Wilson | 8a85a91 | 2014-08-28 15:09:58 -0400 | [diff] [blame] | 6 | "github.com/rackspace/gophercloud" |
Ash Wilson | 8a85a91 | 2014-08-28 15:09:58 -0400 | [diff] [blame] | 7 | ) |
Ash Wilson | 85d8265 | 2014-08-28 13:57:46 -0400 | [diff] [blame] | 8 | |
Ash Wilson | 6425a41 | 2014-08-29 12:30:35 -0400 | [diff] [blame^] | 9 | // Client abstracts the connection information necessary to make API calls to Identity v3 resources. |
| 10 | // It exists mainly to adhere to the IdentityService interface. |
Ash Wilson | 8a85a91 | 2014-08-28 15:09:58 -0400 | [diff] [blame] | 11 | type Client gophercloud.ServiceClient |
Ash Wilson | 85d8265 | 2014-08-28 13:57:46 -0400 | [diff] [blame] | 12 | |
Ash Wilson | 6425a41 | 2014-08-29 12:30:35 -0400 | [diff] [blame^] | 13 | // Token models a token acquired from the tokens/ API resource. |
| 14 | type Token struct { |
| 15 | ID string |
| 16 | ExpiresAt time.Time |
| 17 | } |
Ash Wilson | 85d8265 | 2014-08-28 13:57:46 -0400 | [diff] [blame] | 18 | |
Ash Wilson | 6425a41 | 2014-08-29 12:30:35 -0400 | [diff] [blame^] | 19 | // NewClient creates a new client associated with the v3 identity service of a provider. |
| 20 | func NewClient(provider *gophercloud.ProviderClient) *Client { |
| 21 | return &Client{ |
| 22 | ProviderClient: *provider, |
| 23 | Endpoint: provider.IdentityEndpoint + "v3/", |
Ash Wilson | 8a85a91 | 2014-08-28 15:09:58 -0400 | [diff] [blame] | 24 | } |
Ash Wilson | 6425a41 | 2014-08-29 12:30:35 -0400 | [diff] [blame^] | 25 | } |
Ash Wilson | 8a85a91 | 2014-08-28 15:09:58 -0400 | [diff] [blame] | 26 | |
Ash Wilson | 6425a41 | 2014-08-29 12:30:35 -0400 | [diff] [blame^] | 27 | // Authenticate provides the supplied credentials to an identity v3 endpoint and attempts to acquire a token. |
| 28 | func (c *Client) Authenticate(authOptions gophercloud.AuthOptions) (*Token, error) { |
| 29 | return nil, nil |
Ash Wilson | 85d8265 | 2014-08-28 13:57:46 -0400 | [diff] [blame] | 30 | } |