fix: unified scim metadata key casing (#9244)

# Which Problems Are Solved
- SCIM user metadata mapping keys have differing case styles.

# How the Problems Are Solved
- key casing style is unified to strict camelCase

# Additional Context
Part of #8140

Although this is technically a breaking change, it is considered
acceptable because the SCIM feature is still in the preview stage and
not fully implemented yet.

Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
This commit is contained in:
Lars
2025-01-27 14:51:58 +01:00
committed by GitHub
parent 189f9770c6
commit 741434806a
5 changed files with 11 additions and 11 deletions

View File

@@ -354,7 +354,7 @@ func TestCreateUser_metadata(t *testing.T) {
test.AssertMapContains(tt, mdMap, "urn:zitadel:scim:externalId", "701984")
test.AssertMapContains(tt, mdMap, "urn:zitadel:scim:name.middleName", "Jane")
test.AssertMapContains(tt, mdMap, "urn:zitadel:scim:name.honorificSuffix", "III")
test.AssertMapContains(tt, mdMap, "urn:zitadel:scim:profileURL", "http://login.example.com/bjensen")
test.AssertMapContains(tt, mdMap, "urn:zitadel:scim:profileUrl", "http://login.example.com/bjensen")
test.AssertMapContains(tt, mdMap, "urn:zitadel:scim:title", "Tour Guide")
test.AssertMapContains(tt, mdMap, "urn:zitadel:scim:locale", "en-US")
test.AssertMapContains(tt, mdMap, "urn:zitadel:scim:ims", `[{"value":"someaimhandle","type":"aim"},{"value":"twitterhandle","type":"X"}]`)
@@ -365,7 +365,7 @@ func TestCreateUser_metadata(t *testing.T) {
func TestCreateUser_scopedExternalID(t *testing.T) {
_, err := Instance.Client.Mgmt.SetUserMetadata(CTX, &management.SetUserMetadataRequest{
Id: Instance.Users.Get(integration.UserTypeOrgOwner).ID,
Key: "urn:zitadel:scim:provisioning_domain",
Key: "urn:zitadel:scim:provisioningDomain",
Value: []byte("fooBar"),
})
require.NoError(t, err)
@@ -379,7 +379,7 @@ func TestCreateUser_scopedExternalID(t *testing.T) {
_, err = Instance.Client.Mgmt.RemoveUserMetadata(CTX, &management.RemoveUserMetadataRequest{
Id: Instance.Users.Get(integration.UserTypeOrgOwner).ID,
Key: "urn:zitadel:scim:provisioning_domain",
Key: "urn:zitadel:scim:provisioningDomain",
})
require.NoError(t, err)
}()

View File

@@ -193,7 +193,7 @@ func TestGetUser(t *testing.T) {
// set provisioning domain of service user
_, err = Instance.Client.Mgmt.SetUserMetadata(CTX, &management.SetUserMetadataRequest{
Id: Instance.Users.Get(integration.UserTypeOrgOwner).ID,
Key: "urn:zitadel:scim:provisioning_domain",
Key: "urn:zitadel:scim:provisioningDomain",
Value: []byte("fooBar"),
})
require.NoError(t, err)
@@ -213,7 +213,7 @@ func TestGetUser(t *testing.T) {
_, err = Instance.Client.Mgmt.RemoveUserMetadata(CTX, &management.RemoveUserMetadataRequest{
Id: Instance.Users.Get(integration.UserTypeOrgOwner).ID,
Key: "urn:zitadel:scim:provisioning_domain",
Key: "urn:zitadel:scim:provisioningDomain",
})
require.NoError(t, err)
},

View File

@@ -365,7 +365,7 @@ func TestListUser(t *testing.T) {
// set provisioning domain of service user
_, err := Instance.Client.Mgmt.SetUserMetadata(CTX, &management.SetUserMetadataRequest{
Id: Instance.Users.Get(integration.UserTypeOrgOwner).ID,
Key: "urn:zitadel:scim:provisioning_domain",
Key: "urn:zitadel:scim:provisioningDomain",
Value: []byte("fooBar"),
})
require.NoError(t, err)
@@ -389,7 +389,7 @@ func TestListUser(t *testing.T) {
// delete provisioning domain of service user
_, err := Instance.Client.Mgmt.RemoveUserMetadata(CTX, &management.RemoveUserMetadataRequest{
Id: Instance.Users.Get(integration.UserTypeOrgOwner).ID,
Key: "urn:zitadel:scim:provisioning_domain",
Key: "urn:zitadel:scim:provisioningDomain",
})
require.NoError(t, err)
},

View File

@@ -296,7 +296,7 @@ func TestReplaceUser_scopedExternalID(t *testing.T) {
// set provisioning domain of service user
_, err = Instance.Client.Mgmt.SetUserMetadata(CTX, &management.SetUserMetadataRequest{
Id: Instance.Users.Get(integration.UserTypeOrgOwner).ID,
Key: "urn:zitadel:scim:provisioning_domain",
Key: "urn:zitadel:scim:provisioningDomain",
Value: []byte("fooBazz"),
})
require.NoError(t, err)
@@ -327,7 +327,7 @@ func TestReplaceUser_scopedExternalID(t *testing.T) {
_, err = Instance.Client.Mgmt.RemoveUserMetadata(CTX, &management.RemoveUserMetadataRequest{
Id: Instance.Users.Get(integration.UserTypeOrgOwner).ID,
Key: "urn:zitadel:scim:provisioning_domain",
Key: "urn:zitadel:scim:provisioningDomain",
})
require.NoError(t, err)
}

View File

@@ -14,14 +14,14 @@ const (
externalIdProvisioningDomainPlaceholder = "{provisioningDomain}"
KeyPrefix = "urn:zitadel:scim:"
KeyProvisioningDomain Key = KeyPrefix + "provisioning_domain"
KeyProvisioningDomain Key = KeyPrefix + "provisioningDomain"
KeyExternalId Key = KeyPrefix + "externalId"
keyScopedExternalIdTemplate = KeyPrefix + externalIdProvisioningDomainPlaceholder + ":externalId"
KeyMiddleName Key = KeyPrefix + "name.middleName"
KeyHonorificPrefix Key = KeyPrefix + "name.honorificPrefix"
KeyHonorificSuffix Key = KeyPrefix + "name.honorificSuffix"
KeyProfileUrl Key = KeyPrefix + "profileURL"
KeyProfileUrl Key = KeyPrefix + "profileUrl"
KeyTitle Key = KeyPrefix + "title"
KeyLocale Key = KeyPrefix + "locale"
KeyTimezone Key = KeyPrefix + "timezone"