Skip to content

Instantly share code, notes, and snippets.

@dmnkgrc
Last active October 2, 2020 15:12
Show Gist options
  • Select an option

  • Save dmnkgrc/136d10a8261dc953abab01751cf6581a to your computer and use it in GitHub Desktop.

Select an option

Save dmnkgrc/136d10a8261dc953abab01751cf6581a to your computer and use it in GitHub Desktop.
local claims = {
email_verified: true
} + std.extVar('claims');
local groups = std.extVar('groups');
{
identity: {
traits: {
[if "email" in claims then "email" else null]: claims.email,
[if "name" in claims then "name" else null]: claims.name,
[if "groups" in claims then "groups" else null]: claims.groups,
"groups": groups
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment