]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix(simulator)!: reject supervision URLs whose scheme the ws client cannot dial ...
authorVitor Coelho <6161176+VitorCoelho@users.noreply.github.com>
Tue, 27 Oct 2026 20:39:54 +0000 (20:39 +0000)
committerGitHub <noreply@github.com>
Tue, 27 Oct 2026 20:39:54 +0000 (20:39 +0000)
commit4224a9349e1345f4d4a3348eab064c6970db96e4
tree0661c6854bcd3135966ea7770dab73f87e313d04
parenta0e5f1e2083bc4bcbe87ec4e0f32564a950bdeb2
fix(simulator)!: reject supervision URLs whose scheme the ws client cannot dial (#2160)

* Refactor supervisionUrls to use SupervisionUrlSchema

Updated supervisionUrls to use SupervisionUrlSchema for validation.

* Add SupervisionUrlSchema to index export

* fix(ui-server): validate the supervision URL scheme at the UI request gate

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* Add test for rejecting invalid supervision URLs

* test(utils): assert the supervision URL schemes match the ws client

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* docs(readme): document the accepted supervisionUrls schemes

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* fix(simulator)!: bump the configuration schema version to 2

v2 narrows `supervisionUrls` to URLs whose scheme the ws client can
dial. The v1 to v2 migration is a pass-through: values outside that set
cannot be rewritten automatically and are reported by schema validation.

BREAKING CHANGE: a configuration file whose `supervisionUrls` uses a
scheme the ws client cannot dial now fails validation at startup instead
of failing on each connection attempt.

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* chore(config): stamp the configuration template with schema version 2

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* test(utils): cover the v1 to v2 configuration migration

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* test(utils): cover v1 configurations under schema version 2

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* docs(readme): document configuration schema version 2

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* fix(simulator): reject supervision URLs with a fragment or an empty ws+unix socket path

The ws client throws for a URL with a fragment identifier and for a
ws+unix URL without a pathname, so these values passed the gate and failed
per station at connection time. Reject them in SupervisionUrlSchema.

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
* test(utils): cover fragments and ws+unix socket paths in the supervision URL schema

Add a fragment URL and ws+unix URLs without a socket path to the ws
parity test, together with a ws+unix URL with a request path and a
hostless network URL, which the ws client dials.

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
---------

Signed-off-by: VitorCoelho <vitorc195@gmail.com>
Co-authored-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
README.md
src/assets/config-template.json
src/charging-station/ui-server/ui-services/UIServiceRequestPayloadSchemas.ts
src/utils/ConfigurationMigrations.ts
src/utils/ConfigurationSchema.ts
src/utils/index.ts
tests/charging-station/ui-server/ui-services/UIServiceRequestPayloadSchemas.test.ts
tests/utils/ConfigurationMigrations.test.ts
tests/utils/ConfigurationSchema.test.ts
tests/utils/ConfigurationValidation.test.ts