How to use the xkcdpass.xkcd_password.validate_options function in xkcdpass

To help you get started, we’ve selected a few xkcdpass examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrynMawrCollege / jupyterhub / accounts.py View on Github external
def make_password(arg_string=None):
    if arg_string is None:
        arg_string = "-w safe6 -n 4 --min 1 --max=6"
    argv = arg_string.split()
    parser = xkcd_password.XkcdPassArgumentParser(prog="xkcdpass")

    options = parser.parse_args(argv)
    xkcd_password.validate_options(parser, options)

    my_wordlist = xkcd_password.generate_wordlist(
        wordfile=options.wordfile,
        min_length=options.min_length,
        max_length=options.max_length,
        valid_chars=options.valid_chars)

    if options.verbose:
        xkcd_password.verbose_reports(my_wordlist, options)

    return xkcd_password.generate_xkcdpassword(
        my_wordlist,
        interactive=options.interactive,
        numwords=options.numwords,
        acrostic=options.acrostic,
        delimiter=options.delimiter)