]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
feat(ocpp2): fix authorization conformance gaps (C10, C12, C01, C09) (#1735)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 18 Mar 2026 10:44:58 +0000 (11:44 +0100)
committerGitHub <noreply@github.com>
Wed, 18 Mar 2026 10:44:58 +0000 (11:44 +0100)
commitcde7fa6344684107572c35d6de64737bdd1a4ad2
treea5cb40dd6168a93b9b7752279b9a10a23b576e7a
parentd6b14669baad1e0d86136e60d877122ae61b93f1
feat(ocpp2): fix authorization conformance gaps (C10, C12, C01, C09) (#1735)

* feat(ocpp2): auto-update auth cache on TransactionEventResponse (C10.FR.01/04/05, C12.FR.06)

* feat(ocpp2): check MasterPassGroupId in start transaction (C12.FR.09)

* feat(ocpp2): add groupId-based stop transaction authorization (C01.FR.03, C09.FR.03/07)

* fix(ocpp2): address PR review findings

- C12.FR.09: compare groupIdToken not idToken
- C09.FR.03: remove inner isIdTokenAuthorized check
- Guard updateCacheEntry on authorizationCacheEnabled
- Fix MasterPass test to mock VariableManager

* style(tests): align test naming with style guide

* fix: merge duplicate AuthTypes.js imports in auth barrel

* fix(tests): add required JSDoc to GroupIdStop test helper

* style(ocpp2): harmonize log levels, remove spec refs from log messages, use truncateId

* style(auth): harmonize log prefixes, levels, and identifier truncation

* refactor(auth): use moduleName constant for log prefixes in OCPPAuthServiceImpl

* refactor(auth): use moduleName constant across all auth files

* fix(tests): skip flaky RequestStopTransaction test on all Node 22 platforms

* refactor(auth): harmonize log prefixes in auth adapters

* refactor: move truncateId to utils and truncate identifiers in OCPP20 logs

* style(ocpp2): remove spec ref from statusInfo additionalInfo

* style(ocpp2): truncate idToken in statusInfo additionalInfo

* test(ocpp2): improve test coverage and remove duplicates in auth conformance tests
25 files changed:
src/charging-station/Helpers.ts
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
src/charging-station/ocpp/2.0/OCPP20ResponseService.ts
src/charging-station/ocpp/2.0/__testable__/index.ts
src/charging-station/ocpp/auth/adapters/OCPP16AuthAdapter.ts
src/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.ts
src/charging-station/ocpp/auth/cache/InMemoryAuthCache.ts
src/charging-station/ocpp/auth/index.ts
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/LocalAuthStrategy.ts
src/charging-station/ocpp/auth/strategies/RemoteAuthStrategy.ts
src/charging-station/ocpp/auth/types/AuthTypes.ts
src/charging-station/ocpp/auth/utils/ConfigValidator.ts
src/types/ConnectorStatus.ts
src/utils/Utils.ts
src/utils/index.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GroupIdStop.test.ts [new file with mode: 0644]
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-MasterPass.test.ts [new file with mode: 0644]
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RequestStopTransaction.test.ts
tests/charging-station/ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts [new file with mode: 0644]
tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts
tests/charging-station/ocpp/auth/cache/InMemoryAuthCache.test.ts
tests/charging-station/ocpp/auth/strategies/LocalAuthStrategy-DisablePostAuthorize.test.ts [new file with mode: 0644]