Skip to content

server: make the collection iteration determenistic - #704

Merged
bilelmoussaoui merged 4 commits into
mainfrom
bilelmoussaoui/issue-703
Nov 20, 2026
Merged

bilelmoussaoui merged 4 commits into
mainfrom
bilelmoussaoui/issue-703

Conversation

@bilelmoussaoui

Copy link
Copy Markdown
Collaborator

Also fixes an issue with SetAlias as well as adding a new merge command to oo7-cli that works like oo7-cli merge ~/.local/share/keyrings/v1/default2.keyring ~/.local/share/keyrings/v1/login.keyring --origin-secret <default2's password> --destination-secret <login password>

SearchItems, GetSecrets and alias resolution iterated the collections
HashMap, whose order changes between daemon restarts. With items
sharing attributes across collections, clients taking the first match
got a different secret after every restart.

Iterate the collections sorted by path, with the default collection
first, where new items are stored.

#703
SetAlias left the alias on the collection previously holding it, so
two collections claimed the same alias and ReadAlias depended on the
HashMap iteration order again.

#703
Merge the items of a keyring or collection into another, resolving
each side as a keyring file or a collection by alias, name or label.
New items are copied over, identical ones skipped, and conflicting
ones shown as a diff asking whether to override or skip, with
--on-conflict for non-interactive use.

The remedy for the collections left behind by the duplicate alias
fixes, #703
The collection, keyring, secret and app-id options were global,
showing up in the help of commands that ignore them. Move them to the
commands using them; --verbose stays global.

Passing them before the subcommand now errors, the after-subcommand
form is unchanged.
@github-actions

Copy link
Copy Markdown

📊 Code Coverage Report

Metric Value
Current PR Coverage 84.77%
Main Branch Coverage 84.75%
Coverage Change 📈 +0.02%

Coverage report generated by cargo-tarpaulin

@bilelmoussaoui
bilelmoussaoui merged commit 9a31482 into main Nov 20, 2026
9 checks passed
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.

Secrets stay split between "login" and "default2" after the #662 fix

1 participant