Skip to content
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

Parameterize generator view options #2002

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

GrantMoyer
Copy link
Contributor

Before this change, generator view options were static, so all generators needed to work with the same options. This change parameterizes the options, so that plugins can provide different sets of options for custom generators. In particular, this change enables hiding the default options for generators where it doesn't make sense, such as the passphrase generator in keeweb/keeweb-plugins#30.

Example use:

parameterized_options

Before this change, generator view options were static, so all generators needed to work with the same options. This change parameterizes the options, so that plugins can provide different sets of options for custom generators. In particular, this change enables hiding the default options for generators where it doesn't make sense, such as the passphrase generator in keeweb/keeweb-plugins#30.
@GrantMoyer
Copy link
Contributor Author

GrantMoyer commented Mar 29, 2022

All preset options except "Length" and "Pattern" are now parameterized, including character ranges and additional symbols to include. This lets password generator plugins add any checkbox or text input option.

The existing behavior of the app without plugins is maintained, except that the MAC address, 128-bit hash, and 256-bit hash generators no longer have character range options. This change was intentional, since I do not think character range options make sense for these generators, but this can easily be reverted if desired.

New presets can be saved as normal, and they copy all their options from the preset they're copied from. Therefore, plugin generator presets can be saved alongside built in presets. If a new plugin preset is created, and the plugin is later removed, the preset is still listed, but it will not be able to generate passwords if a custom generator was used. It will begin working again when the plugin is re-installed.

Overall, I think the interface for custom password generators ends up being fairly elegant. See keeweb/keeweb-plugins#30 for an example custom generator using this new interface.

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.

None yet

1 participant