Categorygithub.com/domano/pwgen
repository
1.2.3
Repository: https://github.com/domano/pwgen.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

pwgen

Challenge: Create a password generating REST service

Docker Cloud Automated build Docker Cloud Build Status Docker Stars Build Status Reviewed by Hound

GoDoc Go Report Card codecov

GitHub GitHub tag (latest SemVer) GitHub last commit

API

Parameters

There is one endpoint /passwords with the following query parameters.

ParameterDescriptionDefault
minLengthThe minimum length of a password.0
specialCharsMinimum amount of special characters.0
numbersMinimum amount of numbers.0
amountNumber of passwords that will be returned1
swapBoolean value indicating if random vowels should be swapped for numbersfalse

Example:

Request /passwords?minLength=10&specialChars=3&numbers=3&amount=2

Response ["?!o\10wE9q", "h3{{v9BB3%"]

run

Following environment variables can be set

ENVDescriptionDefaultRequired
CERT_FILEPath to TLS cert file.cert.pemOnly for docker
KEY_FILEPath to TLS unencrypted key file.key.unencrypted.pemOnly for docker
PORTPort to listen on.8443No
GRACE_PERIODTimeout for graceful shutdown.5sNo

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