Skip to content

Commit

Permalink
allow disable basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
lu1as committed Mar 21, 2022
1 parent 7204a5c commit 07b358c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions terraform/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func Authenticate(req *http.Request, s *terraform.State) (ok bool, err error) {
var authenticator Authenticator
switch backend {
case "basic":
viper.SetDefault("auth_basic_enabled", true)
if !viper.GetBool("auth_basic_enabled") {
return false, fmt.Errorf("basic auth is not enabled")
}
authenticator = basic.NewBasicAuth()
case "jwt":
issuerURL := viper.GetString("auth_jwt_oidc_issuer_url")
Expand Down
2 changes: 0 additions & 2 deletions terraform/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ func GetStorage() (s Storage, err error) {
case "s3":
viper.SetDefault("storage_s3_endpoint", "s3.amazonaws.com")
viper.SetDefault("storage_s3_use_ssl", true)
viper.SetDefault("storage_s3_access_key", "access-key-id")
viper.SetDefault("storage_s3_secret_key", "secret-access-key")
viper.SetDefault("storage_s3_bucket", "terraform-state")

endpoint := viper.GetString("storage_s3_endpoint")
Expand Down

0 comments on commit 07b358c

Please sign in to comment.