forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
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 quarkusio#44995 from MikeEdgar/issue-40839
OpenAPI: check super class for inherited auto-security resource methods
- Loading branch information
Showing
6 changed files
with
113 additions
and
45 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
5 changes: 4 additions & 1 deletion
5
...eployment/src/main/java/io/quarkus/smallrye/openapi/deployment/filter/ClassAndMethod.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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
package io.quarkus.smallrye.openapi.deployment.filter; | ||
|
||
public record ClassAndMethod(String className, String methodName) { | ||
import org.jboss.jandex.ClassInfo; | ||
import org.jboss.jandex.MethodInfo; | ||
|
||
public record ClassAndMethod(ClassInfo classInfo, MethodInfo method) { | ||
|
||
} |
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
15 changes: 15 additions & 0 deletions
15
...t/java/io/quarkus/smallrye/openapi/test/jaxrs/OpenApiResourceAuthenticatedInherited1.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,15 @@ | ||
package io.quarkus.smallrye.openapi.test.jaxrs; | ||
|
||
import jakarta.ws.rs.Path; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.servers.Server; | ||
import org.eclipse.microprofile.openapi.annotations.tags.Tag; | ||
|
||
import io.quarkus.security.Authenticated; | ||
|
||
@Path("/resource-inherited1") | ||
@Tag(name = "test") | ||
@Server(url = "serverUrl") | ||
@Authenticated | ||
public class OpenApiResourceAuthenticatedInherited1 extends OpenApiResourceAuthenticatedAtClassLevel { | ||
} |
25 changes: 25 additions & 0 deletions
25
...t/java/io/quarkus/smallrye/openapi/test/jaxrs/OpenApiResourceAuthenticatedInherited2.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,25 @@ | ||
package io.quarkus.smallrye.openapi.test.jaxrs; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement; | ||
import org.eclipse.microprofile.openapi.annotations.servers.Server; | ||
import org.eclipse.microprofile.openapi.annotations.tags.Tag; | ||
|
||
import io.quarkus.security.Authenticated; | ||
|
||
@Path("/resource-inherited2") | ||
@Tag(name = "test") | ||
@Server(url = "serverUrl") | ||
@Authenticated | ||
public class OpenApiResourceAuthenticatedInherited2 extends OpenApiResourceAuthenticatedInherited1 { | ||
|
||
@GET | ||
@Path("/test-security/classLevel/2") | ||
@SecurityRequirement(name = "CustomOverride") | ||
public String secureEndpoint2() { | ||
return "secret"; | ||
} | ||
|
||
} |