Skip to content

Latest commit

 

History

History
82 lines (55 loc) · 2.04 KB

README.md

File metadata and controls

82 lines (55 loc) · 2.04 KB

Password Generator

A toy project for GCP Functions that generates xkcd-ish passwords.

Requirements

Installation

There is nothing to install.

Usage

Live Demo

For a demo, try:

curl "https://generate-password-h5i3eq52qq-oa.a.run.app/"

Parameters

None of the parameters are required.

Key Type Default
word_counta,b int 2
delimiterc,d str '-'
contains_number bool True
title_case bool True
report_entropies bool False
report_params bool False
  • a All are 5-letter words; the list is in words.py.
  • b Must be in range (1,10).
  • c Must be a single character.
  • d Must be either a space or in Python's string.punctuation.

For example, to generate a password similar to xkcd's comic, you can set the following options:

Key Value
word_count 4
delimiter ' '
contains_number False
title_case False
GET <domain:port>/generate_password?word_count=4&delimiter= &contains_number=False&title_case=False

Run locally (for debug purposes)

  1. Start the flask server
export FLASK_APP=local_test
export FLASK_ENV=development
flask run
  1. Exceute requests:
# default
wget -qO- "http://127.0.0.1:5000/generate_password"
# spiced up
wget -qO- "http://127.0.0.1:5000/generate_password?word_count=4&delimiter= &contains_number=False&title_case=False&report_entropies=True&report_params=True"

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT