From 784256a8237c568ce9505f392cf8c9e4932aa95c Mon Sep 17 00:00:00 2001 From: Fangzhou Xu Date: Thu, 1 Sep 2016 17:15:05 -0700 Subject: [PATCH] fix AccessToken struct -> User json Unmarshal Change-Id: I4e07da36a46285c68c94ee2857a9e8f85b161e92 --- identity/middleware/validation_test.go | 3 ++- openstack/auth-token.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/identity/middleware/validation_test.go b/identity/middleware/validation_test.go index 5815173..50e7fc8 100644 --- a/identity/middleware/validation_test.go +++ b/identity/middleware/validation_test.go @@ -42,7 +42,8 @@ func TestVerifyLocalPKIZ(t *testing.T) { if err != nil { t.Fatal(err) } - fmt.Println(access) + user := access.Access.User.(map[string]interface{}) + fmt.Println(user["roles"]) project := access.Access.Token.Project if project.Name != "demo" { t.Fail() diff --git a/openstack/auth-token.go b/openstack/auth-token.go index d7bffbf..3852877 100644 --- a/openstack/auth-token.go +++ b/openstack/auth-token.go @@ -24,7 +24,7 @@ import ( type AccessType struct { Token Token `json:"token"` - User interface{} `json:"id"` + User interface{} `json:"user"` ServiceCatalog []ServiceCatalogEntry `json:"servicecatalog"` }