Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defining endpoint security through JDL
This commit introduces a role-based security feature for the backend, allowing users to define security configurations using JDL clauses. Security can now be specified directly within JDL for various entities, where different roles with specified permissions are mapped to the corresponding Java entity resource files. This mapping auto-generates the requisite `@Secured({})` annotations on the endpoints, ensuring the right level of access control based on roles. Examples of the JDL security clauses include: ``` secure entity1, entity2, entity3 with roles { ROLE_ADMIN allows (get, post, put, delete) ROLE_USER allows (get) } ``` and ``` secure all except entity3 with roles { ROLE_ADMIN allows (get, post, put, delete) ROLE_USER allows (get) } ``` which would translate to `@Secured({ "ROLE_ADMIN" })` annotations in the generated Java code for specified endpoints. Additionally, the integration tests have been updated to consider these role-based security configurations. Moreover, the groundwork for supporting other security types has been laid down through the inclusion of grammar and parser definitions. These additional security types encompass privilege security, organizational security, parent based security, and relation based security, although the code generators for these types are not included in this commit. Resolves jhipster#19201
- Loading branch information