Skip to content

feat: authenticate R2PS admin API calls with dev token - #27

Merged
leifj merged 1 commit into
mainfrom
feat/r2ps-admin-direct-auth
Jul 14, 2026
Merged

feat: authenticate R2PS admin API calls with dev token#27
leifj merged 1 commit into
mainfrom
feat/r2ps-admin-direct-auth

Conversation

@leifj

@leifj leifj commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Now that go-r2ps-service requires Bearer token auth on its admin API (merged in sirosfoundation/go-r2ps-service#25), this PR configures sirosid-dev to authenticate directly.

Changes

  • Makefile: Add R2PS_ADMIN_DEV_TOKEN env var (default: r2ps-e2e-dev-token-for-testing-only)
  • docker-compose.r2ps.yml: Pass the token to the r2ps-server container
  • scripts/setup-r2ps.sh: Include Authorization: Bearer header in all admin API curl calls

Why

Previously the R2PS admin API had no auth (relying on network isolation). Now it requires a Bearer token. This PR makes sirosid-dev work with the new auth-enabled R2PS by calling it directly with its own dev token — no go-wallet-backend proxy needed.

Testing

Start with make up R2PS=yes and run ./scripts/setup-r2ps.sh — all admin calls should succeed with 200.

Now that go-r2ps-service requires Bearer token auth on its admin API,
configure sirosid-dev to pass R2PS_ADMIN_DEV_TOKEN in all admin calls.

Changes:
- Makefile: add R2PS_ADMIN_DEV_TOKEN env var (default: e2e test token)
- docker-compose.r2ps.yml: pass token to r2ps-server container
- scripts/setup-r2ps.sh: include Authorization header in all curl calls

This calls the R2PS admin API directly (port 8444) with its own dev
token, eliminating the need for a proxy through go-wallet-backend.
@leifj
leifj requested a review from Copilot July 14, 2026 21:22
@leifj
leifj merged commit de623d5 into main Jul 14, 2026
@leifj
leifj deleted the feat/r2ps-admin-direct-auth branch July 14, 2026 21:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the local sirosid-dev R2PS overlay and provisioning script to work with the newly auth-protected go-r2ps-service admin API by introducing and propagating a dev Bearer token.

Changes:

  • Add R2PS_ADMIN_DEV_TOKEN (defaulted for dev/e2e) to the Makefile environment exports.
  • Pass R2PS_ADMIN_DEV_TOKEN into the r2ps-server container via docker-compose.r2ps.yml.
  • Add Authorization: Bearer ... to admin API curl calls in scripts/setup-r2ps.sh.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Makefile Exports R2PS_ADMIN_DEV_TOKEN so make up R2PS=yes provides the token to compose and tooling.
docker-compose.r2ps.yml Injects R2PS_ADMIN_DEV_TOKEN into the r2ps-server container environment.
scripts/setup-r2ps.sh Authenticates admin API calls with Authorization: Bearer using R2PS_ADMIN_DEV_TOKEN.

Comment thread scripts/setup-r2ps.sh
Comment on lines +72 to 76
status=$(curl -sf -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer ${R2PS_ADMIN_DEV_TOKEN}" \
"${R2PS_ADMIN_URL}/admin/store/keys" 2>&1) || true
if [[ "$status" == "200" ]]; then
ok "R2PS admin API accessible"
Comment thread docker-compose.r2ps.yml
R2PS_SESSION_TTL: "5m"
# Admin API
R2PS_ADMIN_LISTEN: ":8081"
R2PS_ADMIN_DEV_TOKEN: ${R2PS_ADMIN_DEV_TOKEN:-r2ps-e2e-dev-token-for-testing-only}
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.

2 participants