Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add query to fetch top level idp claim fields#15525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 10 commits intomainfromstevenmasley/user_link_claim_list
Nov 18, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedNov 14, 2024
edited
Loading

Supportscoder/internal#210

Adds an api endpoint to grab all available sync field options for IDP sync. This is for autocomplete on idp sync forms. This is required for organization admins to have some insight into the claim fields available when configuring group/role sync.

Given claims such as:

{"merged_claims":{"hd":"...","aud":"...","azp":"...","iss":"...","sub":"115135273038497292934","name":"Alice","email":"alice@example.com","at_hash":"...","given_name":"Alice","family_name":"Smith","groups":["developers","cyclists"      ],"roles":["coder-engineer"      ],"email_verified":true   }}

This query returns:["hd", "aud", "azp", "iss", "sub", "name", "email", "at_hash", "given_name", "family_name", "groups", "roles", "email_verified"]

@EmyrkEmyrk requested a review fromf0sselNovember 14, 2024 21:44
@EmyrkEmyrk marked this pull request as draftNovember 18, 2024 16:55
@Emyrk
Copy link
MemberAuthor

Emyrk commentedNov 18, 2024
edited
Loading

I am going to simplify this query by merging the claims in Go before sending here. It will be more accurate too, as merged claims do override userinfo if present in id_token

Done. Uses 1merged_claims field now instead.

f0ssel reacted with thumbs up emoji

@EmyrkEmyrkforce-pushed thestevenmasley/user_link_claim_list branch from664e734 to2dae39bCompareNovember 18, 2024 18:09
@EmyrkEmyrk marked this pull request as ready for reviewNovember 18, 2024 18:17
Comment on lines +62 to +68
-- name: OIDCClaimFields :many
-- OIDCClaimFields returns a list of distinct keys in the the merged_claims fields.
-- This query is used to generate the list of available sync fields for idp sync settings.
SELECT
DISTINCT jsonb_object_keys(claims->'merged_claims')
FROM
user_links
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

To confirm, this data comes from the claims we get from user links, so a new user log in with claims we haven't seen before it would add to this list and next time this endpoint is hit it would have new data?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Correct 👍

// @Param organization path string true "Organization ID" format(uuid)
// @Success 200 {array} string
// @Router /settings/idpsync/available-fields [get]
func (api *API) deploymentIDPSyncClaimFields(rw http.ResponseWriter, r *http.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why do we need a deployment level endpoint again?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Organization sync is configured by deployment level admins (user-admins and owner). They configure IDP sync based on all users in the deployment.

The RBAC permissions prevent org admins from hitting the deployment wide api.

@EmyrkEmyrk merged commitc3c23ed intomainNov 18, 2024
30 checks passed
@EmyrkEmyrk deleted the stevenmasley/user_link_claim_list branchNovember 18, 2024 20:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@f0sself0sself0ssel approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Emyrk@f0ssel

[8]ページ先頭

©2009-2025 Movatter.jp