Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
47a0822
feat: added messages.properties in en and fr
KenCacciabueOrif Jan 28, 2026
b1d5466
feat: added messages centralisation for security exceptions
KenCacciabueOrif Jan 28, 2026
5d8d2ce
feat: localised messages for auth exceptions
KenCacciabueOrif Jan 28, 2026
3cc5d22
feat: updated CredentialDto and oAuth2Controller to use message.prope…
Feb 4, 2026
cc53473
feat: updated PasswordNotReused to use message.properties
Feb 4, 2026
e889672
feat: updated PasswordUpdateDto to use message.properties
Feb 4, 2026
d88bda6
feat: updated SignUpDto to use message.properties
Feb 4, 2026
82f363a
feat: updated CorsConfigurationValidator to use message.properties
Feb 4, 2026
03c6c46
feat: updated CustomAccessDeniedHandler to use message.properties
Feb 4, 2026
f0cff08
feat: updated JwtAuthFilter to use message.properties
Feb 4, 2026
ed8b579
feat: merge develop
Feb 4, 2026
f487c96
feat: resolved merge conflict
Feb 4, 2026
3fedc99
feat: updated UserAuthentificationEntryPoint to use message.properties
Feb 4, 2026
cec9b28
feat: updated UserController to use message.properties
Feb 4, 2026
117c08a
feat: updated UserService to use message.properties
Feb 4, 2026
442b289
feat: updated GlobalExceptionHandler to use message.properties
Feb 4, 2026
2b3058d
feat: updated AuthControllerIntegrationTest to use message.properties
Feb 4, 2026
5db6045
feat: updated CustomAccessDeniedHandlerTest to use message.properties
Feb 4, 2026
d4222fb
feat: updated UserControllerIntegrationTest to use message.properties
Feb 4, 2026
c17fc24
feat: message normalisation
Feb 4, 2026
357fb93
docs: global comments update
Feb 4, 2026
0eb01a1
docs: REST doc Update
Feb 4, 2026
dcd5158
docs: process doc Update
Feb 4, 2026
ea59744
localisation: add a LocaleConfig file to define french as the default…
DidierViret Feb 4, 2026
1d9558f
doc(config): add comments in LocaleConfig file
DidierViret Feb 4, 2026
3606828
feat: removed dto custom validation messages and adapted tests
Feb 9, 2026
e71dcb5
feat: removed custom messages from credentialsdto
KenCacciabueOrif Feb 17, 2026
b1a36f3
feat: moved message localisation out of app folder
KenCacciabueOrif Feb 18, 2026
99344d1
feat: simplified ErrorMessageResolver
KenCacciabueOrif Feb 18, 2026
61cafd0
docs: Added comments
KenCacciabueOrif Feb 18, 2026
4cd4a5c
feat: switched to interface solution and code simplification
Feb 18, 2026
649151f
feat: switched to interface solution and code simplification
Feb 18, 2026
3c40eb7
feat: splite messages in folders per packages
KenCacciabueOrif Feb 25, 2026
bb76349
feat: removed message/fielderrors redundency
KenCacciabueOrif Feb 25, 2026
b04ce92
rollback(frontend): keep the possibility to have a message contained …
DidierViret Feb 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
859 changes: 390 additions & 469 deletions docs/index.html

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions docs/process-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- [1.5 Main Java Modules (`main/java`)](#15-main-java-modules-mainjava)
- [1.6 Security Module (`main/java/security`)](#16-security-module-mainjavasecurity)
- [1.7 Auth Module (`main/java/auth`)](#17-auth-module-mainjavaauth)
- [1.8 Users Module (`main/java/users`)](#18-users-module-mainjavausers)
- [1.8 Users Module (`main/java/user`)](#18-users-module-mainjavauser)
- [1.9 Configuration Module (`main/java/config`)](#19-configuration-module-mainjavaconfig)
- [1.10 Error and Exception Management (`main/java/app`)](#110-error-and-exception-management-mainjavaapp)
- [1.11 Test Structure (`test/java`)](#111-test-structure-testjava)
Expand Down Expand Up @@ -81,7 +81,7 @@ graph TD
**Tools & Dependencies:**

- **Java / OpenJDK:** 21
- **Spring Boot:** 3.3.5
- **Spring Boot:** 3.5.8
- **Maven:** 3.9+
- **MariaDB:** 11.4
- **Docker Desktop:** Latest
Expand All @@ -91,9 +91,9 @@ graph TD
- **Spring Security:** Authentication and authorization framework
- **Spring Data JPA:** Database access and ORM
- **Spring OAuth2 Client:** Microsoft Entra ID (Azure AD) integration
- **Auth0 Java-JWT (4.3.0):** JWT token generation and validation
- **MapStruct (1.5.5):** Java bean mappings and DTO conversions
- **Lombok (1.18.36):** Reduces boilerplate code
- **Auth0 Java-JWT (4.4.0):** JWT token generation and validation
- **MapStruct (1.6.3):** Java bean mappings and DTO conversions
- **Lombok (1.18.38):** Reduces boilerplate code
- **Spring REST Docs (3.0.1):** API documentation generation
- **Jakarta Validation:** Bean validation and custom constraints
- **Dotenv Java:** Environment variable management
Expand Down Expand Up @@ -153,7 +153,7 @@ Contains test classes for unit and integration tests.
| `app` | Global error and exception handling used throughout the application. |
| `auth` | Handles authorization processes such as login and registration. |
| `security` | Security-related classes: JWT filters, password encoding, and authentication management. |
| `users` | Manages user profiles, roles, and permissions. |
| `user` | Manages user profiles, roles, and permissions. |
| `AuthApplication.java` | Main Spring Boot entry point containing the `main()` method. Run the project from this class. |

---
Expand Down Expand Up @@ -189,7 +189,7 @@ sequenceDiagram
alt Public endpoint
Controller->>Client: Return HTTP response
else Protected endpoint
Controller-->>Client: 403 Forbidden (Access Denied)
Controller-->>Client: 401 Unauthorized (Missing or invalid authentication token)
end
end
```
Expand Down Expand Up @@ -246,10 +246,10 @@ sequenceDiagram
AuthController->>Client: 200 OK with UserDto + tokens
else Password invalid
PasswordEncoder->>UserService: false
UserService-->>Client: 401 Unauthorized (Invalid credentials)
UserService-->>Client: 401 Unauthorized (error.authorisation.invalid.credentials)
end
else User not found
UserRepository-->>Client: 401 Unauthorized (Invalid credentials)
UserRepository-->>Client: 401 Unauthorized (error.authorisation.invalid.credentials)
end
```

Expand Down Expand Up @@ -309,7 +309,7 @@ _Sequence Diagram showing the logout flow and token invalidation._

---

### 1.8 Users Module (`main/java/users`)
### 1.8 Users Module (`main/java/user`)

```mermaid
classDiagram
Expand Down Expand Up @@ -380,7 +380,7 @@ classDiagram
+List<String> permissions = new ArrayList<>()
}

class SignupDto {
class SignUpDto {
<<DTO>>
+String firstName
+String lastName
Expand All @@ -393,7 +393,7 @@ classDiagram
class UserMapper {
<<interface / singleton>>
+UserDto toUserDto(User user)
+User signUpToUser(SignupDto signupDto)
+User signUpToUser(SignUpDto signUpDto)
+List<String> authoritiesToPermissions(Collection<GrantedAuthority> authorities)
}

Expand All @@ -406,7 +406,7 @@ classDiagram
RoleEnum --> "0..*" PermissionEnum : defines
UserMapper ..> User : uses
UserMapper ..> UserDto : creates
UserMapper ..> SignupDto : uses
UserMapper ..> SignUpDto : uses
User ..|> UserDetails
```

Expand Down Expand Up @@ -445,7 +445,7 @@ sequenceDiagram
UserService->>UserMapper: toUserDto(user)
UserMapper-->>UserService: UserDto
UserService-->>UserController: UserDto
UserController-->>Client: ResponseEntity("User promoted to manager successfully")
UserController-->>Client: ResponseEntity(message.user.promoted.manager)
```

_Sequence Diagram showing an example of the user management flow._
Expand Down Expand Up @@ -699,7 +699,7 @@ Example claims that can be extracted from the Azure token:
| ------ | -------------------- | ------------- | ---------------------------------------------- |
| POST | `/auth/login` | No | Authenticate user and receive JWT tokens |
| POST | `/auth/register` | No | Register a new user account |
| POST | `/auth/refresh` | Yes | Refresh access token using refresh token |
| POST | `/auth/refresh` | No | Refresh access token using refresh token |
| PUT | `/auth/update-password` | Yes | Update current user's password |
| POST | `/auth/logout` | Yes | Logout and invalidate refresh tokens |

Expand All @@ -708,7 +708,7 @@ Example claims that can be extracted from the Azure token:
| Method | Endpoint | Auth Required | Description |
| ------ | ------------------------------ | ------------- | ---------------------------------------- |
| GET | `/oauth2/authorization/azure` | No | Redirect to Microsoft login page |
| GET | `/oauth2/success` | No | Callback endpoint after Azure login |
| GET | `/oauth2/success` | Yes | Callback endpoint after Azure login |

### 2.3 User Management Endpoints (`/users`)

Expand Down
61 changes: 11 additions & 50 deletions src/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ include::auth/logout-expired-token/http-response.adoc[]

It returns a 401 Unauthorized error indicating that the token has expired.

=== 1.5 Set Password
=== 1.5 Update Password
This is an example output for the `PUT /auth/update-password` endpoint.

.request
Expand All @@ -404,7 +404,7 @@ include::auth/update-password/http-request.adoc[]
.response
include::auth/update-password/http-response.adoc[]

It sets a password for a user account using a token.
It updates the password for the authenticated user.

==== 1.5.1 Error Response - 400 - Bad Request
These are example outputs for the `PUT /auth/update-password` endpoint for bad request.
Expand Down Expand Up @@ -434,45 +434,6 @@ include::auth/update-password-missing-token/http-response.adoc[]

It returns a 401 Unauthorized error indicating that full authentication is required.

=== 1.6 Update Password
This is an example output for the `PUT /auth/update-password` endpoint.

.request
include::auth/update-password/http-request.adoc[]

.response
include::auth/update-password/http-response.adoc[]

It sets a new password for the authenticated user.

==== 1.6.1 Error Response - 400 - Bad Request
These are example outputs for the `PUT /auth/update-password` endpoint for bad request.

===== 1.6.1.1 Missing Body
This is an example output when the request body is missing.

.request
include::auth/update-password-missing-body/http-request.adoc[]

.response
include::auth/update-password-missing-body/http-response.adoc[]

It returns a 400 Bad Request error indicating that the request body is missing.

==== 1.6.2 Error Response - 401 - Unauthorised
These are example outputs for the `PUT /auth/update-password` endpoint for unauthorized access.

===== 1.6.2.1 Missing Token
This is an example output when the request token is missing.

.request
include::auth/update-password-missing-token/http-request.adoc[]

.response
include::auth/update-password-missing-token/http-response.adoc[]

It returns a 401 Unauthorized error indicating that full authentication is required.

== 2 User Endpoints

=== 2.1 Get Authenticated User
Expand Down Expand Up @@ -603,7 +564,7 @@ It promotes a user to the "MANAGER" role.
==== 2.5.1 Error Response - 401 - Unauthorized
These are example outputs for the `PUT /users/{userId}/promote-manager` endpoint for unauthorized access.

===== 2.3.1.1 Missing Authorization Header
===== 2.5.1.1 Missing Authorization Header
This is an example output when the Authorization header is missing in the request.

.request
Expand All @@ -614,7 +575,7 @@ include::users/promote-manager-missing-authorization/http-response.adoc[]

It returns a 401 Unauthorized error indicating that full authentication is required.

===== 2.3.1.2 Malformed Token
===== 2.5.1.2 Malformed Token
This is an example output when the token provided is malformed.

.request
Expand All @@ -625,10 +586,10 @@ include::users/promote-manager-malformed-token/http-response.adoc[]

It returns a 401 Unauthorized error indicating that the token is invalid.

==== 2.3.2 Error Response - 403 - Forbidden
==== 2.5.2 Error Response - 403 - Forbidden
These are example outputs for the `PUT /users/{userId}/promote-manager` endpoint for forbidden access.

===== 2.3.2.1 Non-Admin User - Promote User to Manager
===== 2.5.2.1 Non-Admin User - Promote User to Manager
This is an example output when a non-admin user attempts to promote a user to manager.

.request
Expand All @@ -639,10 +600,10 @@ include::users/promote-manager-non-admin/http-response.adoc[]

It returns a 403 Forbidden error indicating that access is denied.

==== 2.3.3 Error Response - 404 - Not Found
==== 2.5.3 Error Response - 404 - Not Found
These are example outputs for the `PUT /users/{userId}/promote-manager` endpoint for not found errors.

===== 2.3.3.1 User Not Found
===== 2.5.3.1 User Not Found
This is an example output when the user to be promoted is not found.

.request
Expand All @@ -653,10 +614,10 @@ include::users/promote-manager-user-not-found/http-response.adoc[]

It returns a 404 Not Found error indicating that the user was not found.

==== 2.3.4 Error Response - 409 - Conflict
==== 2.5.4 Error Response - 409 - Conflict
These are example outputs for the `PUT /users/{userId}/promote-manager` endpoint for conflict errors.

===== 2.3.4.1 User Already Manager
===== 2.5.4.1 User Already Manager
This is an example output when the user to be promoted is already a manager.

.request
Expand All @@ -667,7 +628,7 @@ include::users/promote-manager-user-already-manager/http-response.adoc[]

It returns a 409 Conflict error indicating that the user is already a manager.

===== 2.3.4.2 User Already Admin
===== 2.5.4.2 User Already Admin
This is an example output when the user to be promoted is already an admin.

.request
Expand Down
Loading