fix: relax parsing of SCIM user 'active' flag to improve compatibility (#9296)

# Which Problems Are Solved
- Microsoft Entra invokes the user patch endpoint with `"active":
"True"` / `"active": "False"` when patching a user. This is a well-known
bug in MS Entra (see
[here](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/application-provisioning-config-problem-scim-compatibility)),
but the bug fix has not landed yet and/or the feature flag does not
work.

# How the Problems Are Solved
- To ensure compatibility with MS Entra, the parsing of the the boolean
active flag of the scim user is relaxed and accepts strings in any
casing that resolve to `true` or `false` as well as raw boolean values.

# Additional Context
Part of https://github.com/zitadel/zitadel/issues/8140
This commit is contained in:
Lars
2025-02-05 16:17:20 +01:00
committed by GitHub
parent 857812bb9e
commit 361f7a2edc
12 changed files with 125 additions and 19 deletions

View File

@@ -10,7 +10,6 @@ import (
"testing"
"time"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/text/language"
@@ -167,7 +166,7 @@ func TestReplaceUser(t *testing.T) {
PreferredLanguage: language.MustParse("en-CH"),
Locale: "en-CH",
Timezone: "Europe/Zurich",
Active: gu.Ptr(false),
Active: schemas.NewRelaxedBool(false),
},
},
{