ci: docker_tag=ext chore(back): log analyse IdNot (rattachement)
All checks were successful
build-and-push-ext / build_push (push) Successful in 15s
All checks were successful
build-and-push-ext / build_push (push) Successful in 15s
This commit is contained in:
parent
723b532c64
commit
8c8b9ce7d6
@ -21,3 +21,7 @@
|
|||||||
- Laisse désormais passer toute erreur avec `statusCode` 4xx même si l’instance n’est pas exactement celle des classes locales.
|
- Laisse désormais passer toute erreur avec `statusCode` 4xx même si l’instance n’est pas exactement celle des classes locales.
|
||||||
- Fallback sur `name` (BusinessRuleError, ForbiddenError, UnauthorizedError, ValidationError) pour tolérer les divergences d’instances.
|
- Fallback sur `name` (BusinessRuleError, ForbiddenError, UnauthorizedError, ValidationError) pour tolérer les divergences d’instances.
|
||||||
- Objectif: éviter les 502 lorsqu’un cas fonctionnel (ex: utilisateur non rattaché) survient, et renvoyer le bon 4xx.
|
- Objectif: éviter les 502 lorsqu’un cas fonctionnel (ex: utilisateur non rattaché) survient, et renvoyer le bon 4xx.
|
||||||
|
|
||||||
|
### v1.0.3+log
|
||||||
|
|
||||||
|
- Ajout d’un log d’analyse non sensible dans `IdNotController.authenticate` pour tracer: `profile_idn`, `entity_idn`, `entite.typeEntite.name`, `entite.codeCrpcen`, `statutDuRattachement`, `typeLien.name`.
|
||||||
|
@ -36,7 +36,7 @@ Analyse synthétique de `lecoffre-back-mini` (Express + TypeScript).
|
|||||||
- `403`: utilisateur non rattaché à une étude (ForbiddenError)
|
- `403`: utilisateur non rattaché à une étude (ForbiddenError)
|
||||||
- `5xx`: erreurs internes ou partenaires (ExternalServiceError)
|
- `5xx`: erreurs internes ou partenaires (ExternalServiceError)
|
||||||
|
|
||||||
Note: dans `IdNotController.authenticate`, toute erreur possédant un `statusCode` 4xx (ou un `name` applicatif connu) est relancée telle quelle afin d’éviter un fallback en 502.
|
Note: dans `IdNotController.authenticate`, toute erreur possédant un `statusCode` 4xx (ou un `name` applicatif connu) est relancée telle quelle afin d’éviter un fallback en 502.
|
||||||
|
|
||||||
### Dépendances clés
|
### Dépendances clés
|
||||||
- **HTTP**: `express`, `cors`
|
- **HTTP**: `express`, `cors`
|
||||||
|
@ -104,6 +104,16 @@ export class IdNotController {
|
|||||||
// Get user data
|
// Get user data
|
||||||
const userData = await IdNotService.getUserData(payload.profile_idn);
|
const userData = await IdNotService.getUserData(payload.profile_idn);
|
||||||
|
|
||||||
|
// Log d'analyse (non sensible) pour diagnostiquer les cas de rattachement
|
||||||
|
Logger.info('IdNot userData summary', {
|
||||||
|
profile_idn: payload.profile_idn,
|
||||||
|
entity_idn: payload.entity_idn,
|
||||||
|
entiteTypeName: userData?.entite?.typeEntite?.name,
|
||||||
|
entiteCodeCrpcen: userData?.entite?.codeCrpcen,
|
||||||
|
statutDuRattachement: userData?.statutDuRattachement,
|
||||||
|
typeLien: userData?.typeLien?.name
|
||||||
|
});
|
||||||
|
|
||||||
if (!userData || !userData.statutDuRattachement || userData.entite.typeEntite.name !== 'office') {
|
if (!userData || !userData.statutDuRattachement || userData.entite.typeEntite.name !== 'office') {
|
||||||
throw new ForbiddenError('User not attached to an office');
|
throw new ForbiddenError('User not attached to an office');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user