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

MGMT-16766: Use client_id instead of clientId #6076

Merged

Conversation

jhernand
Copy link
Contributor

The clientId claim will be replaced by client_id from the SSO server in order to be compliant with the OAuth2 specification. During a transition period the old clientId will be preserved. This patch changes our code so that it first tries to use the newer and more correct client_id, and then if it doesn't exist it tries the older clientId.

In the future we should check if we are really using the value of this client_id claim at all. If we aren't then it would probably be good to remove the code completely.

Related: https://issues.redhat.com/browse/MGMT-16766
Related: https://datatracker.ietf.org/doc/html/rfc9068#section-2.2

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci openshift-ci bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 12, 2024
@openshift-ci openshift-ci bot requested review from eifrach and eranco74 March 12, 2024 08:31
Copy link

openshift-ci bot commented Mar 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhernand

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

The pull request process is described here

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 12, 2024
The `clientId` claim will be replaced by `client_id` from the SSO server
in order to be compliant with the OAuth2 specification. During a
transition period the old `clientId` will be preserved. This patch
changes our code so that it first tries to use the newer and more
correct `client_id`, and then if it doesn't exist it tries the older
`clientId`.

In the future we should check if we are really using the value of this
`client_id` claim at all. If we aren't then it would probably be good to
remove the code completely.

Related: https://issues.redhat.com/browse/MGMT-16766
Related: https://datatracker.ietf.org/doc/html/rfc9068#section-2.2
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
@jhernand jhernand force-pushed the use_standard_client_id_claim branch from 42953c8 to 0403b7e Compare March 12, 2024 08:33
@openshift-ci openshift-ci bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 12, 2024
@eifrach
Copy link
Contributor

eifrach commented Mar 12, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2024
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 68.44%. Comparing base (9823c09) to head (0403b7e).
Report is 5 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6076      +/-   ##
==========================================
+ Coverage   68.40%   68.44%   +0.03%     
==========================================
  Files         239      239              
  Lines       35457    35575     +118     
==========================================
+ Hits        24256    24349      +93     
- Misses       9098     9123      +25     
  Partials     2103     2103              
Files Coverage Δ
pkg/auth/auth_handler_test_utils.go 77.77% <100.00%> (ø)
pkg/auth/rhsso_authenticator.go 51.53% <33.33%> (-0.65%) ⬇️

... and 7 files with indirect coverage changes

@gamli75
Copy link
Contributor

gamli75 commented Mar 12, 2024

@jhernand please retitle the PR with MGMT-16766

@jhernand jhernand changed the title Use client_id instead of clientId MGMT-16766: Use client_id instead of clientId Mar 12, 2024
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 12, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 12, 2024

@jhernand: This pull request references MGMT-16766 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

The clientId claim will be replaced by client_id from the SSO server in order to be compliant with the OAuth2 specification. During a transition period the old clientId will be preserved. This patch changes our code so that it first tries to use the newer and more correct client_id, and then if it doesn't exist it tries the older clientId.

In the future we should check if we are really using the value of this client_id claim at all. If we aren't then it would probably be good to remove the code completely.

Related: https://issues.redhat.com/browse/MGMT-16766
Related: https://datatracker.ietf.org/doc/html/rfc9068#section-2.2

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@jhernand
Copy link
Contributor Author

@jhernand please retitle the PR with MGMT-16766

Done.

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD a2facc2 and 2 for PR HEAD 0403b7e in total

Copy link

openshift-ci bot commented Mar 12, 2024

@jhernand: all tests passed!

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 6f671e7 into openshift:master Mar 12, 2024
14 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-agent-installer-api-server-container-v4.16.0-202403122214.p0.g6f671e7.assembly.stream.el8 for distgit ose-agent-installer-api-server.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants