feat: add OCPI 2.3.0 support to push functionality#20
Merged
alfonsosastre merged 3 commits intomainfrom Feb 24, 2026
Merged
Conversation
send_push_request now matches endpoints by RECEIVER role for 2.3.x (same as 2.2.x), and push_object already base64-encodes tokens for any version beyond 2.1.x. Previously 2.3.0 pushes would silently use an empty base_url because the version check only covered "2.2". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace explicit startswith("2.2") or startswith("2.3") with
a negated check, so any version beyond 2.0.x/2.1.x automatically
uses RECEIVER role filtering without needing code changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
alfonsosastre
added a commit
that referenced
this pull request
Feb 24, 2026
* feat: add OCPI 2.3.0 support to push functionality (#20) * feat: add OCPI 2.3.0 support to push functionality send_push_request now matches endpoints by RECEIVER role for 2.3.x (same as 2.2.x), and push_object already base64-encodes tokens for any version beyond 2.1.x. Previously 2.3.0 pushes would silently use an empty base_url because the version check only covered "2.2". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor: future-proof push endpoint version check Replace explicit startswith("2.2") or startswith("2.3") with a negated check, so any version beyond 2.0.x/2.1.x automatically uses RECEIVER role filtering without needing code changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * style: apply ruff format to push.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Alfonso Sastre <alfonso@elumobility.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: handle OCPI version negotiation in push_object push_object now accepts both a versions URL and a version details URL as endpoints_url. When a versions list is returned (data is a list), it automatically picks the best mutual version and fetches the details URL to discover endpoints. This follows the proper OCPI spec flow: 1. GET /versions → list of supported versions with details URLs 2. Pick best mutual version 3. GET /{version}/details → list of endpoints 4. Push to the correct module endpoint Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Alfonso Sastre <alfonso@elumobility.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
send_push_requestnow matches endpoints byRECEIVERrole for2.3.xversions, consistent with the existing2.2.xbehaviour. Previously, 2.3.0 pushes would silently use an emptybase_urlbecause the version check only coveredstartswith("2.2").elsebranch — added a clarifying comment.Root cause
Test plan
test_push_v_2_3_0_uses_receiver_role_and_base64_tokenverifies:🤖 Generated with Claude Code