A toy project for GCP Functions that generates xkcd-ish passwords.
There is nothing to install.
For a demo, try:
curl "https://generate-password-h5i3eq52qq-oa.a.run.app/"
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
'sstring.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
- Start the flask server
export FLASK_APP=local_test
export FLASK_ENV=development
flask run
- 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"
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.