Skip to content

fix: align credit service client with nilauth-credit API#181

Open
jcabrero wants to merge 1 commit intofeat/rust-migrationfrom
worktree-agent-a1547f31
Open

fix: align credit service client with nilauth-credit API#181
jcabrero wants to merge 1 commit intofeat/rust-migrationfrom
worktree-agent-a1547f31

Conversation

@jcabrero
Copy link
Member

Summary

  • Fix credit client HTTP endpoints to match actual nilauth-credit API (/v1/credential/validate, /v1/balance/lock/{public,private}, /v1/balance/unlock)
  • Fix request body field names (credential_key, credential, amount, real_cost)
  • Update CreditService::lock_credits trait signature to accept credential + is_public instead of user_id (the nilauth API authenticates via credential keys in request bodies)
  • Remove unused Bearer token authentication from the credit client
  • Update MeteringContext to carry credential and is_public instead of user_id

Test plan

  • cargo check --workspace passes
  • cargo test --workspace passes (3 tests)
  • cargo fmt and cargo clippy clean
  • E2E tests (require Docker services, tested by coordinator)

🤖 Generated with Claude Code

Update endpoints, request/response formats, and trait signatures to
match the actual nilauth-credit service API. Remove unused Bearer token
authentication from the credit client since nilauth authenticates via
credential keys in request bodies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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