fix/feat: OCPI audit fixes and improvements#19
Merged
alfonsosastre merged 10 commits intomainfrom Feb 23, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CANCEL_RESERVATION was introduced in OCPI 2.2.1, not 2.1.1. The else branch was dead code since FastAPI validates the CommandType enum before the handler is invoked. Closes #17 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The crud.update call was using id="" instead of id=auth_token, inconsistent with crud.get and crud.delete which both use auth_token as the credential identifier. This caused incorrect credential targeting in multi-credential scenarios. Closes #15 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The EMSP sender interface allows pulling terminal and financial advice confirmation data from the CPO. Adds GET endpoints for both resources and registers the router in the v2.3.0 EMSP router map. Closes #14 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds HubRequestIdMiddleware that echoes X-Request-ID (generating one if absent) and X-Correlation-ID (when provided) in every response, as required by the OCPI spec for Hub deployments. Closes #16 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
get_modules and get_authenticator overrides were calling the functions immediately and storing the result, instead of storing the callables. FastAPI dependency_overrides expects a callable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Normalize prod/dev/staging/test aliases before validation so deployments using short names don't raise ValueError at startup. Aliases map as: prod→production, dev/staging→development, test→testing. Closes #10 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Auth: document that missing header returns 422 (FastAPI validation) and wrong token returns 403 - CDR module: verify POST method is used and base_url is not appended - Tokens module: verify EMSP role is used for crud.get Closes #18 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
Audit-driven fixes and new features based on a full OCPI implementation review.
CLAUDE.mdwith architecture overview and developer workflowNotImplementedErrorbranch in commands v2.1.1 (closes fix: remove unreachable NotImplementedError in commands 2.1.1 #17)auth_tokenasidinPUT /credentialsfor v2.2.1 and v2.3.0 (closes fix: credential_id hardcoded as empty string in PUT /credentials (2.3.0) #15)X-Request-IDandX-Correlation-IDhub routing headers (closes feat: implement hub routing headers (X-Request-ID, X-Correlation-ID) #16)get_applicationprod,dev,staging,test) inENVIRONMENTsetting (closes Accept common environment aliases (dev, prod, staging) in ENVIRONMENT validation #10)Test plan
🤖 Generated with Claude Code