feat: OnepinClient() with credential auto-resolution#77
Merged
Conversation
Add hand-rolled OnepinClient / AsyncOnepinClient (preserved via .fernignore, re-exported from the package __init__) that subclass the Fern-generated clients and resolve the API key the same way the CLI does — explicit api_key=, then ONEPIN_API_KEY, then ~/.onepin/credentials (written by `onepin login`) — so one login authenticates both the CLI and the SDK. The version-gate response hook is applied, matching make_client; base_url resolves independently (arg > ONEPIN_BASE_URL > file). Raises OnepinAuthError when no key is found anywhere. Reuses the CLI's tested resolver (onepin._cli.auth.resolver), which has no click/typer deps, so `import onepin` stays lightweight. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
README, pyproject description, and the bundled agent skill said '100+'/'30'; the live catalog is 24 (Added + P1). One number everywhere. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17e3561 to
5b4ea6f
Compare
kj-podonos
approved these changes
Jul 9, 2026
kj-podonos
added a commit
that referenced
this pull request
Jul 9, 2026
🤖 I have created a release *beep* *boop* --- ## [0.9.0](v0.8.3...v0.9.0) (2026-07-09) ### Features * OnepinClient() with credential auto-resolution ([#77](#77)) ([174685b](174685b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
OnepinClient()/AsyncOnepinClient()that resolve the API key fromapi_key=→ONEPIN_API_KEY→~/.onepin/credentials(written byonepin login). Oneonepin loginnow authenticates both the CLI and the SDK. The version-gate response hook is applied;OnepinAuthErroris raised when no key is found.base_urlresolves independently (arg→ONEPIN_BASE_URL→ file)._client.py,_auth_resolve.py), preserved via.fernignoreand re-exported from the package__init__; also wired intofern/generators.ymladditional_init_exportsso a future regen keeps them.onepin._cli.auth.resolver), which has noclick/typerdeps —import onepinstays lightweight.Tests
9 new unit tests (resolution chain + offline client construction). Full unit + CLI suite green.
Notes
OnePinClient;OnepinClientis an additive credential-resolving subclass, so this matches the public docs (from onepin import OnepinClient) without a regen rename.make_client()is unchanged.feat:as a minor bump).🤖 Generated with Claude Code