Skip to content

Commit

Permalink
Include oidc_scopes in role read (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalafut authored Apr 1, 2019
1 parent 508c66a commit d8c98fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions path_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}

Expand Down
27 changes: 15 additions & 12 deletions path_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{
Expand All @@ -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"},
Expand Down

0 comments on commit d8c98fb

Please sign in to comment.