Support user-defined generic password options/attributes. #220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a quick sketch to discuss support for custom attributes/options when creating generic passwords.
The desire is to be able to support more complex use cases such as specifying
kSecAccessControl
,kSecAccessGroup
etc. for a generic password.Currently I've added this as an additional
set_generic_password_options()
function so as not to introduce any breaking changes but ultimately I think a builder style API forPasswordOptions
would be more ergonomic. Perhaps:Then we could make the breaking change that
set_generic_password()
just acceptsPasswordOptions
and the password and wouldn't need the additional function if that is acceptable for the next major release.I notice in #186 there are other people that would also like to be able to use
kSecAccessControl
withSecItemAdd
so I think it makes sense that we support the other attributes too.Your thoughts and feedback would be appreciated 🙏
Closes #219