feat(accounts): reference the default token instead of copying it #103
Closed
KofTwentyTwo wants to merge 2 commits from
feat/default-token-ux into main
pull from: feat/default-token-ux
merge into: KofTwentyTwo:main
KofTwentyTwo:main
KofTwentyTwo:feat/216-one-window-per-data-folder
KofTwentyTwo:ci/gitea-release
KofTwentyTwo:docs/218-documents-say-1.2.0
KofTwentyTwo:ci/gitea-windows-build
KofTwentyTwo:feat/212-default-token-per-forge
KofTwentyTwo:feat/211-version-and-wording
KofTwentyTwo:feat/209-gitea-quick-sync
KofTwentyTwo:feat/206-gitea-wizard
KofTwentyTwo:feat/204-gitea-accounts-and-cli
KofTwentyTwo:feat/202-gitea-listers
KofTwentyTwo:ci/original-gclo-ui-20261103
KofTwentyTwo:dependabot/github_actions/actions-604ff1328a
KofTwentyTwo:feat/default-token-wizard
KofTwentyTwo:style/kingsrook-layout
KofTwentyTwo:docs/standards-governance
KofTwentyTwo:ci/standards-gates
KofTwentyTwo:feature/GH-11-macos-rewrite-plan
No Reviewers
Labels
Clear labels
.NET
bug
deferred
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs-owner
priority
quality
question
refactor
release
wontfix
Pull requests that update .NET code
Something isn't working
Agreed follow-up, not scheduled
Pull requests that update a dependency file
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Pull requests that update GitHub Actions code
Good for newcomers
Extra attention is needed
This doesn't seem right
Blocked on an action only the owner can take
Owner-flagged: work this first
Standards, simplicity, enforcement
Further information is requested
Restructuring without behavior change
Release pipeline / distribution
This will not be worked on
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: KofTwentyTwo/gclo#103
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Step 1 of the approved UX plan (#101, #102): the model, the resolver, the store and the CLI. No desktop UI change yet (step 2: the wizard; step 3: Settings).
Account.TokenSource(Own|Default):Defaultaccounts reference the default token saved in Settings and never copy it, so rotating it rotates every such account.Ownis the on-disk default and is omitted fromaccounts.json, so existing files and vault entries stay byte-identical (round-trip tests).AccountTokenResolver: the one place that turns an account into its token, with a source-specific "missing" description. Used byWorkspaceViewModel, Sync All (through the workspace) andgclo sync --account.AccountsStore: aDefaultaccount is saved with no vault entry (a token for it is rejected); switching toDefaultremoves the own entry vault-first with the same compensation as a delete (consistency tests for the restore and the double-failure paths);CountUsingDefaultToken()for Settings.accounts add|edit --use-default-token(fatal when no default token is saved; exclusive with the other token options),accounts listtoken column +tokenSourceJSON field,sync --accounterrors name the source and the fix. Help text anddocs/CLI.mdupdated.Closes #104 (part of #102, #62).
How it was tested
dotnet build -warnaserror0 warnings;dotnet format --verify-no-changesclean.gclo.Engine.Tests447/447 (+22),gclo.Cli.Tests142/142 (+13); line coverage 100% ongclo.Engine,gclo.ViewModelsandgclo.Generated with Claude Code
Superseded by https://github.com/KofTwentyTwo/gclo/pull/110 (same commits cherry-picked onto main, signed and signed-off).
Pull request closed