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

Support @AuthorizationPolicy on suspended Kotlin endpoint methods #44668

Merged

Conversation

michalvavrik
Copy link
Member

When there is suspended Kotlin endpoints secured with @AuthorizePolicy, build fails because I have added extra validation that when annotated method doesn't match some minimal parameters (is public, not a constructor, not static, not synthetic), validation fails. The idea was to inform user early they probably made mistake. I didn't know that for suspended Kotlin functions, there are 2 methods:

  • originalMethodName
  • originalMethodName$suspendImpl

Copy link

quarkus-bot bot commented Nov 23, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 61cdd88.

✅ 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 21

📦 extensions/smallrye-reactive-messaging/deployment

io.quarkus.smallrye.reactivemessaging.hotreload.ConnectorChangeTest.testUpdatingConnector - History

  • Expecting actual: ["-4","-5","-6","-7","-8","-9","-10","-11"] to start with: ["-3", "-4", "-5", "-6"] - java.lang.AssertionError
java.lang.AssertionError: 

Expecting actual:
  ["-4","-5","-6","-7","-8","-9","-10","-11"]
to start with:
  ["-3", "-4", "-5", "-6"]

	at io.quarkus.smallrye.reactivemessaging.hotreload.ConnectorChangeTest.testUpdatingConnector(ConnectorChangeTest.java:36)

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Great stuff!

@geoand geoand merged commit cb7acc9 into quarkusio:main Nov 24, 2024
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Nov 24, 2024
@gsmet gsmet modified the milestones: 3.18 - main, 3.17.1 Nov 27, 2024
@michalvavrik michalvavrik deleted the feature/kotlin-authorization-policy-fix branch January 2, 2025 17:26
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.

@AuthorizationPolicy is not compatoble with kotlin suspend functions
3 participants