Skip to content

Python SDK: decide on a single auth configuration surface #1025

Description

@SnowboardTechie

Summary

The Python SDK client currently supports two overlapping ways to set API key auth: Config(api_key=...) (required, falls back to CG_API_KEY) and an optional Auth passed to the client. When both are set, the explicit Auth wins and Config.api_key goes unused. This came out of review on common-grants/py-cg-grants-gov#13, where the docs example passed the same key twice.

Two consequences today:

  • It's not obvious to consumers which path wins, and docs examples have duplicated the key.
  • Config requires api_key unconditionally, so a client using Auth.bearer(...) still has to supply an unused API key.

For comparison, the TS SDK takes auth only through the auth option and ClientConfig carries no key.

Flagged for the next minor release of the Python SDK.

Acceptance criteria

  • Direction decided and recorded on this ticket (single canonical auth surface, or keep both paths and document precedence).
  • Python SDK client, README, and examples updated to match the decision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions