Skip to content

Add shade.api_base override support #6

Description

@codebestia

Description

Teams running a self-hosted Shade backend or a staging environment at a custom URL need to override the default API base without changing the environment enum. shade.api_base should provide an escape hatch that takes precedence over the URL resolved from Environment.

Proposed Steps

  • Add api_base: Optional[str] = None to ShadeClient and config.py.
  • In the HTTP client URL builder, prefer api_base when set, otherwise fall back to the Environment-resolved URL.
  • Trim trailing slashes on the provided value.
  • Document that this is intended for development/testing only.

Acceptance Criteria

  • shade.api_base = "https://staging.shadeprotocol.io" routes all requests to that host.
  • ShadeClient(api_base="http://localhost:8000") routes that client's requests locally.
  • When api_base is set, Environment still controls the Stellar network passphrase.
  • Trailing slashes in the provided URL are normalized.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions