https://github.com/domano/pwgen
Challenge: Create a password generating REST service
https://github.com/domano/pwgen
challenge docker generator go golang microservice password security
Last synced: 6 months ago
JSON representation
Challenge: Create a password generating REST service
- Host: GitHub
- URL: https://github.com/domano/pwgen
- Owner: domano
- License: mit
- Created: 2019-05-14T11:46:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-19T13:23:28.000Z (almost 6 years ago)
- Last Synced: 2025-10-04T17:57:09.513Z (6 months ago)
- Topics: challenge, docker, generator, go, golang, microservice, password, security
- Language: Go
- Size: 5.51 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pwgen
Challenge: Create a password generating REST service
[](https://cloud.docker.com/repository/docker/domano/pwgen)
[](https://cloud.docker.com/repository/docker/domano/pwgen)

[](https://travis-ci.org/domano/pwgen)
[](https://houndci.com)
[](http://godoc.org/github.com/domano/pwgen/internal)
[](https://goreportcard.com/report/github.com/domano/pwgen)
[](https://codecov.io/gh/domano/pwgen)



# API
## Parameters
There is one endpoint `/passwords` with the following query parameters.
| Parameter | Description | Default |
| --- | --- | --- |
| minLength | The minimum length of a password.| 0|
| specialChars| Minimum amount of special characters. | 0 |
| numbers | Minimum amount of numbers. | 0 |
| amount | Number of passwords that will be returned | 1 |
| swap | Boolean value indicating if random vowels should be swapped for numbers | false |
### Example:
Request `/passwords?minLength=10&specialChars=3&numbers=3&amount=2`
Response `["?!o\10wE9q", "h3{{v9BB3%"]`
## run
Following environment variables can be set
| ENV | Description | Default | Required |
|--- |--- |--- |--- |
| CERT_FILE | Path to TLS cert file. | cert.pem | Only for docker |
| KEY_FILE | Path to TLS unencrypted key file. | key.unencrypted.pem | Only for docker |
| PORT | Port to listen on. | 8443 | No |
| GRACE_PERIOD | Timeout for graceful shutdown. | 5s | No |
### docker
You can easily run pwgen with the publicly available docker image.
Because this is a password generator only HTTPS is supported and a TLS certificate and key must be provided.
Example with latest public image:
`docker run -v $(pwd):/certs -e CERT_FILE=/certs/cert.pem -e KEY_FILE=/certs/key.unencrypted.pem domano/pwgen`
### locally
`go run cmd/pwgen/main.go`