]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(auth): replace adapter Map with single adapter per station
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 21 Mar 2026 18:01:48 +0000 (19:01 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 21 Mar 2026 18:01:48 +0000 (19:01 +0100)
commit7021e25c37ec7e337bc4222d062124247d75d882
tree673e5e464385bb27db85582d888980c9485cca74
parent382bd67c4afeed8d49dcb18d70123ad2048e9996
refactor(auth): replace adapter Map with single adapter per station

Each charging station has exactly one OCPP version, making the
Map<OCPPVersion, OCPPAuthAdapter> unnecessary indirection. Simplify
to a single adapter field across the auth module.

- AuthComponentFactory: createAdapter() returns single OCPPAuthAdapter
- RemoteAuthStrategy: setAdapter()/clearAdapter() replace map ops
- CertificateAuthStrategy: readonly adapter field, no map
- OCPPAuthServiceImpl: single adapter, initializeAdapter() singular
- Tests updated to match new single-adapter API
src/charging-station/ocpp/auth/factories/AuthComponentFactory.ts
src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts
src/charging-station/ocpp/auth/strategies/CertificateAuthStrategy.ts
src/charging-station/ocpp/auth/strategies/RemoteAuthStrategy.ts
tests/charging-station/ocpp/auth/factories/AuthComponentFactory.test.ts
tests/charging-station/ocpp/auth/strategies/CertificateAuthStrategy.test.ts
tests/charging-station/ocpp/auth/strategies/RemoteAuthStrategy.test.ts