Skip to content

PatchOp model is too permissive #93

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Meow-Knight opened this issue May 27, 2025 · 2 comments
Open

PatchOp model is too permissive #93

Meow-Knight opened this issue May 27, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@Meow-Knight
Copy link

🚀 Description

The PatchOp model currently allows inputs that do not conform strictly to the SCIM specification. This can lead to unexpected behavior or unvalidated data being processed.

⚙️ Current Behavior

Input:
>>> patch_instance = PatchOp.model_validate(dict(schemas=["abcd1234", "1234abcd"]))
>>> patch_instance.schemas
Output:
['abcd1234', '1234abcd']

⚠️ Issues

  • The schemas field accepts any list of strings and doesn't enforce the exact expected value.
  • The operations field is optional and allows None or an empty list, which should not be valid.

🚩 Expected Behavior

  • schemas should strictly equal ["urn:ietf:params:scim:api:messages:2.0:PatchOp"].
  • operations should be a required field and must contain at least one PatchOperation item.
@Meow-Knight
Copy link
Author

Hi @azmeuk, could you take a look at this issue? I’d be happy to open a PR to fix it, if that's okay with you

@azmeuk azmeuk added the enhancement New feature or request label May 27, 2025
@azmeuk
Copy link
Contributor

azmeuk commented May 27, 2025

Hi. Thank you for your report.
Actually PatchOp has not really been implemented, currently it is more like a stub class.
Feel free to open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants