[Task] Improve Stronghold
constructor and did_create
impl
#836
Labels
Breaking change
A change to the API that requires a major release. Part of "Changed" section in changelog
Rust
Related to the core Rust code. Becomes part of the Rust changelog.
Description
After #787 we should make some quality of life and security improvements to our
Stronghold
wrapper. Some of these will be breaking changes.did_create
. Investigate if this is necessary for other functions as well. This should perhaps also be documented and/or recommended behaviour.create
flag forStronghold
that, iftrue
, will create a snapshot file if it doesn't exist, or, iffalse
, throw an error if the file doesn't exist.This last point warrants re-thinking the
Stronghold
constructor.The broad options are (copied from @cycraig):
Stronghold::new
andStronghold::new_with_options
with aStrongholdOptions
(would have to be a builder to avoid breaking changes).StrongholdBuilder
, e.g.,StrongholdOptions
struct, embracing the TypeScript approach:I prefer option 1, because the other options leave the possibility of a user not providing a password and path which are required, requiring us to introduce an error variant (à la
MissingRequiredField
). This can of course be further discussed.Motivation
Improve security and provide users a way to better express their expectations (
create
flag).Resources
Change checklist
Add an
x
to the boxes that are relevant to your changes, and delete any items that are not.The text was updated successfully, but these errors were encountered: