diff --git a/README.md b/README.md index 7dbd9e0..c5bd138 100644 --- a/README.md +++ b/README.md @@ -107,11 +107,11 @@ Each JSON configuration file for the gateways can specify detailed settings for ``` ## Authentication -Basic authentication can be enabled using the `--basic-auth` flag. The username and password should be set through environment variables `GATEWAY_USERNAME` and `GATEWAY_PASSWORD`, respectively. +Basic authentication can be enabled using the `--auth` flag. The username and password should be set through environment variables `GATEWAY_USERNAME` and `GATEWAY_PASSWORD`, respectively. ### Running the Application To run the application with authentication: ``` -DEBUG=true GATEWAY_USERNAME=myuser GATEWAY_PASSWORD=mypass go run . --config config.json --basic-auth +DEBUG=true GATEWAY_USERNAME=myuser GATEWAY_PASSWORD=mypass go run . --config config.json --auth ``` diff --git a/main.go b/main.go index 470e544..ae3541f 100644 --- a/main.go +++ b/main.go @@ -59,7 +59,7 @@ func main() { Value: false, }, &cli.BoolFlag{ - Name: "basic-auth", + Name: "auth", Usage: "Enable basic authentication.", Value: false, }, @@ -79,7 +79,7 @@ func main() { r.Use(middleware.Recoverer) r.Use(middleware.Heartbeat("/health")) // Add basic auth middleware - if cc.Bool("basic-auth") { + if cc.Bool("auth") { username := os.Getenv("GATEWAY_USERNAME") password := os.Getenv("GATEWAY_PASSWORD") if username == "" || password == "" {