Skip to content

providers/rac: fix incorrect caching#15779

Merged
BeryJu merged 1 commit intomainfrom
providers/rac/fix-incorrect-cache
Jul 25, 2025
Merged

providers/rac: fix incorrect caching#15779
BeryJu merged 1 commit intomainfrom
providers/rac/fix-incorrect-cache

Conversation

@BeryJu
Copy link
Member

@BeryJu BeryJu commented Jul 24, 2025

Details

We didnt take the provider into consideration for caching


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 docs)

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

netlify bot commented Jul 24, 2025

Deploy Preview for authentik-integrations canceled.

Name Link
🔨 Latest commit ad8b4a1
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/688265338828bf0008aab608

@netlify
Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit ad8b4a1
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/68826533836ed400087975b0

@netlify
Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit ad8b4a1
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/68826533836ed400087975b4
😎 Deploy Preview https://deploy-preview-15779--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 project configuration.

@codecov
Copy link

codecov bot commented Jul 24, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2024 1 2023 2
View the top 1 failed test(s) by shortest run time
tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2::test_oauth_link
Stack Traces | 14.2s run time
self = <unittest.case._Outcome object at 0x7f7d6fef3a70>
test_case = <tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.13.5.............../x64/lib/python3.13/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>
result = <TestCaseFunction test_oauth_link>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
                    self._callSetUp()
                if outcome.success:
                    outcome.expecting_failure = expecting_failure
                    with outcome.testPartExecutor(self):
>                       self._callTestMethod(testMethod)

.../hostedtoolcache/Python/3.13.5.............../x64/lib/python3.13/unittest/case.py:651: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>
method = <bound method TestSourceOAuth2.test_oauth_link of <tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>>

    def _callTestMethod(self, method):
>       if method() is not None:

.../hostedtoolcache/Python/3.13.5.............../x64/lib/python3.13/unittest/case.py:606: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>
args = (), kwargs = {}

    @wraps(func)
    def wrapper(self: TransactionTestCase, *args, **kwargs):
        """Run test again if we're below max_retries, including tearDown and
        setUp. Otherwise raise the error"""
        nonlocal count
        try:
>           return func(self, *args, **kwargs)

tests/e2e/utils.py:323: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>,)
kwargs = {}, file = 'default/flow-default-invalidation-flow.yaml'
content = 'version: 1\nmetadata:\n  name: Default - Invalidation flow\nentries:\n- attrs:\n    designation: invalidation\n    na...0\n    stage: !KeyOf default-invalidation-logout\n    target: !KeyOf flow\n  model: authentik_flows.flowstagebinding\n'

    @wraps(func)
    def wrapper(*args, **kwargs):
        for file in files:
            content = BlueprintInstance(path=file).retrieve()
            Importer.from_string(content).apply()
>       return func(*args, **kwargs)

.../blueprints/tests/__init__.py:25: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>,)
kwargs = {}, file = 'default/flow-default-source-pre-authentication.yaml'
content = 'version: 1\nmetadata:\n  name: Default - Source pre-authentication flow\nentries:\n- attrs:\n    designation: stage_c...    authentication: none\n  identifiers:\n    slug: default-source-pre-authentication\n  model: authentik_flows.flow\n'

    @wraps(func)
    def wrapper(*args, **kwargs):
        for file in files:
            content = BlueprintInstance(path=file).retrieve()
            Importer.from_string(content).apply()
>       return func(*args, **kwargs)

.../blueprints/tests/__init__.py:25: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>

    @retry()
    @apply_blueprint(
        "default/flow-default-authentication-flow.yaml",
        "default/flow-default-invalidation-flow.yaml",
    )
    @apply_blueprint(
        "default/flow-default-source-authentication.yaml",
        "default/flow-default-source-enrollment.yaml",
        "default/flow-default-source-pre-authentication.yaml",
    )
    def test_oauth_link(self):
        """test OAuth Source link OIDC"""
        self.create_objects()
        self.driver.get(self.live_server_url)
        self.login()
    
        self.driver.get(
            self.url("authentik_sources_oauth:oauth-client-login", source_slug=self.slug)
        )
    
        # Now we should be at the IDP, wait for the login field
        self.wait.until(ec.presence_of_element_located((By.ID, "login")))
        self.driver.find_element(By.ID, "login").send_keys("admin@example.com")
        self.driver.find_element(By.ID, "password").send_keys("password")
        self.driver.find_element(By.ID, "password").send_keys(Keys.ENTER)
    
        # Wait until we're logged in
        self.wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "button[type=submit]")))
        self.driver.find_element(By.CSS_SELECTOR, "button[type=submit]").click()
    
        self.driver.get(self.url("authentik_api:usersourceconnection-list") + "?format=json")
        body_json = loads(self.driver.find_element(By.CSS_SELECTOR, "pre").text)
        results = body_json["results"]
>       self.assertEqual(len(results), 1)

tests/e2e/test_source_oauth_oauth2.py:193: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>
first = 0, second = 1, msg = None

    def assertEqual(self, first, second, msg=None):
        """Fail if the two objects are unequal as determined by the '=='
           operator.
        """
        assertion_func = self._getAssertEqualityFunc(first, second)
>       assertion_func(first, second, msg=msg)

.../hostedtoolcache/Python/3.13.5.............../x64/lib/python3.13/unittest/case.py:907: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_link>
first = 0, second = 1, msg = '0 != 1'

    def _baseAssertEqual(self, first, second, msg=None):
        """The default assertEqual implementation, not type specific."""
        if not first == second:
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            msg = self._formatMessage(msg, standardMsg)
>           raise self.failureException(msg)
E           AssertionError: 0 != 1

.../hostedtoolcache/Python/3.13.5.............../x64/lib/python3.13/unittest/case.py:900: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@BeryJu BeryJu merged commit ca75862 into main Jul 25, 2025
99 of 104 checks passed
@BeryJu BeryJu deleted the providers/rac/fix-incorrect-cache branch July 25, 2025 12:57
kensternberg-authentik added a commit that referenced this pull request Aug 6, 2025
* main: (91 commits)
  *: replace Celery with Dramatiq (#13492)
  website/docs: stages/mtls: Clean up stage configuration section (#15753)
  translate: Updates for file locale/en/LC_MESSAGES/django.po in es (#15818)
  website: bump the eslint group in /website with 2 updates (#15805)
  web: bump typedoc from 0.28.7 to 0.28.8 in /packages/esbuild-plugin-live-reload (#15809)
  core: bump axllent/mailpit from v1.27.1 to v1.27.2 in /tests/e2e (#15813)
  web: bump the rollup group across 1 directory with 4 updates (#15806)
  web: bump the eslint group across 3 directories with 2 updates (#15808)
  lifecycle/aws: bump cross-env from 7.0.3 to 10.0.0 in /lifecycle/aws (#15807)
  web: bump ts-pattern from 5.7.1 to 5.8.0 in /web (#15810)
  web: bump @sentry/browser from 9.41.0 to 9.42.0 in /web in the sentry group across 1 directory (#15811)
  web: Add support for placeholder in <ak-text-input> (#15795)
  providers/rac: fix incorrect caching (#15779)
  root: support for custom postgresql connection options (#15577)
  website: bump the build group in /website with 3 updates (#15784)
  web: bump @sentry/browser from 9.40.0 to 9.41.0 in /web in the sentry group across 1 directory (#15785)
  core: bump astral-sh/uv from 0.8.2 to 0.8.3 (#15786)
  lifecycle/aws: bump aws-cdk from 2.1021.0 to 2.1022.0 in /lifecycle/aws (#15787)
  core: bump twilio from 9.6.5 to 9.7.0 (#15788)
  revert: web: Font fixes (#15581) (#15789)
  ...
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