4
goosehttp "gopkg.in/goose.v1/http"
7
type passwordCredentials struct {
8
Username string `json:"username"`
9
Password string `json:"password"`
12
type authRequest struct {
13
PasswordCredentials passwordCredentials `json:"passwordCredentials"`
14
TenantName string `json:"tenantName"`
17
type authWrapper struct {
18
Auth authRequest `json:"auth"`
21
type UserPass struct {
22
client *goosehttp.Client
25
func (u *UserPass) Auth(creds *Credentials) (*AuthDetails, error) {
27
u.client = goosehttp.New()
29
auth := authWrapper{Auth: authRequest{
30
PasswordCredentials: passwordCredentials{
32
Password: creds.Secrets,
34
TenantName: creds.TenantName}}
36
return keystoneAuth(u.client, auth, creds.URL)