fix(push,cdr): honor Receiver.raw_token and add CdrLocation.evse_uid#25
Merged
Merged
Conversation
Two OCPI compliance/interop fixes needed for CDR push to eMSPs that do not base64-decode the auth token (e.g. DepotCharge): - push_object now sends the raw auth token when Receiver.raw_token=True, instead of always base64-encoding for 2.2.x/2.3.x. Some eMSPs compare the literal Token header value, so a base64-encoded token is rejected with 401 "Unknown token". - CdrLocation (2.2.1 and 2.3.0) now includes the spec-required evse_uid field. It was missing, so the lib silently dropped evse_uid from the serialized CDR, causing receivers to reject the push with 400. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CDR pushes to DepotCharge (eMSP) were failing in prod:
Unknown token— the lib always base64-encodes the auth token for 2.2.x/2.3.x, but DepotCharge compares the literalTokenheader value.Receiver.raw_token=Trueexisted as a flag butpush_objectignored it.CdrLocationwas missing the spec-requiredevse_uidfield, so the lib silently dropped it from the serialized payload.Changes
push_object: send raw token whenreceiver.raw_tokenis set.CdrLocation(2.2.1 + 2.3.0): addevse_uid: CiString(36).Risk
raw_tokendefaultsFalse→ no change for existing receivers (e.g. Payter stays base64).evse_uidis required per OCPI 2.2.1+; consumers already send it (verified against elu-charge backend).🤖 Generated with Claude Code