Skip to content

providers/scim: fix group membership check failing#13644

Merged
BeryJu merged 1 commit intomainfrom
providers/scim/fix-group-membership-error
Mar 24, 2025
Merged

providers/scim: fix group membership check failing#13644
BeryJu merged 1 commit intomainfrom
providers/scim/fix-group-membership-error

Conversation

@BeryJu
Copy link
Member

@BeryJu BeryJu commented Mar 24, 2025

closes #12917

Details

the actual stacktrace for this one was

Traceback (most recent call last):
  File "/ak-root/.venv/lib/python3.12/site-packages/celery/app/trace.py", line 453, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/.venv/lib/python3.12/site-packages/sentry_sdk/utils.py", line 1783, in runner
    return sentry_patched_function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/celery/__init__.py", line 415, in _inner
    reraise(*exc_info)
  File "/ak-root/.venv/lib/python3.12/site-packages/sentry_sdk/utils.py", line 1718, in reraise
    raise value
  File "/ak-root/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/celery/__init__.py", line 410, in _inner
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/ak-root/.venv/lib/python3.12/site-packages/celery/app/trace.py", line 736, in __protected_call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/.venv/lib/python3.12/site-packages/celery/app/autoretry.py", line 38, in run
    return task._orig_run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/providers/scim/tasks.py", line 14, in scim_sync_objects
    return sync_tasks.sync_objects(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/lib/sync/outgoing/tasks.py", line 138, in sync_objects
    client.write(obj)
  File "/authentik/lib/sync/outgoing/base.py", line 74, in write
    self.update(obj, connection)
  File "/authentik/providers/scim/clients/groups.py", line 118, in update
    return self._update_put(group, scim_group, connection)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/providers/scim/clients/groups.py", line 158, in _update_put
    return self.patch_compare_users(group)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/authentik/providers/scim/clients/groups.py", line 247, in patch_compare_users
    if len([x for x in current_group.members if x.value == user]) < 1:
                       ^^^^^^^^^^^^^^^^^^^^^
builtins.TypeError: 'NoneType' object is not iterable

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

closes #12917

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu requested a review from a team as a code owner March 24, 2025 02:25
@netlify
Copy link

netlify bot commented Mar 24, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 71512cc
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67e0c2afdd868e0007495805

@netlify
Copy link

netlify bot commented Mar 24, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit 71512cc
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67e0c2afa921660008ea3ff8

@codecov
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 92.75%. Comparing base (dc9b12f) to head (71512cc).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
authentik/providers/scim/clients/groups.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13644   +/-   ##
=======================================
  Coverage   92.75%   92.75%           
=======================================
  Files         794      794           
  Lines       40523    40524    +1     
=======================================
+ Hits        37588    37589    +1     
  Misses       2935     2935           
Flag Coverage Δ
e2e 47.95% <0.00%> (+<0.01%) ⬆️
integration 24.29% <0.00%> (-0.01%) ⬇️
unit 90.53% <0.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.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-71512cc4743297fbd034167d295c694ad68b18da
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-71512cc4743297fbd034167d295c694ad68b18da

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu BeryJu merged commit 7653a35 into main Mar 24, 2025
91 of 92 checks passed
@BeryJu BeryJu deleted the providers/scim/fix-group-membership-error branch March 24, 2025 02:51
@rissson
Copy link
Member

rissson commented Apr 8, 2025

/cherry-pick version-2025.2

gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Apr 8, 2025
closes #12917

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
rissson pushed a commit that referenced this pull request Apr 8, 2025
… (#13825)

Co-authored-by: Jens L. <jens@goauthentik.io>
fix group membership check failing (#13644)
closes #12917
kensternberg-authentik added a commit that referenced this pull request Apr 25, 2025
* main: (76 commits)
  admin: fix system API when using bearer token (#13651)
  website: bump the build group in /website with 6 updates (#13645)
  core: bump goauthentik.io/api/v3 from 3.2025022.5 to 3.2025022.6 (#13646)
  translate: Updates for file web/xliff/en.xlf in fr (#13653)
  translate: Updates for file locale/en/LC_MESSAGES/django.po in fr (#13652)
  website/integrations: add tandoor (#13560)
  core, web: update translations (#13642)
  providers/scim: fix group membership check failing (#13644)
  ci: add semgrep (#13643)
  flows: fix API not returning configured background (#13641)
  translate: Updates for file locale/en/LC_MESSAGES/django.po in zh_CN (#13631)
  translate: Updates for file locale/en/LC_MESSAGES/django.po in zh-Hans (#13633)
  translate: Updates for file web/xliff/en.xlf in zh_CN (#13632)
  translate: Updates for file web/xliff/en.xlf in zh-Hans (#13634)
  brands: fix migration 0008 by removing incorrect context manager usage (#13635)
  web: Fix prop. (#13630)
  core, web: update translations (#13628)
  web/admin: reworked sync status card (#13625)
  core: bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2 (#13626)
  translate: Updates for file web/xliff/en.xlf in zh-Hans (#13622)
  ...
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.

Vcenter authentik integration

2 participants