This PR adds the excludeCharacters property to the GeneratorRecipe class in generator_recipe.py.
Essentially the excludeCharacters property will tell the Connect server to exclude all characters within the excludeCharacters string when generating a password.
Three methods have been added to the GeneratorRecipe class:
exclude_characters(self) returns the excludeCharacters property of the current GeneratorRecipe object.
exclude_characters(self, exclude_characters) validates and sets the excludeCharacters property of the current GeneratorRecipe object.
find_duplicates(self, s) is used to check if the s string contains any duplicate characters and returns a list of the duplicate characters if they exist. This function is called in the exclude_characters(self, exclude_characters) to check if the desired excludeCharacters string contains any duplicates, if yes then a error is raised.
Type of change
- [ ] Created a new plugin
- [x] Improved an existing plugin
- [ ] Fixed a bug in an existing plugin
- [ ] Improved contributor utilities or experience
## Related Issue(s)
* Resolves: #79
## How To Test
Run unit tests
From the project's root directory run: pytest /src/tests
Test feature
Create an username Item with a generated password, and pass the exclude_characters string into the GeneratorRecipe like such:
Finally check in your 1Password vault for excludeCharacters Test String and reveal the password to see if the generated password contains any characters that were included in excludeCharacters.
Changelog
Added `excludeCharacters` property to `GeneratorRecipe` class
Overview
This PR adds the
excludeCharacters
property to theGeneratorRecipe
class ingenerator_recipe.py
. Essentially theexcludeCharacters
property will tell the Connect server to exclude all characters within theexcludeCharacters
string when generating a password.Three methods have been added to the
GeneratorRecipe
class:exclude_characters(self)
returns theexcludeCharacters
property of the currentGeneratorRecipe
object.exclude_characters(self, exclude_characters)
validates and sets theexcludeCharacters
property of the currentGeneratorRecipe
object.find_duplicates(self, s)
is used to check if thes
string contains any duplicate characters and returns a list of the duplicate characters if they exist. This function is called in theexclude_characters(self, exclude_characters)
to check if the desiredexcludeCharacters
string contains any duplicates, if yes then a error is raised.Type of change
- [ ] Created a new plugin - [x] Improved an existing plugin - [ ] Fixed a bug in an existing plugin - [ ] Improved contributor utilities or experience ## Related Issue(s) * Resolves: #79 ## How To TestRun unit tests
From the project's root directory run:
pytest /src/tests
Test feature
Item
with a generated password, and pass theexclude_characters
string into theGeneratorRecipe
like such:Item
in your 1Password vaultexcludeCharacters Test String
and reveal the password to see if the generated password contains any characters that were included inexcludeCharacters
.Changelog
Added `excludeCharacters` property to `GeneratorRecipe` class