feat(config): migrate config.toml profiles to the keychain and state.toml#246
Merged
Merged
Conversation
…toml Per profile: api_key (+ crawler_api_key if set) goes to the OS keychain under the profile's application ID, state.toml gets an entry with alias = profile name, and current_application_id is taken from the default = true profile. api_key_uuid stays empty for legacy keys. Keychain first, state.toml last (atomic temp + rename): a keychain failure leaves state.toml absent so the migration retries on the next run. An empty config.toml still writes an empty state.toml so the trigger turns off. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 23 |
| Duplication | 3 |
TIP This summary will be updated as you push new changes.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
d73969b
into
feat/migration-trigger
1 of 2 checks passed
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
Second step of GROUT-363, stacked on #245:
Config.Migrate()gets its body.api_key(+crawler_api_keyif set) is stored in the OS keychain under the profile's application IDstate.tomlentry per application withalias = <profile name>;api_key_uuidleft empty (unknown for legacy keys, API lookup comes later)current_application_id= thedefault = trueprofile's applicationstate.tomllast (atomic temp + rename viaState.Save): a keychain failure aborts beforestate.tomlexists, so the migration retries on the next runstate.toml, so the trigger turns off instead of re-firing on every commandconfig.toml itself is never modified.
Test
GROUT-363