jakartaee / common-annotations-api

Jakarta Annotations
https://eclipse.org/ee4j/ca
Other
51 stars 36 forks source link

Standardize the concept of permissions annotation for JAX-RS resources #126

Open jycr opened 6 months ago

jycr commented 6 months ago

Quarkus allows you to use the concept of permissions to protect a JAX-RS resource. Example of how to define security policy for a web resource via permissions: https://quarkus.io/guides/security-authorize-web-endpoints-reference#permission-annotation

This is another philosophy different from the concept of Role (cf. jakarta.annotation.security.RolesAllowed). This principle, based on permissions, is very useful for certain use cases.

Typically, this makes it possible to dissociate the roles from possible uses, and therefore to make the configuration of what a role has the right to do more flexible. Very interesting thing, this allows, by simple configuration (via properties), to authorize a role on certain actions for specific resource, without needing to change the source code.

This is like the concept of standard permission in Java (see https://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html)

This concept, proposed by Quarkus, would be really interesting to be standardized in order to allow several implementations to exist.

Proposal of the PermissionsAllowed annotation to standardize (with jakarta.annotation.security.PermissionsAllowed): https://github.com/quarkusio/quarkus-security/blob/main/src/main/java/io/quarkus/security/PermissionsAllowed.java

jycr commented 3 months ago

any news or feedbacks for this proposal?