Skip to content

Implement global shade module configuration #1

Description

@codebestia

Description:

The SDK should support module-level configuration (e.g. shade.api_key = "sk_live_...") so developers can configure it once at app startup without instantiating a client object on every call. This mirrors the ergonomics of the Stripe Python SDK. The global config must be thread-safe and readable by all resource classes.

Proposed Steps:

  • Create src/shade/config.py with module-level variables: api_key, api_base, environment, timeout, max_retries.
  • Expose these on the top-level shade namespace via __init__.py.
  • Write a get_config() helper that merges instance-level overrides with global defaults, used internally by all resource methods.
  • Guard against None api_key at request time and raise AuthenticationError.

Acceptance Criteria:

  • shade.api_key = "sk_live_xxx" sets the global key accessible across all resource calls.
  • shade.environment = "sandbox" switches the active environment.
  • Setting shade.api_key = None and then calling any resource raises AuthenticationError with a clear message.
  • Global config does not bleed between threads when changed concurrently.

Activity

  1. Whiznificent commented on Jun 19, 2026

    @Whiznificent

    gm again maintainer please assign me this issue to work on

  2. Elizabeth-dev270 commented on Jun 20, 2026

    @Elizabeth-dev270

    I enjoy solving software problems and have experience in backend development, APIs, OOP, and scalable application design.

  3. timiturn3r commented on Jun 20, 2026

    @timiturn3r

    Hi! I came across this issue and would love to work on it. I have experience with similar tasks and I'm confident I can investigate, implement a clean solution, and thoroughly test it before submitting a PR. If the issue is still open, I would appreciate it if you could assign it to me. Thank you!

  4. DioChuks commented on Jul 21, 2026

    @DioChuks
    Contributor

    Hello, i am senior SWE, the problem seems to be about global module configuration, ensuring a well rounded setup for the application startup, i would handle this well, thanks.

  5. grantfox-oss commented on Jul 24, 2026

    @grantfox-oss

    🦊 GrantFox — @DioChuks has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #1)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  6. grantfox-oss commented on Jul 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign | FWC26 campaign!

    @DioChuks's PR #53 was approved and merged by @codebestia.

    🏆 @DioChuks: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (204 total points). Track your full progress on GrantFox.

    👏 Great work, @DioChuks! Keep contributing to ShadeProtocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions