Skip to content

Fix project-scoped secrets being unretrievable via Get-StrongboxSecret - #34

Merged
jpol34 merged 1 commit into
mainfrom
fix/project-scoped-secret-resolution
Sep 19, 2026
Merged

jpol34 merged 1 commit into
mainfrom
fix/project-scoped-secret-resolution

Conversation

@jpol34

@jpol34 jpol34 commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Resolve-StrongboxSecretTarget only treated a name as project-scoped if a matching entry existed in the cloud-sync manifest, but nothing on Set-StrongboxSecret's normal write path populates that manifest — it's sync-only bookkeeping (see Push-StrongboxSecret/Pull-StrongboxSecret/Get-StrongboxSyncStatus).
  • Net effect: a secret written with Set-StrongboxSecret -Scope Project was stored under Name::Project, but Get-StrongboxSecret could never find it and always silently fell back to the global name instead — a project-scoped secret was effectively write-only.
  • Fix: resolve project scope by probing the vault directly (Get-SecretInfo, no decryption) for the project-scoped internal name, instead of depending on the sync manifest. Works immediately after a plain local Set-StrongboxSecret call, with no dependency on whether the secret has ever been synced.

Test plan

  • Set-StrongboxSecret -Name X -Value Y -Scope Project (letting -Project auto-infer from the git remote, matching how Get-StrongboxSecret resolves it) followed by Get-StrongboxSecret -Name X — confirmed returns Y (previously failed with "missing or unreadable secret")
  • Reinstalled the module from source via Install-StrongboxModule.ps1 and re-ran the round trip against the live installed copy

Found and fixed while provisioning real project-scoped secrets (a Kraken API key/secret and a Hummingbot config password) for another project.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TNz4QZBeWEPxt4u4rVyVUy

Resolve-StrongboxSecretTarget only treated a name as project-scoped if
a matching entry existed in the cloud-sync manifest, but nothing on
Set-StrongboxSecret's normal write path populates that manifest -- it's
sync-only bookkeeping. A secret written with Set-StrongboxSecret -Scope
Project was stored under Name::Project but could never be found by
Get-StrongboxSecret, which always fell back to the global name instead.

Resolve project scope by probing the vault directly (Get-SecretInfo,
no decryption) for the project-scoped internal name instead, so it
works immediately after a plain local Set-StrongboxSecret call, with
no dependency on whether the secret has ever been synced.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNz4QZBeWEPxt4u4rVyVUy
@jpol34
jpol34 merged commit bbb5a9b into main Sep 19, 2026
1 check failed
@jpol34
jpol34 deleted the fix/project-scoped-secret-resolution branch September 19, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant