Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
Make basic-auth optional
Browse files Browse the repository at this point in the history
- This is a feature flag depending on the env-var "basic_auth"

Signed-off-by: Alex Ellis (VMware) <[email protected]>
  • Loading branch information
alexellis committed Sep 10, 2018
1 parent 3795853 commit c2fcde9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func main() {
WriteTimeout: cfg.WriteTimeout,
TCPPort: &cfg.TCPPort,
EnableHealth: true,
EnableBasicAuth: true,
EnableBasicAuth: cfg.EnableBasicAuth,
SecretMountPath: "/run/secrets",
}

Expand Down
9 changes: 6 additions & 3 deletions types/read_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ func (ReadConfig) Read(hasEnv HasEnv) BootstrapConfig {
cfg.ReadTimeout = readTimeout
cfg.WriteTimeout = writeTimeout

cfg.EnableBasicAuth = parseBoolValue("basic_auth", false)

return cfg
}

// BootstrapConfig for the process.
type BootstrapConfig struct {
ReadTimeout time.Duration
WriteTimeout time.Duration
TCPPort int
ReadTimeout time.Duration
WriteTimeout time.Duration
TCPPort int
EnableBasicAuth bool
}

0 comments on commit c2fcde9

Please sign in to comment.