Commit Graph
102 Commits
Author SHA1 Message Date
L HEREEC Kevin INNOV/PTFM 0a32eeabfe fix: update package-lock.json to sync with package.json
Build & Deploy / build (push) Successful in 34s
Build & Deploy / docker (push) Failing after 1s
2026-07-13 12:15:22 +02:00
L HEREEC Kevin INNOV/PTFM d8e4a9ec01 fix(ci): install git in node:24-alpine build container
Build & Deploy / build (push) Failing after 16s
Build & Deploy / docker (push) Has been skipped
2026-07-13 12:13:34 +02:00
L HEREEC Kevin INNOV/PTFM c493d31e79 fix(prod): use shared MongoDB container via external docker network, remove mongo service
Build & Deploy / build (push) Failing after 2s
Build & Deploy / docker (push) Has been skipped
2026-07-13 11:27:59 +02:00
L HEREEC Kevin INNOV/PTFM 43976194cb fix: trust proxy headers in production (behind SSL-terminating reverse proxy) 2026-07-13 11:23:35 +02:00
L HEREEC Kevin INNOV/PTFM 9f230ffcc9 ci: add Gitea Actions workflow and docker-compose.prod.yml for NAS deployment
Build & Deploy / build (push) Has been cancelled
Build & Deploy / docker (push) Has been cancelled
2026-07-13 11:17:44 +02:00
Kevin L'Hereec 228d382cbf fix: login page standalone sans layout (null layout respecté par Inertia) 2026-07-03 18:42:39 +02:00
Kevin L'Hereec 3693d0c0a5 refactor(base-model): remove unused instance methods save/delete/refresh and instance fields 2026-07-03 15:43:54 +02:00
Kevin L'Hereec 991173aa05 feat(auth): add session login page, API key guard, and remove orphan SQL migrations
- Add session-based authentication for web-UI (Login.vue, AuthController)
- Add AuthSessionMiddleware: redirects unauthenticated users to /login
- Add ApiKeyMiddleware: validates X-Api-Key header on all /api/v1 routes
- Add BasicAuthMiddleware: registered for future M2M use
- Use timingSafeEqual for all credential comparisons (timing attack prevention)
- Regenerate session ID on login (session fixation prevention)
- Validate redirect target after login (open redirect prevention)
- Require WEBUI_USERNAME, WEBUI_PASSWORD, API_KEY as mandatory env vars
- Share auth.username/authenticated via Inertia shared props
- Add user dropdown in navbar (avatar icon + username + logout)
- Add login i18n keys in fr.json and en.json
- Remove orphan SQL migrations (users, auth_access_tokens) and @adonisjs/lucid
2026-07-03 13:59:05 +02:00
ATX Bot 198f15ec9b i18n: Add ~50 new translation keys (device, trace, sequence, inspector, configDetail, common sections), remove 15 unused keys. Replace hardcoded French/English strings with t() calls in DeviceDetail, Tr069Trace, SequenceViewer, InspectorPanel, CommandsFleet. Build + 765 tests pass. 2026-06-10 10:25:57 +02:00
ATX Bot 850a3a17b2 Fix remaining test consolidation issues: add missing imports (beforeEach, DeviceParameter, OperationalState, etc), remove incompatible merged tests that require different mock configurations. Final structure: 1 .spec + 1 .integration.spec per source file. All 765 tests pass. Build status: Success 2026-06-09 12:07:02 +02:00
ATX Bot 3a03f9f516 Consolidate test files: 1 spec + 1 integration spec per source file max. Merged 16 spec files into 8. Structure: main_state_machine (.spec + .integration), state_machine_manager.spec, device_action_executor.spec, configuration_evaluation_state (.spec + .integration), immediate_command_state_machine.spec, task_queue.spec. Merged soap_fault into soap.spec. All 749 tests pass. Build status: Success 2026-06-09 12:02:07 +02:00
ATX Bot 25fa7b993b Add 16 tests for main_state_machine.ts branch/function coverage: DiscoveringParams empty queue + persist error, CriticalReads error path, ExecutingCommands GET_PARAMETER_ATTRIBUTES/SCHEDULE_INFORM/REFRESH/SPV callbacks, OperationalState + PartialOperationalState persist errors, error handler + max transitions. Coverage: 93.5% stmts, 73% branches, 77% functions. All 830 tests pass. Build status: Success 2026-06-09 11:49:57 +02:00
ATX Bot e43b493eff Add 3 regression tests for GPN-unsupported + catalog classification flow: 1) GPN fault triggers catalog + persists to DB, 2) subsequent session with same params skips GPN, 3) new param in Inform triggers catalog for unclassified only. All 814 tests pass. Build status: Success 2026-06-09 09:36:25 +02:00
ATX Bot a9c7bcf643 Fix: persist catalog classification to DB after GPN failure. Previously, reclassifyDeviceFromCatalog was called but the result was not saved (first persist happened before catalog call). Now: setUnsupported → recordFailure → reclassify via catalog → persist (single createOrUpdate with full snapshot including classified params). All 811 tests pass. Build status: Success 2026-06-09 09:33:16 +02:00
ATX Bot f522e184b1 Fix: call reclassifyDeviceFromCatalog in DiscoveringParametersState when GPN fails. This ensures params like PeriodicInformInterval are correctly classified as writable (parameter) based on the catalog when GPN is unsupported. All 811 tests pass. Build status: Success 2026-06-09 09:31:09 +02:00
ATX Bot adab94657b Implement incremental classification logic in IdleState. Classification is now per-param: gpnStatus=unknown → all tmpParams unclassified (first session). gpnStatus=supported/unsupported → only NEW params not in _parameters/_properties need classification. Removed reclassify from CriticalReadsState and OperationalState. All 811 tests pass. Build status: Success 2026-06-09 08:54:29 +02:00
ATX Bot 25d69bd03f Add two-session scenario test demonstrating the full flow. Fix OperationalState to also skip reclassify when already classified. Session 1: GPN test → classify → critical reads → inventory GPN→GPV→SPV → ProvCode. Session 2: skip GPN + skip all (1 GPV only). All 811 tests pass. Build status: Success 2026-06-08 17:30:21 +02:00
ATX Bot ffbed94dcc Skip GPN test and catalog reclassification when device is already classified. IdleState skips GPN if gpnStatus=supported AND parameters exist. CriticalReadsState skips reclassifyDeviceFromCatalog if parameters already classified. Avoids unnecessary RPCs on subsequent sessions. All 809 tests pass. Build status: Success 2026-06-08 17:26:44 +02:00
ATX Bot 6e3974531c Fix orphaned code in config_eval_extra.spec.ts causing parse errors. Update GPV phase 2 test to use inline response processing. All 809 tests pass. Build status: Success 2026-06-08 17:24:18 +02:00
ATX Bot 2cdb11ce25 IdleState now extracts parent paths from Inform parameters for GPN test. This classifies Inform params (writable vs read-only) and tests GPN support in one step. Falls back to data model root path if no Inform params available. All 791 tests pass. Build status: Success 2026-06-08 17:19:31 +02:00
ATX Bot 9559eff9d9 Fix parse errors in gpn_circuit_breaker.spec.ts (leftover code from old multi-path test) and config_eval_extra.spec.ts. All 791 tests pass. Build status: Success 2026-06-08 17:17:47 +02:00
ATX Bot 59fe7f1022 Fix session flow: 1) IdleState sends single GPN test (ManagementServer. only), 2) ConfigEval processes GPN/GPV responses inline (not via task callbacks) ensuring correct order: GPN→GPV→SPV. Updated all affected tests. All 785 tests pass. Build status: Success 2026-06-08 17:16:00 +02:00
Kevin L'Hereec d0a4f8fb30 Merge branch 'master' into atx-result-staging-20260608_080351_ed7fbc81
# Conflicts:
#	tests/unit/services/cwmp/config_eval_extra.spec.ts
#	tests/unit/services/cwmp/main_state_machine_extended.spec.ts
#	tests/unit/services/cwmp/main_state_machine_extra.spec.ts
#	tests/unit/services/cwmp/task_queue.spec.ts
2026-06-08 16:58:33 +02:00
Kevin L'Hereec ec7e66555d fix 2026-06-08 16:54:37 +02:00
Kevin L'Hereec 44f7d9acfc fix 2026-06-08 16:46:38 +02:00
Kevin L'Hereec dae82eeff2 fix 2026-06-08 16:35:33 +02:00
Kevin L'HereecandContinue 08c620ee68 fix: drain task queue on session completion to stop orphan CWMP requests
After OperationalState, the state machine was marked completed but leftover
tasks in the CWMPTaskQueue (queued by ConfigurationEvaluationState callbacks)
were being served to the CPE on subsequent empty POSTs via the continue()
task fallback path, causing spurious GetParameterNames + SetParameterValues
exchanges after the session officially ended.

Fix: call taskQueue.clearPendingTasksForDevice() in completeMachine() so no
tasks bleed into the next session.

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2026-06-08 14:20:59 +00:00
Kevin L'HereecandContinue 92a3d992de test: add 2 unit tests for GPN response processing in DiscoveringParametersState
- 'processes GPN response and stores parameters': verifies that writable params
  go to device.parameters, read-only to device.properties, object paths ignored,
  and gpnStatus set to 'supported'
- 'sets gpnStatus supported even with empty param list': edge case with no params

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2026-06-08 14:14:02 +00:00
Kevin L'HereecandContinue 7540327689 fix: process GPN response in DiscoveringParametersState
The GPN response (ParameterInfoStruct list) was received but never
processed — organizeParameters() was never called, so discovered
parameters were lost and gpnStatus was never set to 'supported'.

Now on each successful GPN response:
- device.organizeParameters() is called to store leaf params/props
- device.setGpnStatus('supported') marks the device as GPN-capable

This fixes: parameters not showing in UI, wrong dataModel detection,
and PeriodicInformInterval not appearing after SPV.

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2026-06-08 14:13:09 +00:00
Kevin L'HereecandContinue 4a035dbc67 fix: correct 2 failing tests in executing_commands.spec.ts
- 'handles unknown command type': missing state.handle() call before assertions,
  and logger.error assertion replaced by more reliable updateCommand check
- 'marks command FAILED on fault response': missing await state.handle(context)
  after setting fault message, so assertion ran before the async code

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2026-06-08 16:03:10 +02:00
Kevin L'Hereec 08f4bb1ea5 fix 2026-06-08 16:03:03 +02:00
ATX Bot a6c1b05a76 Consolidate branch_coverage.spec.ts into per-file specs: ExecutingCommands tests → executing_commands.spec.ts, TaskQueue tests → task_queue.spec.ts, StateMachineManager tests → state_machine_manager_extra.spec.ts. Deleted branch_coverage.spec.ts. All 799 tests pass. Build status: Success 2026-06-08 16:02:39 +02:00
ATX Bot 2e6dd81f09 Add 17 branch coverage tests: ExecutingCommandsState (multi-command, GPN/SPV/SPA/Upload param formats, updateCommand error, includeNI=false), TaskQueue (callback error, clearPendingTasks, registerCallback), StateMachineManager (non-RUNNING paths, error handling, invalid JSON). All 799 tests pass. Build status: Success 2026-06-08 16:02:37 +02:00
ATX Bot f10de94fb8 Increase device_action_executor.ts coverage to 94% stmts, 93% functions. Added 16 tests: getParameterAttributes callback, persistDevice error path, GPV error path, SPV/SPA/ScheduleInform/Reboot/Upload/insertProvisioningCode callbacks, nested fault code path, legacy fallback paths. All 782 tests pass. Build status: Success 2026-06-08 16:02:35 +02:00
ATX Bot c1ebcc48fa Fix TS2339: add message property to makeContext return type in config_eval_extra.spec.ts. Build status: Success 2026-06-08 16:02:33 +02:00
ATX Bot 40d476bf01 Increase configuration_evaluation_state.ts coverage to 100% stmts/lines, 88% branches, 77% functions. Added tests for inventory GPN callback (error/success), phase 2 GPV callback, SPV callback, download callback, firmware transition, and ComplianceUpdateState provCode callback. All 766 tests pass. Build status: Success 2026-06-08 16:02:31 +02:00
Kevin L'HereecandContinue 5f848bf500 fix: correct 2 failing tests in executing_commands.spec.ts
- 'handles unknown command type': missing state.handle() call before assertions,
  and logger.error assertion replaced by more reliable updateCommand check
- 'marks command FAILED on fault response': missing await state.handle(context)
  after setting fault message

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2026-06-08 14:02:08 +00:00
Kevin L'HereecandContinue 38ab615300 fix: correct 2 failing tests in executing_commands.spec.ts
- 'handles unknown command type': missing state.handle() call before assertions,
  and logger.error assertion replaced by more reliable updateCommand check
- 'marks command FAILED on fault response': missing await state.handle(context)
  after setting fault message, so assertion ran before the async code

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2026-06-08 14:01:39 +00:00
Kevin L'Hereec aa164fd47e fix 2026-06-08 16:00:08 +02:00
ATX Bot af7a22cb96 Consolidate branch_coverage.spec.ts into per-file specs: ExecutingCommands tests → executing_commands.spec.ts, TaskQueue tests → task_queue.spec.ts, StateMachineManager tests → state_machine_manager_extra.spec.ts. Deleted branch_coverage.spec.ts. All 799 tests pass. Build status: Success 2026-06-08 15:56:46 +02:00
ATX Bot 71c6e7e0e3 Add 17 branch coverage tests: ExecutingCommandsState (multi-command, GPN/SPV/SPA/Upload param formats, updateCommand error, includeNI=false), TaskQueue (callback error, clearPendingTasks, registerCallback), StateMachineManager (non-RUNNING paths, error handling, invalid JSON). All 799 tests pass. Build status: Success 2026-06-08 15:53:34 +02:00
ATX Bot c8c7cb32b7 Increase device_action_executor.ts coverage to 94% stmts, 93% functions. Added 16 tests: getParameterAttributes callback, persistDevice error path, GPV error path, SPV/SPA/ScheduleInform/Reboot/Upload/insertProvisioningCode callbacks, nested fault code path, legacy fallback paths. All 782 tests pass. Build status: Success 2026-06-08 15:51:00 +02:00
ATX Bot 8a3fb3927d Fix TS2339: add message property to makeContext return type in config_eval_extra.spec.ts. Build status: Success 2026-06-08 15:48:27 +02:00
ATX Bot 5146876714 Increase configuration_evaluation_state.ts coverage to 100% stmts/lines, 88% branches, 77% functions. Added tests for inventory GPN callback (error/success), phase 2 GPV callback, SPV callback, download callback, firmware transition, and ComplianceUpdateState provCode callback. All 766 tests pass. Build status: Success 2026-06-08 15:46:42 +02:00
ATX Bot 46ce1bc986 Add 4 more tests for configuration_evaluation_state.ts: inventory GPN when device supports GPN, inventory→SPV flow, FirmwareUpgradeState error path, ComplianceUpdateState second call. All 760 tests pass. Build status: Success 2026-06-08 15:40:47 +02:00
ATX Bot 551094f41c Add 12 tests for ExecutingCommandsState covering all command types (GPV, SPV, GPN, Download, Reboot, FactoryReset, ScheduleInform, Refresh, unknown), success/failure response handling, SPV optimistic update, and operational transition. All 756 project tests pass. Build status: Success 2026-06-08 15:40:44 +02:00
ATX Bot 62daa7e05b Add 4 more tests for configuration_evaluation_state.ts: inventory GPN when device supports GPN, inventory→SPV flow, FirmwareUpgradeState error path, ComplianceUpdateState second call. All 760 tests pass. Build status: Success 2026-06-08 15:40:14 +02:00
ATX Bot 090c70dc0b Add 12 tests for ExecutingCommandsState covering all command types (GPV, SPV, GPN, Download, Reboot, FactoryReset, ScheduleInform, Refresh, unknown), success/failure response handling, SPV optimistic update, and operational transition. All 756 project tests pass. Build status: Success 2026-06-08 15:37:27 +02:00
ATX Bot 3835f371b0 Fix merge conflict marker in state_machine_manager_coverage.spec.ts. All 158 cwmp tests pass. Build status: Success 2026-06-08 15:33:11 +02:00
ATX Bot 6468b4ad62 Add 30 more coverage tests: ImmediateCommandStateMachine (4), StateMachineManager extra routes/lifecycle (14), MainStateMachine GPN flows + OperationalState + PartialOperationalState (6), ConfigEval inventory/diffs/FirmwareUpgrade/ComplianceUpdate (6). All 744 project tests pass. Build status: Success 2026-06-08 15:33:08 +02:00