You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when making a password recipe, you need to specify the character sets that can be used when generating the password (e.g. SYMBOLS, LETTERS, DIGITS). However, it can be tricky to know by heart the supported character sets.
Also, it would be nice to have a sort of validation of the recipe before sending the request to Connect. As a starting inspiration, you can check the validRecipe function from Node SDK.
Tasks to be done
Add a new type that will be used as a field purpose, along with the constants that represent the supported character sets. Add this in onepassword/items/go. Please ensure that all constants are set by checking out this part of the Connect API documentation
Note: Feel free to change the name of the type, as well as the constant names. This is just a sample code of what it can look like.
Change the CharacterSets property of the GeneratorRecipe struct to use the new type. (line 132)
// GeneratorRecipe Representation of a "recipe" used to generate a fieldtypeGeneratorRecipestruct {
Lengthint`json:"length,omitempty"`CharacterSets []CharacterSets`json:"characterSets,omitempty"`ExcludeCharactersstring`json:"excludeCharacters,omitempty"`
}
If needed, add a validator function that validates the provided list of character sets. If this is added, also add tests that make sure the validator works as expected.
The text was updated successfully, but these errors were encountered:
Summary
Currently, when making a password recipe, you need to specify the character sets that can be used when generating the password (e.g.
SYMBOLS
,LETTERS
,DIGITS
). However, it can be tricky to know by heart the supported character sets.Also, it would be nice to have a sort of validation of the recipe before sending the request to Connect. As a starting inspiration, you can check the
validRecipe
function from Node SDK.Tasks to be done
onepassword/items/go
. Please ensure that all constants are set by checking out this part of the Connect API documentationNote: Feel free to change the name of the type, as well as the constant names. This is just a sample code of what it can look like.
CharacterSets
property of theGeneratorRecipe
struct to use the new type. (line 132)The text was updated successfully, but these errors were encountered: