Skip to content

Commit

Permalink
Aws auth support (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
4killo authored Aug 9, 2022
1 parent 0efda1e commit 3c0ab40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ provider "dsv" {
client_id = var.dsv_client_id
client_secret = var.dsv_client_secret
tenant = var.dsv_tenant
auth_provider = var.dsv_auth_provider
}

data "dsv_secret" "username" {
Expand Down
10 changes: 4 additions & 6 deletions provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ func providerConfig(d *schema.ResourceData) (interface{}, error) {
},
}

c.Provider = auth.CLIENT
if prvd, exists := d.GetOk("auth_provider"); exists {
switch strings.ToLower(prvd.(string)) {
case "aws":
c.Provider = auth.AWS
default:
c.Provider = auth.CLIENT
}
}
log.Printf("[DEBUG] auth provider is set to %+v", c.Provider)
Expand Down Expand Up @@ -61,19 +60,18 @@ func Provider() *schema.Provider {
},
"client_id": {
Type: schema.TypeString,
Required: true,
Optional: true,
Description: "The DevOps Secrets Vault client_id",
},
"client_secret": {
Type: schema.TypeString,
Sensitive: true,
Required: true,
Optional: true,
Description: "The DevOps Secrets Vault client_secret",
},
"auth_provider": {
Type: schema.TypeString,
Sensitive: true,
Required: false,
Optional: true,
Description: "The DevOps Secrets Vault auth_provider",
},
"tld": {
Expand Down

0 comments on commit 3c0ab40

Please sign in to comment.