Skip to content

feat: add VERSIONS_REQUIRE_AUTH to make versions/details auth optional#12

Merged
alfonsosastre merged 3 commits intomainfrom
feat/versions-require-auth-optional
Feb 19, 2026
Merged

feat: add VERSIONS_REQUIRE_AUTH to make versions/details auth optional#12
alfonsosastre merged 3 commits intomainfrom
feat/versions-require-auth-optional

Conversation

@alfonsosastre
Copy link
Copy Markdown
Contributor

Summary

Adds VERSIONS_REQUIRE_AUTH config parameter (default true) to allow unauthenticated access to /versions and /{version}/details endpoints for discovery.

Changes

  • ocpi/core/config.py: New VERSIONS_REQUIRE_AUTH: bool = True setting (env: VERSIONS_REQUIRE_AUTH)
  • ocpi/core/authentication/verifier.py: VersionsAuthorizationVerifier uses optional Authorization header when VERSIONS_REQUIRE_AUTH=false
  • Tests: Added optional-auth tests for 2.2.1 and 2.3.0

Usage

Set VERSIONS_REQUIRE_AUTH=false to allow Payter and other PTPs to discover versions/details without auth. Other endpoints still require authentication.

Testing

  • All existing version tests pass
  • New tests verify unauthenticated access when VERSIONS_REQUIRE_AUTH=false

Made with Cursor

Alfonso Sastre and others added 3 commits February 19, 2026 13:10
- Add VERSIONS_REQUIRE_AUTH config (default True) to allow unauthenticated
  access to /versions and /{version}/details for discovery (e.g. Payter)
- VersionsAuthorizationVerifier uses optional Authorization header when
  VERSIONS_REQUIRE_AUTH=false
- Add tests for 2.2.1 and 2.3.0 when auth is optional
- Set via VERSIONS_REQUIRE_AUTH env var

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@alfonsosastre alfonsosastre merged commit c1d985e into main Feb 19, 2026
4 checks passed
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