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

gRPC: Perform authentication when gRPC server runs on the same server and root path is different than '/' #45861

Conversation

michalvavrik
Copy link
Member

@quarkus-bot quarkus-bot bot added the area/grpc gRPC label Jan 26, 2025
Copy link
Member

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Copy link

quarkus-bot bot commented Jan 26, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 2c58e9f.

✅ 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

📦 integration-tests/opentelemetry

io.quarkus.it.opentelemetry.MetricsTest.directCounterTest - History

  • Condition with Lambda expression in io.quarkus.it.opentelemetry.MetricsTest was not fulfilled within 5 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.it.opentelemetry.MetricsTest was not fulfilled within 5 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 io.quarkus.it.opentelemetry.MetricsTest.directCounterTest(MetricsTest.java:57)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)

@geoand geoand merged commit 456043a into quarkusio:main Jan 27, 2025
37 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.19 - main milestone Jan 27, 2025
@michalvavrik michalvavrik deleted the feature/fix-grpc-security-with-diff-root-path branch January 27, 2025 08:24
securityHandlers = filterBuildItems
.stream()
.filter(filter -> filter.getPriority() == FilterBuildItem.AUTHENTICATION
|| filter.getPriority() == FilterBuildItem.AUTHORIZATION)
Copy link
Member Author

Choose a reason for hiding this comment

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

I slept on #45861 and realized that HTTP authorizer is not applied due to

} else if (ctx.get(HttpAuthenticator.class.getName()) != null) {
. There are tests for HTTP Security policies with gRPC, but I created them to detect hanging (verify fix), not to test authorization, therefore they didn't fail #45861. Documentation https://quarkus.io/guides/grpc-service-implementation#secure-grpc-service says clearly that security annotations are a way to secure gRPC services and there is not a single mention of HTTP permissions.

Now I wonder, either drop filter.getPriority() == FilterBuildItem.AUTHORIZATION because it is misleading or support & test & document HTTP Security policies with gRPC. I am not sure it makes sense to support HTTP Security policies with gRPC.

Apologies I didn't realize it sooner.

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.

3 participants