-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20997 from stuartwdouglas/20979
Security annotations don't work with CompletionStage
- Loading branch information
Showing
3 changed files
with
51 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package io.quarkus.security.test.cdi.app; | ||
|
||
import java.util.concurrent.CompletionStage; | ||
|
||
import javax.annotation.security.DenyAll; | ||
import javax.annotation.security.RolesAllowed; | ||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.inject.Named; | ||
|
||
import io.smallrye.mutiny.Uni; | ||
|
||
/** | ||
* @author Michal Szynkiewicz, [email protected] | ||
*/ | ||
|
@@ -23,6 +27,16 @@ public String securedMethod() { | |
return "accessibleForAdminOnly"; | ||
} | ||
|
||
@RolesAllowed("admin") | ||
public Uni<String> securedMethodUni() { | ||
return Uni.createFrom().item("accessibleForAdminOnly"); | ||
} | ||
|
||
@RolesAllowed("admin") | ||
public CompletionStage<String> securedMethodCompletionStage() { | ||
return Uni.createFrom().item("accessibleForAdminOnly").subscribeAsCompletionStage(); | ||
} | ||
|
||
public String unsecuredMethod() { | ||
return "accessibleForAll"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters