-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…28788) * bump terraform-plugin-sdk version to v2.36.0, add a write only test template and helper * update explanatory comments for test template and write only helper and convert ephemeral resource tests to parallel running tests * test template indentation Co-authored-by: jackofallops <11830746+jackofallops@users.noreply.github.com> --------- Co-authored-by: jackofallops <11830746+jackofallops@users.noreply.github.com>
- Loading branch information
1 parent
e51db7d
commit fd43684
Showing
228 changed files
with
12,540 additions
and
5,923 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package acceptance | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// WriteOnlyKeyVaultSecretTemplate is a testing template specific for write-only attributes. | ||
// It provisions a Key Vault, a Key Vault secret, and references the secret using the Key Vault Secret | ||
// ephemeral resource. | ||
func WriteOnlyKeyVaultSecretTemplate(data TestData, secret string) string { | ||
return fmt.Sprintf(` | ||
data "azurerm_client_config" "current" {} | ||
resource "azurerm_key_vault" "test" { | ||
name = "acctestkv-%[1]s" | ||
location = azurerm_resource_group.test.location | ||
resource_group_name = azurerm_resource_group.test.name | ||
tenant_id = data.azurerm_client_config.current.tenant_id | ||
sku_name = "standard" | ||
soft_delete_retention_days = 7 | ||
access_policy { | ||
tenant_id = data.azurerm_client_config.current.tenant_id | ||
object_id = data.azurerm_client_config.current.object_id | ||
key_permissions = [ | ||
"Get", | ||
] | ||
secret_permissions = [ | ||
"Get", | ||
"Delete", | ||
"List", | ||
"Purge", | ||
"Recover", | ||
"Set", | ||
] | ||
} | ||
} | ||
resource "azurerm_key_vault_secret" "test" { | ||
name = "secret-%[1]s" | ||
value = "%[2]s" | ||
key_vault_id = azurerm_key_vault.test.id | ||
} | ||
ephemeral "azurerm_key_vault_secret" "test" { | ||
name = azurerm_key_vault_secret.test.name | ||
key_vault_id = azurerm_key_vault.test.id | ||
} | ||
`, data.RandomString, secret) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -559,7 +559,6 @@ resource "azurerm_key_vault" "test" { | |
"Recover", | ||
"Set", | ||
] | ||
} | ||
tags = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package pluginsdk | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/go-azure-helpers/lang/pointer" | ||
"github.com/hashicorp/go-cty/cty" | ||
) | ||
|
||
// GetWriteOnly gets a write only attribute, checking that it is of an expected type and subsequently returns it | ||
func GetWriteOnly(d *ResourceData, name string, attributeType cty.Type) (*cty.Value, error) { | ||
value, diags := d.GetRawConfigAt(cty.GetAttrPath(name)) | ||
if diags.HasError() { | ||
return nil, fmt.Errorf("retrieving write-only attribute `%s`: %+v", name, diags) | ||
} | ||
|
||
if !value.Type().Equals(attributeType) { | ||
return nil, fmt.Errorf("retrieving write-only attribute `%s`: value is not of type %v", name, attributeType) | ||
} | ||
return pointer.To(value), nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
45 changes: 41 additions & 4 deletions
45
vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 4 additions & 2 deletions
6
vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve_info.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 9 additions & 1 deletion
10
vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed25519.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 9 additions & 1 deletion
10
vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed448.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.