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

WebSockets Next: allow to select authentication mechanism and OIDC tenant used for opening WebSocket handshake with annotation #46161

Merged

Conversation

michalvavrik
Copy link
Member

This comment has been minimized.

Copy link

github-actions bot commented Feb 9, 2025

🙈 The PR is closed and the preview is expired.

@michalvavrik
Copy link
Member Author

michalvavrik commented Feb 9, 2025

FYI @mkouba @sberyozkin - I have idea how to allow selecting mechanism or tenant with annotation even though proactive authentication is enabled, but this PR is big enough and it is not a priority. I'll open issue to improve it if this gets in. (also I didn't try the idea with sub-endpoints so no idea if I am not wrong)

This comment has been minimized.

@mkouba
Copy link
Contributor

mkouba commented Feb 18, 2025

FYI @mkouba @sberyozkin - I have idea how to allow selecting mechanism or tenant with annotation even though proactive authentication is enabled, but this PR is big enough and it is not a priority. I'll open issue to improve it if this gets in. (also I didn't try the idea with sub-endpoints so no idea if I am not wrong)

Does it mean that this only works if quarkus.http.auth.proactive=false?

@michalvavrik
Copy link
Member Author

michalvavrik commented Feb 18, 2025

FYI @mkouba @sberyozkin - I have idea how to allow selecting mechanism or tenant with annotation even though proactive authentication is enabled, but this PR is big enough and it is not a priority. I'll open issue to improve it if this gets in. (also I didn't try the idea with sub-endpoints so no idea if I am not wrong)

Does it mean that this only works if quarkus.http.auth.proactive=false?

Yep, that is how annotation-based authentication features usually works because they need to match request to the endpoint (AKA annotation) and you can't do it based on path for Jakarta REST resources and proactive authentication cannot be postponed. But I think we probably can do it for WS Next, right? Anyway, there is validation in place that fails build if you don't have quarkus.http.auth.proactive=false set and such annotation is registered if that is your concern.

@michalvavrik
Copy link
Member Author

@mkouba also I am not sure if you are aware, but any endpoint annotated with these annotations https://quarkus.io/guides/security-authentication-mechanisms#use-annotations-to-enable-path-based-authentication-for-jakarta-rest-endpoints is also authenticated. This is not a security issue, I think it will give WS Next advantage once I implement this for enabled proactive authentication.

@michalvavrik michalvavrik force-pushed the feature/http-auth-mech-ann-ws-next branch from 4eeddb6 to e219c38 Compare February 18, 2025 23:31

This comment has been minimized.

This comment has been minimized.

@michalvavrik
Copy link
Member Author

I just resolved merge conflicts and rebased in case you want to review @sberyozkin :-)

@michalvavrik michalvavrik force-pushed the feature/http-auth-mech-ann-ws-next branch from e219c38 to 6dc8788 Compare February 22, 2025 09:42

This comment has been minimized.

This comment has been minimized.

@michalvavrik michalvavrik force-pushed the feature/http-auth-mech-ann-ws-next branch from 6dc8788 to 1c74253 Compare February 23, 2025 13:39
Copy link

quarkus-bot bot commented Feb 23, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 1c74253.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

Copy link

quarkus-bot bot commented Feb 23, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 1c74253.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17 Windows

📦 extensions/hibernate-orm/deployment

io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.testFieldAccess - History

  • Expecting actual not to be null - java.lang.AssertionError
java.lang.AssertionError: 

Expecting actual not to be null
	at io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$FieldAccessEnhancedDelegate$1.assertValue(PublicFieldAccessInheritanceTest.java:141)
	at io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.doTestFieldAccess(PublicFieldAccessInheritanceTest.java:100)
	at io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.testFieldAccess(PublicFieldAccessInheritanceTest.java:61)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:513)

📦 extensions/micrometer-opentelemetry/deployment

io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod_UniFailed - History

  • Stream has no elements - java.lang.IllegalArgumentException
java.lang.IllegalArgumentException: Stream has no elements
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReadingDataPoint(MetricDataFilter.java:236)
	at io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod_UniFailed(MicrometerTimedInterceptorTest.java:202)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:513)
	at io.quarkus.test.QuarkusUnitTest.interceptTestMethod(QuarkusUnitTest.java:427)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

⚙️ JVM Integration Tests - JDK 17 Windows

📦 integration-tests/grpc-hibernate

com.example.grpc.hibernate.VertxBlockingRawTest.shouldAdd - History

  • Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:975)
	at com.example.grpc.hibernate.BlockingRawTestBase.shouldAdd(BlockingRawTestBase.java:59)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)

@sberyozkin sberyozkin merged commit e20e21c into quarkusio:main Mar 4, 2025
58 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Mar 4, 2025
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Mar 4, 2025
@michalvavrik michalvavrik deleted the feature/http-auth-mech-ann-ws-next branch March 4, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quarkus WebSockets Next does not respect @HttpAuthenticationMechanism
3 participants