]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(auth): remove getAuthCache from interfaces, own cache in service
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Mar 2026 21:26:14 +0000 (23:26 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Mar 2026 21:26:14 +0000 (23:26 +0200)
commit84e3bf98278265eee72f7a040bd8126ad95a76af
treed2cbbe987f2f6c6e8516ab5bf3936c23ce0b8772
parentaa6aae57f59e8d89bb4f50d15ba0445162b616f6
refactor(auth): remove getAuthCache from interfaces, own cache in service

Remove getAuthCache() from AuthStrategy and OCPPAuthService interfaces.
Store authCache directly as private field on OCPPAuthServiceImpl during
initializeStrategies(), eliminating indirect access through LocalAuthStrategy
for clearCache, invalidateCache, and updateCacheEntry operations.

Add getTestAuthCache() helper to MockFactories to encapsulate cache
access in tests. Harmonize all test files to use the shared helper
instead of ad-hoc cast chains. Fix broken OCPPAuthIntegrationTest
references and extract KNOWN_STRATEGIES constant.
12 files changed:
src/charging-station/ocpp/auth/interfaces/OCPPAuthService.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/1.6/OCPP16ServiceUtils.test.ts
tests/charging-station/ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-AuthCache.test.ts
tests/charging-station/ocpp/auth/OCPPAuthIntegration.test.ts
tests/charging-station/ocpp/auth/helpers/MockFactories.ts
tests/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.test.ts
tests/helpers/OCPPAuthIntegrationTest.ts
tests/ocpp2-e2e-test-plan.md [new file with mode: 0644]