Skip to content

Commit

Permalink
The get calls in the azure_key_vault_secret table should not fail for…
Browse files Browse the repository at this point in the history
… disabled secrets fixes #104 (#111)
  • Loading branch information
anisadas authored May 4, 2021
1 parent 8439e39 commit e809b3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion azure/table_azure_key_vault_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func tableAzureKeyVaultSecret(_ context.Context) *plugin.Table {
Get: &plugin.GetConfig{
KeyColumns: plugin.AllColumns([]string{"vault_name", "name"}),
Hydrate: getKeyVaultSecret,
ShouldIgnoreError: isNotFoundError([]string{"ResourceNotFound", "404"}),
ShouldIgnoreError: isNotFoundError([]string{"ResourceNotFound", "404", "SecretDisabled"}),
},
List: &plugin.ListConfig{
Hydrate: listKeyVaultSecrets,
Expand Down Expand Up @@ -201,6 +201,11 @@ func getKeyVaultSecret(ctx context.Context, d *plugin.QueryData, h *plugin.Hydra
splitID := strings.Split(*data.ID, "/")
vaultName = strings.Split(splitID[2], ".")[0]
name = splitID[4]

// Operation get is not allowed on a disabled secret
if !*data.Attributes.Enabled {
return nil, nil
}
} else {
vaultName = d.KeyColumnQuals["vault_name"].GetStringValue()
name = d.KeyColumnQuals["name"].GetStringValue()
Expand Down

0 comments on commit e809b3c

Please sign in to comment.