From 3cf4650924631a32a009e35a95c3efbf45d4eccb Mon Sep 17 00:00:00 2001 From: Jim Kalafut Date: Fri, 29 Mar 2019 16:36:33 -0700 Subject: [PATCH] Include oidc_scopes in role read --- path_role.go | 1 + path_role_test.go | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/path_role.go b/path_role.go index f687d360..3b76955e 100644 --- a/path_role.go +++ b/path_role.go @@ -245,6 +245,7 @@ func (b *jwtAuthBackend) pathRoleRead(ctx context.Context, req *logical.Request, "user_claim": role.UserClaim, "groups_claim": role.GroupsClaim, "allowed_redirect_uris": role.AllowedRedirectURIs, + "oidc_scopes": role.OIDCScopes, }, } diff --git a/path_role_test.go b/path_role_test.go index 1b231399..66f1042f 100644 --- a/path_role_test.go +++ b/path_role_test.go @@ -265,17 +265,19 @@ func TestPath_Read(t *testing.T) { b, storage := getBackend(t) data := map[string]interface{}{ - "role_type": "jwt", - "bound_subject": "testsub", - "bound_audiences": "vault", - "user_claim": "user", - "groups_claim": "groups", - "bound_cidrs": "127.0.0.1/8", - "policies": "test", - "period": "3s", - "ttl": "1s", - "num_uses": 12, - "max_ttl": "5s", + "role_type": "jwt", + "bound_subject": "testsub", + "bound_audiences": "vault", + "allowed_redirect_uris": []string{"http://127.0.0.1"}, + "oidc_scopes": []string{"email", "profile"}, + "user_claim": "user", + "groups_claim": "groups", + "bound_cidrs": "127.0.0.1/8", + "policies": "test", + "period": "3s", + "ttl": "1s", + "num_uses": 12, + "max_ttl": "5s", } expected := map[string]interface{}{ @@ -284,7 +286,8 @@ func TestPath_Read(t *testing.T) { "claim_mappings": map[string]string(nil), "bound_subject": "testsub", "bound_audiences": []string{"vault"}, - "allowed_redirect_uris": []string(nil), + "allowed_redirect_uris": []string{"http://127.0.0.1"}, + "oidc_scopes": []string{"email", "profile"}, "user_claim": "user", "groups_claim": "groups", "policies": []string{"test"},