From de480fa53a7b84436a5a4bfa3b92ba56e531fa19 Mon Sep 17 00:00:00 2001 From: Razvan Grigore Date: Thu, 23 Oct 2025 17:33:34 +0300 Subject: [PATCH 1/4] fix TC_042_1_CS and TC_043_1_CS / local auth list not supported --- .../Model/Authorization/AuthorizationService.cpp | 8 ++++++-- src/MicroOcpp/Model/Authorization/AuthorizationService.h | 1 + src/MicroOcpp/Model/Model.cpp | 2 +- src/MicroOcpp/Operations/GetLocalListVersion.cpp | 4 +++- src/MicroOcpp/Operations/SendLocalList.cpp | 6 ++++++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp b/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp index e9dc39d2..443f0138 100644 --- a/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp +++ b/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp @@ -75,7 +75,7 @@ bool AuthorizationService::loadLists() { } AuthorizationData *AuthorizationService::getLocalAuthorization(const char *idTag) { - if (!localAuthListEnabledBool->getBool()) { + if (!localAuthListEnabled()) { return nullptr; //auth cache will follow } @@ -101,6 +101,10 @@ size_t AuthorizationService::getLocalListSize() { return localAuthorizationList.size(); } +bool AuthorizationService::localAuthListEnabled() const { + return localAuthListEnabledBool && localAuthListEnabledBool->getBool(); +} + bool AuthorizationService::updateLocalList(JsonArray localAuthorizationListJson, int listVersion, bool differential) { bool success = localAuthorizationList.readJson(localAuthorizationListJson, listVersion, differential, false); @@ -127,7 +131,7 @@ bool AuthorizationService::updateLocalList(JsonArray localAuthorizationListJson, void AuthorizationService::notifyAuthorization(const char *idTag, JsonObject idTagInfo) { //check local list conflicts. In future: also update authorization cache - if (!localAuthListEnabledBool->getBool()) { + if (!localAuthListEnabled()) { return; //auth cache will follow } diff --git a/src/MicroOcpp/Model/Authorization/AuthorizationService.h b/src/MicroOcpp/Model/Authorization/AuthorizationService.h index 88ba7936..536bba1f 100644 --- a/src/MicroOcpp/Model/Authorization/AuthorizationService.h +++ b/src/MicroOcpp/Model/Authorization/AuthorizationService.h @@ -35,6 +35,7 @@ class AuthorizationService : public MemoryManaged { AuthorizationData *getLocalAuthorization(const char *idTag); int getLocalListVersion(); + bool localAuthListEnabled() const; size_t getLocalListSize(); //number of entries in current localAuthList; used in unit tests bool updateLocalList(JsonArray localAuthorizationListJson, int listVersion, bool differential); diff --git a/src/MicroOcpp/Model/Model.cpp b/src/MicroOcpp/Model/Model.cpp index f2e19c1e..fe59568f 100644 --- a/src/MicroOcpp/Model/Model.cpp +++ b/src/MicroOcpp/Model/Model.cpp @@ -317,7 +317,7 @@ void Model::updateSupportedStandardProfiles() { } #if MO_ENABLE_LOCAL_AUTH - if (authorizationService) { + if (authorizationService && authorizationService->localAuthListEnabled()) { if (!strstr(supportedFeatureProfilesString->getString(), "LocalAuthListManagement")) { if (!buf.empty()) buf += ','; buf += "LocalAuthListManagement"; diff --git a/src/MicroOcpp/Operations/GetLocalListVersion.cpp b/src/MicroOcpp/Operations/GetLocalListVersion.cpp index f2c8a058..4c2d4688 100644 --- a/src/MicroOcpp/Operations/GetLocalListVersion.cpp +++ b/src/MicroOcpp/Operations/GetLocalListVersion.cpp @@ -30,9 +30,11 @@ std::unique_ptr GetLocalListVersion::createConf(){ auto doc = makeJsonDoc(getMemoryTag(), JSON_OBJECT_SIZE(1)); JsonObject payload = doc->to(); - if (auto authService = model.getAuthorizationService()) { + auto authService = model.getAuthorizationService(); + if (authService && authService->localAuthListEnabled()) { payload["listVersion"] = authService->getLocalListVersion(); } else { + //TC_042_1_CS Get Local List Version (not supported) payload["listVersion"] = -1; } return doc; diff --git a/src/MicroOcpp/Operations/SendLocalList.cpp b/src/MicroOcpp/Operations/SendLocalList.cpp index 45f0dfbe..29890024 100644 --- a/src/MicroOcpp/Operations/SendLocalList.cpp +++ b/src/MicroOcpp/Operations/SendLocalList.cpp @@ -27,6 +27,12 @@ const char* SendLocalList::getOperationType(){ void SendLocalList::processReq(JsonObject payload) { + //TC_043_1_CS Send Local Authorization List - NotSupported + if (!authService.localAuthListEnabled()) { + errorCode = "NotSupported"; + return; + } + if (!payload.containsKey("listVersion") || !payload.containsKey("updateType")) { errorCode = "FormationViolation"; return; From 36ce12b846aa224a35334768d3684377d4556282 Mon Sep 17 00:00:00 2001 From: Razvan Grigore Date: Sun, 9 Nov 2025 18:01:52 +0200 Subject: [PATCH 2/4] add hint on how to pass TC_043_3_CS-Send Local Authorization List - Failed --- src/MicroOcpp/Model/Authorization/AuthorizationService.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp b/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp index 443f0138..86692dee 100644 --- a/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp +++ b/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp @@ -106,6 +106,9 @@ bool AuthorizationService::localAuthListEnabled() const { } bool AuthorizationService::updateLocalList(JsonArray localAuthorizationListJson, int listVersion, bool differential) { + //TC_043_3_CS-Send Local Authorization List - Failed + //return false; + bool success = localAuthorizationList.readJson(localAuthorizationListJson, listVersion, differential, false); if (success) { From 3af8343192edaa3af0509ff6fd3f16daca3bbe83 Mon Sep 17 00:00:00 2001 From: Razvan Grigore Date: Sun, 9 Nov 2025 18:10:47 +0200 Subject: [PATCH 3/4] Fix Actions / Error: This request has been automatically failed because it uses a deprecated version of `actions/cache: v2` Please update your workflow to use v3/v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down --- .github/workflows/documentation.yml | 10 +++++----- .github/workflows/pio.yml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 7fc6acd6..9d23daeb 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: key: ${{ github.ref }} path: .cache @@ -101,14 +101,14 @@ jobs: steps: - uses: actions/checkout@v3 - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} @@ -142,7 +142,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: key: ${{ github.ref }} path: .cache @@ -194,7 +194,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: key: ${{ github.ref }} path: .cache diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index ec777853..189351fd 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -20,21 +20,21 @@ jobs: example: [examples/ESP/main.cpp, examples/ESP-TLS/main.cpp] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 - name: Install PlatformIO run: | python -m pip install --upgrade pip From 9a4f1da1759f9c9782ec220c600ed74e372a93fd Mon Sep 17 00:00:00 2001 From: Razvan Grigore Date: Tue, 11 Nov 2025 16:59:43 +0200 Subject: [PATCH 4/4] mark LocalAuthListEnabled configuration as rebootRequired --- src/MicroOcpp/Model/Authorization/AuthorizationService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp b/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp index 86692dee..dc395ff9 100644 --- a/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp +++ b/src/MicroOcpp/Model/Authorization/AuthorizationService.cpp @@ -24,7 +24,7 @@ using namespace MicroOcpp; AuthorizationService::AuthorizationService(Context& context, std::shared_ptr filesystem) : MemoryManaged("v16.Authorization.AuthorizationService"), context(context), filesystem(filesystem) { - localAuthListEnabledBool = declareConfiguration("LocalAuthListEnabled", true); + localAuthListEnabledBool = declareConfiguration("LocalAuthListEnabled", true, CONFIGURATION_FN, false, true); declareConfiguration("LocalAuthListMaxLength", MO_LocalAuthListMaxLength, CONFIGURATION_VOLATILE, true); declareConfiguration("SendLocalListMaxLength", MO_SendLocalListMaxLength, CONFIGURATION_VOLATILE, true);