mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore: add query to fetch top level idp claim fields (#15525)
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.
This commit is contained in:
@ -165,6 +165,19 @@ func TestUserOIDC(t *testing.T) {
|
||||
user, err := userClient.User(ctx, codersdk.Me)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Then: the available sync fields should be "email" and "organization"
|
||||
fields, err := runner.AdminClient.GetAvailableIDPSyncFields(ctx)
|
||||
require.NoError(t, err)
|
||||
require.ElementsMatch(t, []string{
|
||||
"aud", "exp", "iss", // Always included from jwt
|
||||
"email", "organization",
|
||||
}, fields)
|
||||
|
||||
// This should be the same as above
|
||||
orgFields, err := runner.AdminClient.GetOrganizationAvailableIDPSyncFields(ctx, orgOne.ID.String())
|
||||
require.NoError(t, err)
|
||||
require.ElementsMatch(t, fields, orgFields)
|
||||
|
||||
// When: they are manually added to the fourth organization, a new sync
|
||||
// should remove them.
|
||||
_, err = runner.AdminClient.PostOrganizationMember(ctx, orgThree.ID, "alice")
|
||||
|
Reference in New Issue
Block a user