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

Implement test for OIDC filtered client #1513

Merged
merged 3 commits into from
Nov 10, 2023

Conversation

mocenas
Copy link
Contributor

@mocenas mocenas commented Nov 9, 2023

Test for quarkusio/quarkus#36459 and quarkusio/quarkus#36501

Summary

Implement test for selection of exchange OIDC client from multiple clients setup in one app.

Please select the relevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • Dependency update
  • Refactoring
  • Backport
  • New scenario (non-breaking change which adds functionality)
  • This change requires a documentation update
  • This change requires execution against OCP (use run tests phrase in comment)

Checklist:

  • Methods and classes used in PR scenarios are meaningful
  • Commits are well encapsulated and follow the best practices

@michalvavrik
Copy link
Contributor

@mocenas I think failures are related, can you check please?

@mocenas
Copy link
Contributor Author

mocenas commented Nov 9, 2023

@mocenas I think failures are related, can you check please?

You are right, failure was related. Should be fixed now.


@RegisterRestClient
@AccessToken
@RegisterProvider(DefaultTokenRequestFilter.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this, because we are loosing only test of @AcessToken in our all TS / FW. Why can't you add your own client, is it because of what you are explaining on the DefaultTokenRequestFilter? I will comment there.

* {@link io.quarkus.ts.security.keycloak.oidcclient.extended.restclient.ping.clients.TokenPropagationPongClient}
* It would not be required normally, but having {@link CustomTokenRequestFilter} causes AmbiguousResolutionException when
* getting a default filter.
* So this class is necessary to have unambiguous filter for TokenPropagatingPongClient.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like something that could be fixed with qualifiers since we know this at build time. Can you please open issue? IMO this is not expected behavior, because Quarkus knows there is need to use AccessTokenRequestFilter. The worst case scenario, Quarkus can use annotation transformer and produce this class for you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ping me there, I'd like to have a look at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this behaviour is not OK. I've created an issue quarkusio/quarkus#36994

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@michalvavrik
Copy link
Contributor

@mocenas I'd prefer to have TODO: LINK_TO_CREATED_ISSUE on DefaultTokenRequestFilter.java, or you can let me know why you disagree. Anyway this PR can be merged, lgtm, thank you.

@michalvavrik michalvavrik added the triage/backport-3.2 RHBQ Ghost LTS release label Nov 9, 2023
@mocenas mocenas changed the title Implement test for OIDC filtered client DRAFT: Implement test for OIDC filtered client Nov 10, 2023
@mocenas
Copy link
Contributor Author

mocenas commented Nov 10, 2023

I've added link to the issue, also I've ported the test to the reactive module.

@mocenas mocenas changed the title DRAFT: Implement test for OIDC filtered client Implement test for OIDC filtered client Nov 10, 2023
@michalvavrik
Copy link
Contributor

I've added link to the issue, also I've ported the test to the reactive module.

good idea

@mocenas
Copy link
Contributor Author

mocenas commented Nov 10, 2023

@michalvavrik Is it OK to merge this? (can you merge it?, don't forget to squash :-)

@michalvavrik michalvavrik merged commit c02c494 into quarkus-qe:main Nov 10, 2023
7 checks passed
@mocenas mocenas deleted the oidc_token_propagation branch November 10, 2023 10:22
@michalvavrik michalvavrik removed the triage/backport-3.2 RHBQ Ghost LTS release label Nov 21, 2023
michalvavrik pushed a commit to michalvavrik/quarkus-test-suite that referenced this pull request Nov 21, 2023
* Implement test for OIDC filtered client

Test for quarkusio/quarkus#36459 and quarkusio/quarkus#36501

* Resolve ambiguous accessTokenRequest

* Add OIDC FilteredToken test to reactive
michalvavrik pushed a commit to michalvavrik/quarkus-test-suite that referenced this pull request Nov 21, 2023
* Implement test for OIDC filtered client

Test for quarkusio/quarkus#36459 and quarkusio/quarkus#36501

* Resolve ambiguous accessTokenRequest

* Add OIDC FilteredToken test to reactive
michalvavrik pushed a commit to michalvavrik/quarkus-test-suite that referenced this pull request Nov 21, 2023
* Implement test for OIDC filtered client

Test for quarkusio/quarkus#36459 and quarkusio/quarkus#36501

* Resolve ambiguous accessTokenRequest

* Add OIDC FilteredToken test to reactive
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.

None yet

2 participants