-
-
Notifications
You must be signed in to change notification settings - Fork 959
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sso provider id to list of groups (PS-236)
- Loading branch information
Showing
4 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
local claims = std.extVar('claims'); | ||
local provider = std.extVar('provider'); | ||
local identity = std.extVar('identity'); | ||
local metadata_public = if 'metadata_public' in identity then identity.metadata_public else {}; | ||
local mp = if 'metadata_public' in identity then identity.metadata_public else {}; | ||
|
||
if std.length(claims.sub) == 0 then | ||
error 'claim sub not set' | ||
else | ||
{ | ||
identity: { | ||
metadata_public: metadata_public + { [if "groups" in claims.raw_claims then "groups" else null]: claims.raw_claims.groups }, | ||
metadata_public: mp { | ||
sso_groups+: { | ||
[if 'groups' in claims.raw_claims then provider]: claims.raw_claims.groups, | ||
}, | ||
}, | ||
}, | ||
} |