feat(config): write to state.toml + keychain and deprecate profiles (2/2)#231
Draft
LorrisSaintGenez wants to merge 1 commit into
Draft
feat(config): write to state.toml + keychain and deprecate profiles (2/2)#231LorrisSaintGenez wants to merge 1 commit into
LorrisSaintGenez wants to merge 1 commit into
Conversation
Flip all credential writes from config.toml to the state.toml + OS
keychain store introduced in the stacked base PR. config.toml is now
only read as a legacy fallback and is never written.
- Profile.Add and Config.{RemoveProfile,SetDefaultProfile,SetCrawlerAuth}
persist non-secrets to state.toml and secrets to the OS keychain.
- ConfiguredProfiles resolves applications from state.toml (metadata
only; API keys are read lazily from the keychain where needed).
- Persist the API key UUID (api_key_uuid) when minting keys.
- Deprecate the `profile` command group in favor of `auth login`,
`application list`, and `application select`.
Co-authored-by: Cursor <[email protected]>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 8 |
| Duplication | 2 |
TIP This summary will be updated as you push new changes.
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
config.tomlto thestate.toml(non-secrets) + OS keychain (secrets) store.config.tomlis now only read as a legacy fallback and is never written.auth login,application create, andapplication selectpersist the application metadata +api_key_uuidtostate.toml, the API key to the keychain, and set the current application.application listmarks configured applications fromstate.toml;auth crawlerstorescrawler_user_idinstate.tomland the crawler key in the keychain.profilecommand group (add/list/remove/setdefault) in favor ofauth login,application list, andapplication select. Stored profiles still resolve as aliases via the deprecated--profileflag until v2.0.Test
Starting from a clean state (no
state.toml):algolia auth login: signs in, mints/reuses an API key, writesstate.toml(application id + alias +api_key_uuid) and the OS keychain (API key), and sets the app as current.config.tomlis left untouched.algolia application list: lists your applications with the configured one marked(profile: <alias>), read fromstate.toml.algolia application select: switches the current application instate.toml, minting a key into the keychain only if none exists yet.algolia indices list: resolves credentials fromstate.toml+ keychain and succeeds with no flags/env.algolia auth crawler: storescrawler_user_idinstate.tomland the crawler API key in the keychain for the current application.algolia profile list(and the otherprofile …subcommands): still work via the stored aliases but print the deprecation notice pointing to the replacement commands.Throughout, confirm
config.tomlis never written (it stays untouched / absent).GROUT-305