Skip to content

Comments

WIP: OCPBUGS-63228: groupmapper: make direct API calls to retrieve groups instead of using a cache#205

Open
liouk wants to merge 1 commit intoopenshift:masterfrom
liouk:groups-sync
Open

WIP: OCPBUGS-63228: groupmapper: make direct API calls to retrieve groups instead of using a cache#205
liouk wants to merge 1 commit intoopenshift:masterfrom
liouk:groups-sync

Conversation

@liouk
Copy link
Member

@liouk liouk commented Dec 11, 2025

Per the Synchronizing User Groups on Login enhancement, OIDC groups are synchronized to Openshift groups upon user login. During synchronization, the oauth-server checks current user groups and compares with the ones obtained from the provider via the token; it then calculates which groups need to be added/removed to/from the user, and performs the changes accordingly.

There is currently an issue with this implementation, as the server uses a groups cache to determine user group membership; this cache can be stale, which can lead to problems such as OCPBUGS-63228.

During authorization, correctness is non-negotiable, so we must never rely on a cache to determine user group membership. This PR removes the group cache and replaces it with direct API calls; correctness comes at the cost of increased performance, especially in large clusters with large numbers of groups.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 11, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 11, 2025
@openshift-ci-robot
Copy link
Contributor

@liouk: This pull request references Jira Issue OCPBUGS-63228, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Per the Synchronizing User Groups on Login enhancement, OIDC groups are synchronized to Openshift groups upon user login. During synchronization, the oauth-server checks current user groups and compares with the ones obtained from the provider via the token; it then calculates which groups need to be added/removed to/from the user, and performs the changes accordingly.

There is currently an issue with this implementation, as the server uses a groups cache to determine user group membership; this cache can be stale, which can lead to problems such as OCPBUGS-63228.

During authorization, correctness is non-negotiable, so we must never rely on a cache to determine user group membership. This PR removes the group cache and replaces it with direct API calls; correctness comes at the cost of increased performance, especially in large clusters with large numbers of groups.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from deads2k and ibihim December 11, 2025 12:18
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: liouk
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 11, 2025
@openshift-ci-robot
Copy link
Contributor

@liouk: This pull request references Jira Issue OCPBUGS-63228, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @xingxingxia

Details

In response to this:

Per the Synchronizing User Groups on Login enhancement, OIDC groups are synchronized to Openshift groups upon user login. During synchronization, the oauth-server checks current user groups and compares with the ones obtained from the provider via the token; it then calculates which groups need to be added/removed to/from the user, and performs the changes accordingly.

There is currently an issue with this implementation, as the server uses a groups cache to determine user group membership; this cache can be stale, which can lead to problems such as OCPBUGS-63228.

During authorization, correctness is non-negotiable, so we must never rely on a cache to determine user group membership. This PR removes the group cache and replaces it with direct API calls; correctness comes at the cost of increased performance, especially in large clusters with large numbers of groups.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from xingxingxia December 11, 2025 12:19
@liouk
Copy link
Member Author

liouk commented Dec 12, 2025

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 12, 2025

@liouk: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants