You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug]: organization field in vault_pki_secret_backend_root_cert is mismatched with subject filed in certificate generated byVault HTTP API if the value has a comma
#2381
Open
mitsutaka opened this issue
Dec 12, 2024
· 0 comments
specifies the O (Organization) values in the subject field of the resulting certificate. This is a comma-separated string or JSON array.
organization parameter in Vault HTTP API accepths either comma-separated string or JSON array. For example, If we set "Company, Inc.", Subject in the generated root certificate will have O=Inc. and O=Company.
As Vault HTTP endpoints accepts JSON array in organization parameter, we can create a correct comma-included organization by using single JSON array. but TFVP can't handle the JSON format because it parses as string
mitsutaka
changed the title
[Bug]: organization field in vault_pki_secret_backend_root_cert is mismatched with Vault HTTP API that splits it to multiple "O"s if the value has a comma
[Bug]: organization field in vault_pki_secret_backend_root_cert is mismatched with subject filed in certificate generated byVault HTTP API if the value has a comma
Dec 12, 2024
Terraform Core Version
1.10.2
Terraform Vault Provider Version
4.1.0
Vault Server Version
1.18.2
Affected Resource(s)
https://developer.hashicorp.com/vault/api-docs/secret/pki#organization
organization parameter in Vault HTTP API accepths either comma-separated string or JSON array. For example, If we set "Company, Inc.", Subject in the generated root certificate will have
O=Inc.
andO=Company
.terraform-provider-vault/vault/resource_pki_secret_backend_cert_test.go
Line 311 in 78f2eda
Als, we should test a generated subject fields is matched with requested terraform resource fields.
Expected Behavior
Organization in generated certificate should have O="Company, Inc." instead of splitted organizations.
Actual Behavior
Organization in generated certificate has multiple organization(O) fields if a
organization
field has a comma. such as O="Inc.", O="Company".Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
As Vault HTTP endpoints accepts JSON array in
organization
parameter, we can create a correct comma-included organization by using single JSON array. but TFVP can't handle the JSON format because it parses as stringterraform-provider-vault/vault/resource_pki_secret_backend_root_cert.go
Line 232 in 78f2eda
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: