Skip to content

fix(push,cdr): honor Receiver.raw_token and add CdrLocation.evse_uid#25

Merged
nghildebrandt merged 1 commit into
mainfrom
fix/depotcharge-raw-token-cdr-evse-uid
Jun 11, 2026
Merged

fix(push,cdr): honor Receiver.raw_token and add CdrLocation.evse_uid#25
nghildebrandt merged 1 commit into
mainfrom
fix/depotcharge-raw-token-cdr-evse-uid

Conversation

@nghildebrandt

Copy link
Copy Markdown
Contributor

Why

CDR pushes to DepotCharge (eMSP) were failing in prod:

  • 401 Unknown token — the lib always base64-encodes the auth token for 2.2.x/2.3.x, but DepotCharge compares the literal Token header value. Receiver.raw_token=True existed as a flag but push_object ignored it.
  • After fixing auth, the CDR would still 400CdrLocation was missing the spec-required evse_uid field, so the lib silently dropped it from the serialized payload.

Changes

  • push_object: send raw token when receiver.raw_token is set.
  • CdrLocation (2.2.1 + 2.3.0): add evse_uid: CiString(36).

Risk

  • raw_token defaults False → no change for existing receivers (e.g. Payter stays base64).
  • evse_uid is required per OCPI 2.2.1+; consumers already send it (verified against elu-charge backend).

🤖 Generated with Claude Code

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>
@nghildebrandt nghildebrandt merged commit 34749c3 into main Jun 11, 2026
1 of 4 checks passed
@nghildebrandt nghildebrandt deleted the fix/depotcharge-raw-token-cdr-evse-uid branch June 11, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant