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

root: RBAC permission cleanup #12707

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

root: RBAC permission cleanup #12707

wants to merge 4 commits into from

Conversation

BeryJu
Copy link
Member

@BeryJu BeryJu commented Jan 16, 2025

Details

Remove more leftovers where we explicitly check for superuser status instead of RBAC permissions


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)

@BeryJu BeryJu requested review from a team as code owners January 16, 2025 14:08
Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 0633728
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67892add12dd5c0008008e5e

Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit 0633728
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67892add4f4d16000948c5f4

Copy link

codecov bot commented Jan 16, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
1652 2 1650 2
View the top 2 failed tests by shortest run time
authentik.core.tests.test_applications_api.TestApplicationsAPI::test_list_superuser_full_list
Stack Traces | 1.44s run time
self = <unittest.case._Outcome object at 0x7f7ef49b6cf0>
test_case = <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>
subTest = False

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

.../hostedtoolcache/Python/3.12.8................../x64/lib/python3.12/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>
result = <TestCaseFunction test_list_superuser_full_list>

    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.12.8................../x64/lib/python3.12/unittest/case.py:634: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>
method = <bound method TestApplicationsAPI.test_list_superuser_full_list of <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>>

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

.../hostedtoolcache/Python/3.12.8................../x64/lib/python3.12/unittest/case.py:589: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>

    def test_list_superuser_full_list(self):
        """Test list operation with superuser_full_list"""
        self.client.force_login(self.user)
        response = self.client.get(
            reverse("authentik_api:application-list") + "?superuser_full_list=true"
        )
>       self.assertJSONEqual(
            response.content.decode(),
            {
                "pagination": {
                    "next": 0,
                    "previous": 0,
                    "count": 2,
                    "current": 1,
                    "total_pages": 1,
                    "start_index": 1,
                    "end_index": 2,
                },
                "results": [
                    {
                        "pk": str(self.allowed.pk),
                        "name": "allowed",
                        "slug": "allowed",
                        "group": "",
                        "provider": self.provider.pk,
                        "provider_obj": {
                            "assigned_application_name": "allowed",
                            "assigned_application_slug": "allowed",
                            "authentication_flow": None,
                            "invalidation_flow": None,
                            "authorization_flow": str(self.provider.authorization_flow.pk),
                            "component": "ak-provider-oauth2-form",
                            "meta_model_name": "authentik_providers_oauth2.oauth2provider",
                            "name": self.provider.name,
                            "pk": self.provider.pk,
                            "property_mappings": [],
                            "verbose_name": "OAuth2/OpenID Provider",
                            "verbose_name_plural": "OAuth2/OpenID Providers",
                        },
                        "backchannel_providers": [],
                        "backchannel_providers_obj": [],
                        "launch_url": f"https://goauthentik.io/{self.user.username}",
                        "meta_launch_url": "https://goauthentik.io/%(username)s",
                        "open_in_new_tab": True,
                        "meta_icon": None,
                        "meta_description": "",
                        "meta_publisher": "",
                        "policy_engine_mode": "any",
                    },
                    {
                        "launch_url": None,
                        "meta_description": "",
                        "meta_icon": None,
                        "meta_launch_url": "",
                        "open_in_new_tab": False,
                        "meta_publisher": "",
                        "group": "",
                        "name": "denied",
                        "pk": str(self.denied.pk),
                        "policy_engine_mode": "any",
                        "provider": None,
                        "provider_obj": None,
                        "backchannel_providers": [],
                        "backchannel_providers_obj": [],
                        "slug": "denied",
                    },
                ],
            },
        )

.../core/tests/test_applications_api.py:167: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>
raw = '{"pagination":{"next":0,"previous":0,"count":2,"current":1,"total_pages":1,"start_index":1,"end_index":2},"results":[...k.io/%(username)s","meta_icon":null,"meta_description":"","meta_publisher":"","policy_engine_mode":"any","group":""}]}'
expected_data = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'backchannel_providers': [], '...puYgume6', ...}, {'backchannel_providers': [], 'backchannel_providers_obj': [], 'group': '', 'launch_url': None, ...}]}
msg = None

    def assertJSONEqual(self, raw, expected_data, msg=None):
        """
        Assert that the JSON fragments raw and expected_data are equal.
        Usual JSON non-significant whitespace rules apply as the heavyweight
        is delegated to the json library.
        """
        try:
            data = json.loads(raw)
        except json.JSONDecodeError:
            self.fail("First argument is not valid JSON: %r" % raw)
        if isinstance(expected_data, str):
            try:
                expected_data = json.loads(expected_data)
            except ValueError:
                self.fail("Second argument is not valid JSON: %r" % expected_data)
>       self.assertEqual(data, expected_data, msg=msg)

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../django/test/testcases.py:922: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>
first = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'backchannel_providers': [], 'backchannel_providers_obj': [], 'group': '', 'launch_url': 'https://goauthentik.io/yJ6ZYZrPYOIBpuYgume6', ...}]}
second = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'backchannel_providers': [], '...puYgume6', ...}, {'backchannel_providers': [], 'backchannel_providers_obj': [], 'group': '', 'launch_url': None, ...}]}
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.12.8................../x64/lib/python3.12/unittest/case.py:885: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>
d1 = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'backchannel_providers': [], 'backchannel_providers_obj': [], 'group': '', 'launch_url': 'https://goauthentik.io/yJ6ZYZrPYOIBpuYgume6', ...}]}
d2 = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'backchannel_providers': [], '...puYgume6', ...}, {'backchannel_providers': [], 'backchannel_providers_obj': [], 'group': '', 'launch_url': None, ...}]}
msg = None

    def assertDictEqual(self, d1, d2, msg=None):
        self.assertIsInstance(d1, dict, 'First argument is not a dictionary')
        self.assertIsInstance(d2, dict, 'Second argument is not a dictionary')
    
        if d1 != d2:
            standardMsg = '%s != %s' % _common_shorten_repr(d1, d2)
            diff = ('\n' + '\n'.join(difflib.ndiff(
                           pprint.pformat(d1).splitlines(),
                           pprint.pformat(d2).splitlines())))
            standardMsg = self._truncateMessage(standardMsg, diff)
>           self.fail(self._formatMessage(msg, standardMsg))

.../hostedtoolcache/Python/3.12.8................../x64/lib/python3.12/unittest/case.py:1184: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.core.tests.test_applications_api.TestApplicationsAPI testMethod=test_list_superuser_full_list>
msg = "{'pag[209 chars]d', 'provider': 189, 'provider_obj': {'pk': 18[748 chars]''}]} != {'pag[209 chars]d', 'group': '', 'p... 'any',\n+               'provider': None,\n+               'provider_obj': None,\n+               'slug': 'denied'}]}"

    def fail(self, msg=None):
        """Fail immediately, with the given message."""
>       raise self.failureException(msg)
E       AssertionError: {'pag[209 chars]d', 'provider': 189, 'provider_obj': {'pk': 18[748 chars]''}]} != {'pag[209 chars]d', 'group': '', 'provider': 189, 'provider_ob[1110 chars]d'}]}
E         {'pagination': {'count': 2,
E                         'current': 1,
E                         'end_index': 2,
E                         'next': 0,
E                         'previous': 0,
E                         'start_index': 1,
E                         'total_pages': 1},
E          'results': [{'backchannel_providers': [],
E                       'backchannel_providers_obj': [],
E                       'group': '',
E                       'launch_url': 'https://goauthentik.io/yJ6ZYZrPYOIBpuYgume6',
E                       'meta_description': '',
E                       'meta_icon': None,
E                       'meta_launch_url': 'https://goauthentik.io/%(username)s',
E                       'meta_publisher': '',
E                       'name': 'allowed',
E                       'open_in_new_tab': True,
E                       'pk': '10dd3643-000f-4704-ad47-72c54e302b19',
E                       'policy_engine_mode': 'any',
E                       'provider': 189,
E                       'provider_obj': {'assigned_application_name': 'allowed',
E                                        'assigned_application_slug': 'allowed',
E                                        'authentication_flow': None,
E                                        'authorization_flow': '00dd771d-bf83-49de-ae91-3476d0902ef6',
E                                        'component': 'ak-provider-oauth2-form',
E                                        'invalidation_flow': None,
E                                        'meta_model_name': 'authentik_providers_oauth2.oauth2provider',
E                                        'name': 'test',
E                                        'pk': 189,
E                                        'property_mappings': [],
E                                        'verbose_name': 'OAuth2/OpenID Provider',
E                                        'verbose_name_plural': 'OAuth2/OpenID '
E                                                               'Providers'},
E       -               'slug': 'allowed'}]}
E       ?                                 ^^
E       
E       +               'slug': 'allowed'},
E       ?                                 ^
E       
E       +              {'backchannel_providers': [],
E       +               'backchannel_providers_obj': [],
E       +               'group': '',
E       +               'launch_url': None,
E       +               'meta_description': '',
E       +               'meta_icon': None,
E       +               'meta_launch_url': '',
E       +               'meta_publisher': '',
E       +               'name': 'denied',
E       +               'open_in_new_tab': False,
E       +               'pk': 'f63f90c8-d51b-42dd-9a02-ad609c17e7eb',
E       +               'policy_engine_mode': 'any',
E       +               'provider': None,
E       +               'provider_obj': None,
E       +               'slug': 'denied'}]}

.../hostedtoolcache/Python/3.12.8................../x64/lib/python3.12/unittest/case.py:715: AssertionError
authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI::test_list_superuser_full_list
Stack Traces | 1.54s run time
self = <unittest.case._Outcome object at 0x7f7eef5de8a0>
test_case = <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>
subTest = False

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

.../hostedtoolcache/Python/3.12.8................../x64/lib/python3.12/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>
result = <TestCaseFunction test_list_superuser_full_list>

    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.12.8................../x64/lib/python3.12/unittest/case.py:634: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>
method = <bound method TestEndpointsAPI.test_list_superuser_full_list of <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>>

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

.../hostedtoolcache/Python/3.12.8................../x64/lib/python3.12/unittest/case.py:589: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>

    def test_list_superuser_full_list(self):
        """Test list operation with superuser_full_list"""
        self.client.force_login(self.user)
        response = self.client.get(
            reverse("authentik_api:endpoint-list") + "?superuser_full_list=true"
        )
>       self.assertJSONEqual(
            response.content.decode(),
            {
                "pagination": {
                    "next": 0,
                    "previous": 0,
                    "count": 2,
                    "current": 1,
                    "total_pages": 1,
                    "start_index": 1,
                    "end_index": 2,
                },
                "results": [
                    {
                        "pk": str(self.allowed.pk),
                        "name": self.allowed.name,
                        "provider": self.provider.pk,
                        "provider_obj": {
                            "pk": self.provider.pk,
                            "name": self.provider.name,
                            "authentication_flow": None,
                            "authorization_flow": None,
                            "property_mappings": [],
                            "component": "ak-provider-rac-form",
                            "assigned_application_slug": self.app.slug,
                            "assigned_application_name": self.app.name,
                            "connection_expiry": "hours=8",
                            "delete_token_on_disconnect": False,
                            "verbose_name": "RAC Provider",
                            "verbose_name_plural": "RAC Providers",
                            "meta_model_name": "authentik_providers_rac.racprovider",
                            "settings": {},
                            "outpost_set": [],
                        },
                        "protocol": "rdp",
                        "host": self.allowed.host,
                        "maximum_connections": 1,
                        "settings": {},
                        "property_mappings": [],
                        "auth_mode": "",
                        "launch_url": f"/application/rac/{self.app.slug}/{str(self.allowed.pk)}/",
                    },
                    {
                        "pk": str(self.denied.pk),
                        "name": self.denied.name,
                        "provider": self.provider.pk,
                        "provider_obj": {
                            "pk": self.provider.pk,
                            "name": self.provider.name,
                            "authentication_flow": None,
                            "authorization_flow": None,
                            "property_mappings": [],
                            "component": "ak-provider-rac-form",
                            "assigned_application_slug": self.app.slug,
                            "assigned_application_name": self.app.name,
                            "connection_expiry": "hours=8",
                            "delete_token_on_disconnect": False,
                            "verbose_name": "RAC Provider",
                            "verbose_name_plural": "RAC Providers",
                            "meta_model_name": "authentik_providers_rac.racprovider",
                            "settings": {},
                            "outpost_set": [],
                        },
                        "protocol": "rdp",
                        "host": self.denied.host,
                        "maximum_connections": 1,
                        "settings": {},
                        "property_mappings": [],
                        "auth_mode": "",
                        "launch_url": f"/application/rac/{self.app.slug}/{str(self.denied.pk)}/",
                    },
                ],
            },
        )

.../rac/tests/test_endpoints_api.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>
raw = '{"pagination":{"next":0,"previous":0,"count":2,"current":1,"total_pages":1,"start_index":1,"end_index":2},"results":[....../rac/nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6/a600a3b0-a3ba-4a60-805d-311042fa8d94/","maximum_connections":1}]}'
expected_data = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'auth_mode': '', 'host': 'mRTm....../rac/nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6/c3e4075e-8dba-47df-a71e-c82be06e411c/', 'maximum_connections': 1, ...}]}
msg = None

    def assertJSONEqual(self, raw, expected_data, msg=None):
        """
        Assert that the JSON fragments raw and expected_data are equal.
        Usual JSON non-significant whitespace rules apply as the heavyweight
        is delegated to the json library.
        """
        try:
            data = json.loads(raw)
        except json.JSONDecodeError:
            self.fail("First argument is not valid JSON: %r" % raw)
        if isinstance(expected_data, str):
            try:
                expected_data = json.loads(expected_data)
            except ValueError:
                self.fail("Second argument is not valid JSON: %r" % expected_data)
>       self.assertEqual(data, expected_data, msg=msg)

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../django/test/testcases.py:922: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>
first = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'auth_mode': '', 'host': 'mRTm....../rac/nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6/a600a3b0-a3ba-4a60-805d-311042fa8d94/', 'maximum_connections': 1, ...}]}
second = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'auth_mode': '', 'host': 'mRTm....../rac/nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6/c3e4075e-8dba-47df-a71e-c82be06e411c/', 'maximum_connections': 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.12.8................../x64/lib/python3.12/unittest/case.py:885: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>
d1 = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'auth_mode': '', 'host': 'mRTm....../rac/nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6/a600a3b0-a3ba-4a60-805d-311042fa8d94/', 'maximum_connections': 1, ...}]}
d2 = {'pagination': {'count': 2, 'current': 1, 'end_index': 2, 'next': 0, ...}, 'results': [{'auth_mode': '', 'host': 'mRTm....../rac/nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6/c3e4075e-8dba-47df-a71e-c82be06e411c/', 'maximum_connections': 1, ...}]}
msg = None

    def assertDictEqual(self, d1, d2, msg=None):
        self.assertIsInstance(d1, dict, 'First argument is not a dictionary')
        self.assertIsInstance(d2, dict, 'Second argument is not a dictionary')
    
        if d1 != d2:
            standardMsg = '%s != %s' % _common_shorten_repr(d1, d2)
            diff = ('\n' + '\n'.join(difflib.ndiff(
                           pprint.pformat(d1).splitlines(),
                           pprint.pformat(d2).splitlines())))
            standardMsg = self._truncateMessage(standardMsg, diff)
>           self.fail(self._formatMessage(msg, standardMsg))

.../hostedtoolcache/Python/3.12.8................../x64/lib/python3.12/unittest/case.py:1184: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <authentik.enterprise.providers.rac.tests.test_endpoints_api.TestEndpointsAPI testMethod=test_list_superuser_full_list>
msg = "{'pag[587 chars]W', 'verbose_name': 'RAC Provider', 'verbose_n[457 chars] 1}]} != {'pag[587 chars]W', 'connection_exp...ovider',\n+                                'verbose_name_plural': 'RAC Providers'},\n                'settings': {}}]}"

    def fail(self, msg=None):
        """Fail immediately, with the given message."""
>       raise self.failureException(msg)
E       AssertionError: {'pag[587 chars]W', 'verbose_name': 'RAC Provider', 'verbose_n[457 chars] 1}]} != {'pag[587 chars]W', 'connection_expiry': 'hours=8', 'delete_to[1424 chars]/'}]}
E         {'pagination': {'count': 2,
E                         'current': 1,
E                         'end_index': 2,
E                         'next': 0,
E                         'previous': 0,
E                         'start_index': 1,
E                         'total_pages': 1},
E          'results': [{'auth_mode': '',
E                       'host': 'mRTmymxuOFYgfui5q4vSH6ac31Q9HMeDFAIO4vj6',
E                       'launch_url': '/appl.../rac/nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6/a600a3b0-a3ba-4a60-805d-311042fa8d94/',
E                       'maximum_connections': 1,
E                       'name': 'a-I3FY9aKjlCW7mQH2fTt8Sg8aI2LzJDNUy94g1NV4',
E                       'pk': 'a600a3b0-a3ba-4a60-805d-311042fa8d94',
E                       'property_mappings': [],
E                       'protocol': 'rdp',
E                       'provider': 176,
E                       'provider_obj': {'assigned_application_name': 'y2bQUTzW5kQOYnNd9lLlGQ0lUDgItLb5w7HeI7GW',
E                                        'assigned_application_slug': 'nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6',
E                                        'authentication_flow': None,
E                                        'authorization_flow': None,
E                                        'component': 'ak-provider-rac-form',
E                                        'connection_expiry': 'hours=8',
E                                        'delete_token_on_disconnect': False,
E                                        'meta_model_name': 'authentik_providers_rac.racprovider',
E                                        'name': 'ktGNajuwDTRuscDgFIeDlh37yGEViBQd83Op7jOI',
E                                        'outpost_set': [],
E                                        'pk': 176,
E                                        'property_mappings': [],
E                                        'settings': {},
E                                        'verbose_name': 'RAC Provider',
E                                        'verbose_name_plural': 'RAC Providers'},
E       +               'settings': {}},
E       +              {'auth_mode': '',
E       +               'host': 'sV0XUs3T5sjXsMddR2KohkyuJPz3R1u2wnbWoR8x',
E       +               'launch_url': '/applicatio.../rac/nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6/c3e4075e-8dba-47df-a71e-c82be06e411c/',
E       +               'maximum_connections': 1,
E       +               'name': 'b-H1piu5T0nQQnvAU5pAskRGGF3Wtvmt6pYykN2TpW',
E       +               'pk': 'c3e4075e-8dba-47df-a71e-c82be06e411c',
E       +               'property_mappings': [],
E       +               'protocol': 'rdp',
E       +               'provider': 176,
E       +               'provider_obj': {'assigned_application_name': 'y2bQUTzW5kQOYnNd9lLlGQ0lUDgItLb5w7HeI7GW',
E       +                                'assigned_application_slug': 'nZEyo7HoMJh75Y3iuVqHqycWvuxj8CvLGdFj5Vu6',
E       +                                'authentication_flow': None,
E       +                                'authorization_flow': None,
E       +                                'component': 'ak-provider-rac-form',
E       +                                'connection_expiry': 'hours=8',
E       +                                'delete_token_on_disconnect': False,
E       +                                'meta_model_name': 'authentik_providers_rac.racprovider',
E       +                                'name': 'ktGNajuwDTRuscDgFIeDlh37yGEViBQd83Op7jOI',
E       +                                'outpost_set': [],
E       +                                'pk': 176,
E       +                                'property_mappings': [],
E       +                                'settings': {},
E       +                                'verbose_name': 'RAC Provider',
E       +                                'verbose_name_plural': 'RAC Providers'},
E                       'settings': {}}]}

.../hostedtoolcache/Python/3.12.8................../x64/lib/python3.12/unittest/case.py:715: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
@BeryJu BeryJu force-pushed the root/more-cleanup branch 3 times, most recently from a8d6583 to dca49fe Compare January 16, 2025 15:03
Signed-off-by: Jens Langhammer <[email protected]>
@BeryJu BeryJu force-pushed the root/more-cleanup branch from dca49fe to 0633728 Compare January 16, 2025 15:50
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.

1 participant