Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining endpoint security through JDL #23740

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Commits on Oct 4, 2023

  1. 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
    SpiralUp committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    97f3f90 View commit details
    Browse the repository at this point in the history
  2. 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
    SpiralUp committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    927949c View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2023

  1. Configuration menu
    Copy the full SHA
    701a489 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2023

  1. Configuration menu
    Copy the full SHA
    aef7616 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2023

  1. Configuration menu
    Copy the full SHA
    cf772f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9ca37d8 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2023

  1. Fix conflicts

    SpiralUp committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    7f9648e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    455d2da View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2023

  1. Configuration menu
    Copy the full SHA
    c21ffb2 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2023

  1. Configuration menu
    Copy the full SHA
    88a446b View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2023

  1. Set .mocharc.cjs parallel back to true

     To enable running tests from WebStorm set this option back to false.
    SpiralUp committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    7c2c2da View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b87737 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    30123fe View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2023

  1. Configuration menu
    Copy the full SHA
    9f5b2ee View commit details
    Browse the repository at this point in the history