Skip to content

rbac: fix RoleObjectPermissionTable not showing add_user_to_group#14312

Merged
BeryJu merged 1 commit intomainfrom
rbac/fix-role-object-permission-table
May 2, 2025
Merged

rbac: fix RoleObjectPermissionTable not showing add_user_to_group#14312
BeryJu merged 1 commit intomainfrom
rbac/fix-role-object-permission-table

Conversation

@gergosimonyi
Copy link
Collaborator

Duplication strikes again! This is this commit, but for Roles.

@gergosimonyi gergosimonyi requested a review from a team as a code owner May 1, 2025 02:17
@netlify
Copy link

netlify bot commented May 1, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit e9590da
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/6812d9a72be6da0008db70d1

@netlify
Copy link

netlify bot commented May 1, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit e9590da
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/6812d9a752207c00082b8594
😎 Deploy Preview https://deploy-preview-14312--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.

@codecov
Copy link

codecov bot commented May 1, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1786 1 1785 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.9s run time
self = <unittest.case._Outcome object at 0x7f949765e360>
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.12.10.............../x64/lib/python3.12/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.12.10.............../x64/lib/python3.12/unittest/case.py:634: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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

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:294: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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

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.12.10.............../x64/lib/python3.12/unittest/case.py:878: 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 44fb59e into main May 2, 2025
84 of 87 checks passed
@BeryJu BeryJu deleted the rbac/fix-role-object-permission-table branch May 2, 2025 15:42
@BeryJu
Copy link
Member

BeryJu commented May 2, 2025

/cherry-pick version-2025.4

gcp-cherry-pick-bot bot pushed a commit that referenced this pull request May 2, 2025
…14312)

fix RoleObjectPermissionTable not showing `add_user_to_group`
BeryJu pushed a commit that referenced this pull request May 2, 2025
…cherry-pick #14312) (#14334)

rbac: fix RoleObjectPermissionTable not showing `add_user_to_group` (#14312)

fix RoleObjectPermissionTable not showing `add_user_to_group`

Co-authored-by: Simonyi Gergő <28359278+gergosimonyi@users.noreply.github.com>
kensternberg-authentik added a commit that referenced this pull request May 22, 2025
* main: (54 commits)
  ci: use dependabot for compose correctly? (#14340)
  website/docs: use Universal Device Trust for GDTC instead of Okta (#14335)
  ci: use dependabot for docker-compose files (#14336)
  website/docs: fix dry-run release highlight (#14337)
  rbac: fix RoleObjectPermissionTable not showing `add_user_to_group` (#14312)
  core, web: update translations (#14326)
  core: bump github.com/sethvargo/go-envconfig from 1.2.0 to 1.3.0 (#14327)
  web: bump vite from 5.4.16 to 5.4.19 in /web (#14324)
  core: bump setuptools from 78.1.0 to v79.0.0 (#14173)
  core: bump ruff from 0.11.5 to v0.11.6 (#14171)
  core: bump s3transfer from 0.11.4 to v0.11.5 (#14172)
  core: bump packaging from 24.2 to v25.0 (#14169)
  core: bump aiohttp from 3.11.16 to v3.11.18 (#14166)
  core: bump boto3 from 1.37.35 to v1.37.38 (#14167)
  core: bump frozenlist from 1.5.0 to v1.6.0 (#14168)
  core: bump pdoc from 15.0.1 to v15.0.3 (#14170)
  core: bump trio from 0.29.0 to v0.30.0 (#14174)
  translate: Updates for file locale/en/LC_MESSAGES/django.po in it (#14271)
  website: bump the build group across 1 directory with 9 updates (#14293)
  core, web: update translations (#14309)
  ...
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