ci: docker_tag=ext chore(back): v1.0.5 token claims + validation profile_idn
All checks were successful
build-and-push-ext / build_push (push) Successful in 23s

This commit is contained in:
dev4 2025-09-19 08:17:39 +00:00
parent 6a0c1ce817
commit 58f2dfab52
3 changed files with 20 additions and 2 deletions

View File

@ -36,3 +36,8 @@
- `getUserData`
- `getOfficeLocationData`
- Objectif: faciliter le diagnostic des environnements et des bases URL.
## v1.0.5
- IdNot: logs supplémentaires des claims du token (`sub`, `entity_idn`, `profile_idn`) et contrôle explicite de `profile_idn`.
- Effet: en cas dabsence de `profile_idn`, retour 400 (ValidationError) au lieu dun 502.

View File

@ -1,6 +1,6 @@
{
"name": "lecoffre-back-mini",
"version": "1.0.4",
"version": "1.0.5",
"description": "Mini serveur avec une route /api/ping",
"main": "dist/server.js",
"scripts": {

View File

@ -101,6 +101,19 @@ export class IdNotController {
// Decode JWT payload
const payload = JSON.parse(Buffer.from(jwt.split('.') [1], 'base64').toString('utf8'));
// Log non-sensible claims for diagnostics
Logger.info('IdNot token payload summary', {
keys: Object.keys(payload || {}),
sub: payload?.sub,
entity_idn: payload?.entity_idn,
profile_idn: payload?.profile_idn
});
// Validate essential claim
if (!payload?.profile_idn || typeof payload.profile_idn !== 'string') {
throw new ValidationError('Missing profile_idn in IdNot token');
}
// Get user data
const userData = await IdNotService.getUserData(payload.profile_idn);