Skip to content

chore(scripts): add OCPI 2.2.1 registration walker#2

Open
MostafaMoradii wants to merge 1 commit into
mainfrom
chore/ocpi-register-script
Open

chore(scripts): add OCPI 2.2.1 registration walker#2
MostafaMoradii wants to merge 1 commit into
mainfrom
chore/ocpi-register-script

Conversation

@MostafaMoradii
Copy link
Copy Markdown
Collaborator

Summary

  • Add scripts/ocpi-register.sh — walks the OCPI 2.2.1 credentials handshake (GET /versions → GET /versions/{v} → POST /credentials) against a hub.
  • Base64-encodes the Authorization: Token value (OCPI 2.2+ requirement), prints each request/response with status + headers + JSON-pretty body, and stops on the first 4xx/5xx so failures are obvious.
  • Inputs come from env vars (HUB_BASE, TOKEN_A, MY_VERSIONS_URL, MY_TOKEN_B, COUNTRY_CODE, PARTY_ID); body shape is 2.2/2.2.1 (the script header notes how to adjust for 2.1.1).

Used today to diagnose a 401 Unauthorized on testapiv2.ortaksarjplatformu.com/ocpi/versions (token had been consumed; awaiting a fresh TOKEN_A).

Test plan

  • bash -n scripts/ocpi-register.sh (syntax)
  • Run with valid inputs against the test hub once a fresh TOKEN_A arrives; expect the three steps to print and POST /credentials to return our TOKEN_C
  • Run with a bad TOKEN_A and confirm the script stops at step 1 with status 401

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