Skip to content

12. [RPC] Support RPC authentication (API Keys) #64

@dotandev

Description

@dotandev

Description
Allow the CLI to pass API keys or bearer tokens to the Horizon/RPC providers.

Requirements and Context

  • Background: Many production RPC providers (NowNodes, BlockDaemon) require authentication.
  • Success Criteria (Done):
    • ERST_RPC_TOKEN used in headers.
    • --rpc-token flag supported.

Suggested Execution

  • Fork/Branch: feature/rpc-auth
  • Implementation:
    • Update rpc.Client to include a custom http.RoundTripper.
    • Inject the Authorization or X-API-Key header into every request.

Test and Commit

  • Testing:
    • Use a mock server to verify the presence of the authentication header.
  • PR Inclusions:
    • Updated Client initialization.
    • Config/Flag support for tokens.

Example Commit Message
feat(rpc): support api keys and bearer tokens

Guidelines

  • Must-haves: Do not log the token value in Debug logs.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions