Skip to content

Conversation

@ethaaalpha
Copy link
Contributor

@ethaaalpha ethaaalpha commented Oct 7, 2025

This pull request depends on /internal/session pull request.

What's new !

Business Logic Changes

Implementation of the new "base" class of business components: CommonBusiness.
This class is supposed to be inherited from every business (the change will be progressive when will implement other endpoints). However, this class contain ConfigurationBusiness, for the moment that's the only "exception". (=ConfigurationBusiness cannot inherit CommonBusiness due to circular problem)

Permissions

The new CorePermissions (present in CommonBusiness) class implement few methods to check user roles and matching of privates users groups.

Annotations

Implementation of the VipExternalSafe annotation to mark methods that are considered "safe" to be used inside controller (=they perform permissions checks on returned values).

Application Controller

This new controller implement all of this methods:

  • GET /applications
  • GET/POST/UPDATE/DELETE /applications/{id}

The GET /applications support basic pagination and filtering using group, offset and limit query parameters. The implementation of pagination is made by the new PageBuilder and PrecisePage classes.

Related tests are also presents in ApplicationControllerIT.

Application permissions

Permission Admin Dev User
Read Yes based on user groups based on user groups
Create / Edit / Delete Yes only applications in user private groups No
Associate Group Yes only at application creation No

- add new `InternalSecurityConfig` filter chain (defined as order: 2)
- created DELETE/POST/GET methods for /internal/session
- move some models from vip-api to vip-core
- create specific class for `CurrentUserProvider` service
- add a new `SessionAuthenticationProvider` with associated Filter/Token
- refractor `ApikeyAuthenticationProvider` and
  `SessionAuthenticationProvider` into `AbstractAuthenticationProvider`
- POST /internal/session now return Session object as valid response
- rename `SpringApiUser` to `SpringPrincipalUser`
- make COOKIES_SESSION and COOKIES_USER `httpOnly`
-- adapt GWT code to support httpOnly on server implementation
- cookies will set as `secure` only if *apache.sslport* != 80
- edit sign-in.js/home.js endpoints from */rest/session* to */internal/session* for sign-in and retrieving current session instead of cookies (due to **httpOnly**)
- VIPRemoval and VIPCheckRemoval created annotations
- all unsafe methods are concerned under /internal/** except for
  /internal/session (which creates the token)
- refactor `SessionControler` to handle http/cookie related objects
  instead of `SessionBusiness`
- make signIn define SecurityContextHolder
- new method `setAdminContext` to define user context in "simple
  business" calls
- prepare others tests for ApplicationBusiness next update
- CommonBusiness will be used in the backend refactoring
- new CorePermission class to handle basic permissions (role checking..)
- SessionAuthenticationProvider fill user groups in
  SpringSecurityContext
- new `PageBuilder` that can generate `PrecisePage` objects for
  pagination
- update ApplicationBusiness to handle permissions
- add IT related
- new `VIPExternalSafe` annotation to precise method that can safely be
  used inside a controller
- add new "dev" property for https or http session cookies
- cookie renewal when reaching success GET /internal/session
- and some code cleaning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant