-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2.13] Perform security checks eagerly in RR on inherited endpoints
- Loading branch information
1 parent
bc0ca28
commit 2eb4659
Showing
12 changed files
with
160 additions
and
12 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
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
22 changes: 22 additions & 0 deletions
22
.../test/java/io/quarkus/resteasy/reactive/server/test/security/UnsecuredParentResource.java
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.quarkus.resteasy.reactive.server.test.security; | ||
|
||
import javax.annotation.security.RolesAllowed; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
|
||
public class UnsecuredParentResource { | ||
|
||
@Path("/defaultSecurityParent") | ||
@GET | ||
public String defaultSecurityParent() { | ||
return "defaultSecurityParent"; | ||
} | ||
|
||
@RolesAllowed({ "admin", "user" }) | ||
@GET | ||
@Path("/parent-annotated") | ||
public String parentAnnotated() { | ||
return "parent-annotated"; | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
* @author Michal Szynkiewicz, [email protected] | ||
*/ | ||
@Path("/unsecured") | ||
public class UnsecuredResource { | ||
public class UnsecuredResource extends UnsecuredParentResource implements UnsecuredResourceInterface { | ||
@Path("/defaultSecurity") | ||
@GET | ||
public String defaultSecurity() { | ||
|
@@ -49,4 +49,16 @@ public UnsecuredSubResource sub() { | |
public UnsecuredSubResource permitAllSub() { | ||
return new UnsecuredSubResource(); | ||
} | ||
|
||
@Override | ||
public String interfaceOverriddenDeclaredOnInterface() { | ||
return "implementor-response"; | ||
} | ||
|
||
@GET | ||
@Path("/interface-overridden-declared-on-implementor") | ||
@Override | ||
public String interfaceOverriddenDeclaredOnImplementor() { | ||
return "implementor-response"; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...st/java/io/quarkus/resteasy/reactive/server/test/security/UnsecuredResourceInterface.java
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.quarkus.resteasy.reactive.server.test.security; | ||
|
||
import javax.annotation.security.RolesAllowed; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
|
||
public interface UnsecuredResourceInterface { | ||
|
||
@Path("/defaultSecurityInterface") | ||
@GET | ||
default String defaultSecurityInterface() { | ||
return "defaultSecurityInterface"; | ||
} | ||
|
||
@RolesAllowed({ "admin", "user" }) | ||
@GET | ||
@Path("/interface-annotated") | ||
default String interfaceAnnotated() { | ||
return "interface-annotated"; | ||
} | ||
|
||
@RolesAllowed({ "admin", "user" }) | ||
@GET | ||
@Path("/interface-overridden-declared-on-interface") | ||
default String interfaceOverriddenDeclaredOnInterface() { | ||
// this interface is overridden without @GET and @Path | ||
return "interface-overridden-declared-on-interface"; | ||
} | ||
|
||
@RolesAllowed({ "admin", "user" }) | ||
@GET | ||
@Path("/interface-overridden-declared-on-implementor") | ||
default String interfaceOverriddenDeclaredOnImplementor() { | ||
// this interface is overridden with @GET and @Path | ||
return "interface-overridden-declared-on-implementor"; | ||
} | ||
|
||
} |
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
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
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