mirror of
https://github.com/zitadel/zitadel.git
synced 2025-02-28 20:17:23 +00:00
fix: scim 2.0 patch ignore op casing (#9282)
# Which Problems Are Solved - Some SCIM clients send "op" of a patch operation in PascalCase # How the Problems Are Solved - Well known "op" values of patch operations are matched case-insensitive. # Additional Context Related to #8140
This commit is contained in:
parent
563f74640e
commit
20cff9c70a
@ -3,7 +3,7 @@
|
|||||||
"Operations": [
|
"Operations": [
|
||||||
// add without path
|
// add without path
|
||||||
{
|
{
|
||||||
"op": "add",
|
"op": "Add", // with PascalCase operation type
|
||||||
"value": {
|
"value": {
|
||||||
"emails":[
|
"emails":[
|
||||||
{
|
{
|
||||||
@ -17,7 +17,7 @@
|
|||||||
},
|
},
|
||||||
// add complex attribute with path
|
// add complex attribute with path
|
||||||
{
|
{
|
||||||
"op": "add",
|
"op": "add", // with camelCase operation type
|
||||||
"path": "name",
|
"path": "name",
|
||||||
"value": {
|
"value": {
|
||||||
"formatted": "added-formatted",
|
"formatted": "added-formatted",
|
||||||
@ -30,7 +30,7 @@
|
|||||||
},
|
},
|
||||||
// add complex attribute value
|
// add complex attribute value
|
||||||
{
|
{
|
||||||
"op": "add",
|
"op": "ADD", // with UPPERCASE operation type
|
||||||
"path": "name.middlename",
|
"path": "name.middlename",
|
||||||
"value": "added-middle-name-2"
|
"value": "added-middle-name-2"
|
||||||
},
|
},
|
||||||
|
@ -60,6 +60,9 @@ func (req *OperationRequest) Validate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (op *Operation) validate() error {
|
func (op *Operation) validate() error {
|
||||||
|
// ignore the casing, as some scim clients send these capitalized
|
||||||
|
op.Operation = OperationType(strings.ToLower(string(op.Operation)))
|
||||||
|
|
||||||
if !op.Operation.isValid() {
|
if !op.Operation.isValid() {
|
||||||
return serrors.ThrowInvalidValue(zerrors.ThrowInvalidArgumentf(nil, "SCIM-opty1", "Patch op %s not supported", op.Operation))
|
return serrors.ThrowInvalidValue(zerrors.ThrowInvalidArgumentf(nil, "SCIM-opty1", "Patch op %s not supported", op.Operation))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user