Skip to content
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

sources/scim: fix user creation (duplicate userName) #12547

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

sia-mfierro
Copy link
Contributor

@sia-mfierro sia-mfierro commented Jan 3, 2025

Details

According to the SCIM standard both id and userName must be unique.
The current behaviour only rejects duplicate ids, and this PR fixes it.
A new test case has been added: test_user_create_duplicate_by_username, and run.
Results from https://scimvalidator.microsoft.com/ have been saved and replayed for local testing.


Checklist

  • Local tests pass (sudo poetry run python -m manage test authentik/sources/scim/tests/test_users.py)
  • The code has been formatted (make lint-fix)

@sia-mfierro sia-mfierro requested a review from a team as a code owner January 3, 2025 07:12
Copy link

netlify bot commented Jan 3, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 99fbf97
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67856d39d52c2b0008339a5e
😎 Deploy Preview https://deploy-preview-12547--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 3, 2025

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 99fbf97
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67856d39bd85960008c70611
😎 Deploy Preview https://deploy-preview-12547--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.78%. Comparing base (bdf4236) to head (99fbf97).
Report is 62 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12547      +/-   ##
==========================================
+ Coverage   92.69%   92.78%   +0.08%     
==========================================
  Files         770      769       -1     
  Lines       38873    38879       +6     
==========================================
+ Hits        36033    36073      +40     
+ Misses       2840     2806      -34     
Flag Coverage Δ
e2e 48.65% <7.69%> (+0.04%) ⬆️
integration 24.63% <0.00%> (+0.05%) ⬆️
unit 90.39% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Jens Langhammer <[email protected]>
@BeryJu BeryJu merged commit 5da0297 into goauthentik:main Jan 13, 2025
65 of 67 checks passed
mahmoudajawad pushed a commit to mahmoudajawad/authentik that referenced this pull request Jan 15, 2025
* sources/scim: fix user creation (duplicate userName)

* sources/scim: add test case (duplicate username)

* Formatting

* simplify query with Q

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants