-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(repository)!: Add more control over used keys #383
base: main
Are you sure you want to change the base?
Conversation
13be81a
to
20c7054
Compare
/// # Errors | ||
/// | ||
/// * If the key could not be removed. | ||
pub fn delete_key(&self, id: &str) -> RusticResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things:
- what happens in case two keys have the same starting strings?
- there is no safe-guarding in place, before deleting the keys (although that might fit better into
rustic-rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_id
returns an error if no unique id can be found.
The safeguard is the check against key_id()
- which is the key used to open the repo.
Adds more control over the used repository keys.
This is needed to implement the missing
key list
,key remove
commands in the rustic CLI.As this refactors the
Repository
a bit, this is a breaking change (which will most likely not harm anyone using rustic_core)