Skip to content

Better Password #371

@brianvoe

Description

@brianvoe

Enough discussion has been made about making a better password function.

What i would like to do is update the function to take in a struct of fields to determine the generated string output

Types:
simple - currently what we have. options would be
words - simple to memorize words separated by dash. options would just be length
pin - length x # - default length 4 if type is set to pin and length not set

type PassConfig struct {
    Type: string
    Length: int // used by multiple
    
    // Simple Fields
    Lower: boolean
    Upper: boolean
    // etc...

    // Words/Pin - may not need other than length
}

Things to keep in mind:

  1. Performance - It doesnt have to be the fastest thing in the world but lets be tight about allocation to generate a password
  2. Separate by types - the function should switch statement between the different private password function types
  3. Struct - lets keep it flat to help with lookup field mapping
  4. Can pass in nil and will set default. This keeps it simple if people just need whatever we give
  5. Breaking change - Update everything else that uses it and PR MERGE INTO V8 BRANCH! I will be merging other breaking changes there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions