From 6a104edebf2290ce10f8cc1810363d0533cd50ea Mon Sep 17 00:00:00 2001 From: Alexis Leboeuf Date: Mon, 12 Jan 2026 09:28:43 +0100 Subject: [PATCH 1/3] Removed debug logs --- .../src/main/java/hackathon/FrisbYEE/rest/AthleteResource.java | 1 - front_end/src/requetes.tsx | 2 -- 2 files changed, 3 deletions(-) diff --git a/back_end/src/main/java/hackathon/FrisbYEE/rest/AthleteResource.java b/back_end/src/main/java/hackathon/FrisbYEE/rest/AthleteResource.java index 4a8bc74..86238b2 100644 --- a/back_end/src/main/java/hackathon/FrisbYEE/rest/AthleteResource.java +++ b/back_end/src/main/java/hackathon/FrisbYEE/rest/AthleteResource.java @@ -110,7 +110,6 @@ public class AthleteResource { athlete.setName(dto.getName()); athlete.setCategorie(dto.getCategorie()); athlete.setNiveau(dto.getNiveau()); - // Relationship: sessionId → session if (dto.getSessionIds() != null) { List sessions = new ArrayList<>(); diff --git a/front_end/src/requetes.tsx b/front_end/src/requetes.tsx index 16a03b0..5c94ae0 100644 --- a/front_end/src/requetes.tsx +++ b/front_end/src/requetes.tsx @@ -27,8 +27,6 @@ export async function loginOrRegister(keycloak:Keycloak): Promise{ newAdmin.email = keycloak.tokenParsed.email || ""; newAdmin.nom = keycloak.tokenParsed.family_name || ""; newAdmin.prenom = keycloak.tokenParsed.given_name || ""; - console.log(newAdmin.keycloakId); - console.log(newAdmin.toDTO().id_keycloak); const response = await adminService.create(newAdmin.toDTO()); const admin = new Admin(response.data); return admin; From e4dd334832154d7534b82ba773d669661bd959e5 Mon Sep 17 00:00:00 2001 From: Alexis Leboeuf Date: Mon, 12 Jan 2026 14:04:57 +0100 Subject: [PATCH 2/3] Changed permission management to a safer one --- .../java/hackathon/FrisbYEE/config/WebSecurityConfig.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/back_end/src/main/java/hackathon/FrisbYEE/config/WebSecurityConfig.java b/back_end/src/main/java/hackathon/FrisbYEE/config/WebSecurityConfig.java index 5c028d5..bc80105 100644 --- a/back_end/src/main/java/hackathon/FrisbYEE/config/WebSecurityConfig.java +++ b/back_end/src/main/java/hackathon/FrisbYEE/config/WebSecurityConfig.java @@ -30,11 +30,9 @@ public class WebSecurityConfig { .requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() // 2. Allow public endpoints BEFORE any authenticated() calls .requestMatchers("/athlete/create", "/", "/public").permitAll() - .requestMatchers("/coach/**").permitAll() - // 3. Authenticated endpoints - .requestMatchers("/users/sync").authenticated() + .requestMatchers("/coach/**").hasRole("coach") .requestMatchers("/admin/**").hasRole("admin") - .requestMatchers("/user/**").hasRole("user") + .requestMatchers("/athlete/**").hasRole("athlete") .anyRequest().authenticated()) .oauth2ResourceServer(oauth2 -> oauth2 .jwt(jwt -> jwt.jwtAuthenticationConverter(jwtToken -> { From bbd33a7ea2bcecf82c668e9a7d54460c54241dfb Mon Sep 17 00:00:00 2001 From: Alexis Leboeuf Date: Mon, 12 Jan 2026 14:05:10 +0100 Subject: [PATCH 3/3] Added class diagram --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/README.md b/README.md index 9b39a70..dbf1b75 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,70 @@ SELECT * FROM session; Sur la console Keycloak aller dans realm setting -> Changer le display name (par exemple: Bienvenue sur Frisbyee !) -> Theme puis changer le login theme sur frisbyee + +## Domain model class diagram + +```mermaid +classDiagram + %% Classes and attributes (inferred from metier package) + class User { + +Long id + +String keycloakId + +String email + +String nom + +String prenom + +Role role + } + + class Athlete { + +String categorie + +String niveau + +List groupe + +List sessions + } + + %% Represente en enum + class Role { + +String role + } + + class Coach { + +List sessions + } + + class Admin { + } + + class Activite { + +Long id + +String nom + +String theme + +String description + +Integer dureeMinutes + +List activites + +Session session + } + + class Session { + +Long id + +String name + +LocalDateTime creneau + +Integer duree + +String group + +bool isRecurrent + +Coach coach + +List athletes + } + + %% Inheritance (if User is a base class for domain actors) + User <|-- Athlete + User <|-- Coach + User <|-- Admin + + %% Associations with cardinality + Coach "1" -- "0..*" Session : manages + Role "1" -- "0..*" User : is + Session "0..*" -- "0..*" Activite : contains + Session "0..*" -- "0..*" Athlete : participants + Activite "0..*" -- "0..*" Session : usedIn +```