Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

managedhsm: introducing dedicated Resource ID Parsers for the Data Plane Versioned and Versionless Key IDs #25601

Merged
merged 24 commits into from
May 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b3fa4ee
managedhsm: introducing dedicated Resource ID Parsers for the Data Pl…
tombuildsstuff Apr 12, 2024
b1cd355
`managedhsms`: updating the Resource ID parser for Managed HSM Role A…
tombuildsstuff Apr 17, 2024
696c135
`managedhsm`: refactoring the Managed HSM Role Assignment Resource
tombuildsstuff Apr 17, 2024
45644a6
`managedhsm`: updating the Parser tests/adding extra tests covering t…
tombuildsstuff Apr 17, 2024
64511e3
`managedhsm`: refactoring the Role Definition resource
tombuildsstuff Apr 19, 2024
a4f5003
`managedhsm`: refactoring the Managed HSM Role Definition Data Source
tombuildsstuff Apr 19, 2024
302f5ea
`managedhsm`: tests covering the Managed HSM Role Definition Data Source
tombuildsstuff Apr 19, 2024
3b1760e
`managedhsm`: implementing the helpers package
tombuildsstuff Apr 19, 2024
c9dfeab
`managedhsm`: populating the cache and removing during creation/deletion
tombuildsstuff Apr 19, 2024
34b033f
imports
tombuildsstuff Apr 19, 2024
d6ac8e5
managedhsm: move cache population into own method
manicminer Apr 23, 2024
0c922a0
managedhsm: validate port number if present in URI
manicminer Apr 23, 2024
a3a4fb5
managedhsm: test fixes, comments
manicminer Apr 23, 2024
5839d0a
managedhsm: azurerm_key_vault_managed_hardware_security_module test c…
manicminer Apr 23, 2024
ff65294
managedhsm: don't trim the scope when outputting role definition/assi…
manicminer Apr 26, 2024
759df85
managedhsm: eventual consistency workarounds for role definitions/ass…
manicminer Apr 26, 2024
ce56bbe
managedhsm: test for invalid port handling in ID migrations
manicminer Apr 26, 2024
301fd04
managedhsm: scope not a valid property for this resource
manicminer Apr 26, 2024
bd9873c
managedhsm: acceptance test fixes
manicminer Apr 26, 2024
f23428e
linting
manicminer Apr 26, 2024
553c0a2
managedhsm: base URI should have trailing slash
manicminer Apr 27, 2024
204e3e8
managedhsm: fix hsm role definition data source tests
manicminer Apr 29, 2024
f1337c1
Merge branch 'main' into f/managed-hsm-nested-items
katbyte May 1, 2024
bdb8162
remove check
katbyte May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
managedhsm: test for invalid port handling in ID migrations
manicminer committed Apr 26, 2024

Verified

This commit was signed with the committer’s verified signature.
manicminer Tom Bamford
commit ce56bbead738fb6f7476778ffdaaae6147d17ed0
Original file line number Diff line number Diff line change
@@ -48,6 +48,11 @@ func TestRoleAssignmentV0Parser(t *testing.T) {
roleAssignmentName: "test",
},
},
{
// Public - invalid port
input: "https://my-hsm.managedhsm.azure.net:445///RoleAssignment/test",
expected: nil,
},
{
input: "https://my-hsm.managedhsm.azure.cn///RoleAssignment/test",
expected: &legacyV0RoleAssignmentId{
Original file line number Diff line number Diff line change
@@ -48,6 +48,11 @@ func TestRoleDefinitionV0Parser(t *testing.T) {
roleDefinitionName: "test",
},
},
{
// Public - invalid port
input: "https://my-hsm.managedhsm.azure.net:445///RoleDefinition/test",
expected: nil,
},
{
input: "https://my-hsm.managedhsm.azure.cn///RoleDefinition/test",
expected: &legacyV0RoleDefinitionId{

Unchanged files with check annotations Beta

RoleDefinitionID: pointer.FromString(strings.TrimPrefix(config.RoleDefinitionId, "/")),
}
// TODO: @manicminer: when migrating to go-azure-sdk, the SDK should auto-retry on 400 responses with code "BadParameter" and message "Unkown role definition" (note the misspelling)

Check failure on line 200 in internal/services/managedhsm/key_vault_managed_hardware_security_module_role_assignment_resource.go

GitHub Actions / golint

`Unkown` is a misspelling of `Unknown` (misspell)
if _, err = client.Create(ctx, endpoint.BaseURI(), config.Scope, config.Name, param); err != nil {
return fmt.Errorf("creating %s: %v", id.ID(), err)