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

Add allowed_uri_sans_template #10249

Merged
merged 3 commits into from Dec 15, 2021
Merged

Conversation

pbohman
Copy link
Contributor

@pbohman pbohman commented Oct 27, 2020

Enables identity templating for the allowed_uri_sans field in PKI cert roles.

Implemented as suggested in #8509

@ropnop
Copy link

ropnop commented Sep 30, 2021

Following! This is a feature we really want to use, I spent the morning trying to make something work and then saw this PR 👍

@harsimranmaan
Copy link
Contributor

Exactly what I have been looking for. @pbohman Do you want to rebase the PR?

harsimranmaan added a commit to harsimranmaan/terraform-provider-vault that referenced this pull request Oct 1, 2021
This PR requires hashicorp/vault#10249 to be merged.
One test is right failing until the feature is released in vault.

The following test shall pass when teh feature lands on vault

```bash
TESTARGS="-run TestPkiSecretBackendRole" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./...) -v -run TestPkiSecretBackendRole -timeout 20m
?       github.com/hashicorp/terraform-provider-vault   [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/coverage      [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/generate      [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/codegen   (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/generated [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/decode    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/encode    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/alphabet    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/role        (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/template    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/transformation      (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/helper    [no test files]
?       github.com/hashicorp/terraform-provider-vault/schema    [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/util      (cached) [no tests to run]
=== RUN   TestPkiSecretBackendRole_basic
    resource_pki_secret_backend_role_test.go:16: Step 2/2 error: Check failed: Check 19/47 error: vault_pki_secret_backend_role.test: Attribute 'allowed_uri_sans_template' expected "true", got "false"
--- FAIL: TestPkiSecretBackendRole_basic (4.00s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-vault/vault     4.255s
FAIL
make: *** [testacc] Error 1
```
harsimranmaan added a commit to harsimranmaan/terraform-provider-vault that referenced this pull request Oct 1, 2021
This PR requires hashicorp/vault#10249 to be merged.
One test is right failing until the feature is released in vault.

The following test shall pass when teh feature lands on vault

```bash
TESTARGS="-run TestPkiSecretBackendRole" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./...) -v -run TestPkiSecretBackendRole -timeout 20m
?       github.com/hashicorp/terraform-provider-vault   [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/coverage      [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/generate      [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/codegen   (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/generated [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/decode    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/encode    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/alphabet    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/role        (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/template    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/transformation      (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/helper    [no test files]
?       github.com/hashicorp/terraform-provider-vault/schema    [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/util      (cached) [no tests to run]
=== RUN   TestPkiSecretBackendRole_basic
    resource_pki_secret_backend_role_test.go:16: Step 2/2 error: Check failed: Check 19/47 error: vault_pki_secret_backend_role.test: Attribute 'allowed_uri_sans_template' expected "true", got "false"
--- FAIL: TestPkiSecretBackendRole_basic (4.00s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-vault/vault     4.255s
FAIL
make: *** [testacc] Error 1
```
@harsimranmaan
Copy link
Contributor

@pbohman hey Pete, thanks for your contribution. Do you want to rebase the PR and resolve the merge conflict?

Enables identity templating for the allowed_uri_sans field in PKI cert roles.

Implemented as suggested in hashicorp#8509
@vercel vercel bot temporarily deployed to Preview – vault October 16, 2021 01:00 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 16, 2021 01:00 Inactive
harsimranmaan added a commit to harsimranmaan/terraform-provider-vault that referenced this pull request Oct 26, 2021
This PR requires hashicorp/vault#10249 to be merged.
One test is right failing until the feature is released in vault.

The following test shall pass when teh feature lands on vault

```bash
TESTARGS="-run TestPkiSecretBackendRole" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./...) -v -run TestPkiSecretBackendRole -timeout 20m
?       github.com/hashicorp/terraform-provider-vault   [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/coverage      [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/generate      [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/codegen   (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/generated [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/decode    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/encode    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/alphabet    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/role        (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/template    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/transformation      (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/helper    [no test files]
?       github.com/hashicorp/terraform-provider-vault/schema    [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/util      (cached) [no tests to run]
=== RUN   TestPkiSecretBackendRole_basic
    resource_pki_secret_backend_role_test.go:16: Step 2/2 error: Check failed: Check 19/47 error: vault_pki_secret_backend_role.test: Attribute 'allowed_uri_sans_template' expected "true", got "false"
--- FAIL: TestPkiSecretBackendRole_basic (4.00s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-vault/vault     4.255s
FAIL
make: *** [testacc] Error 1
```
@harsimranmaan
Copy link
Contributor

@hsimon-hashicorp Any chance that this could be prioritized?

@hsimon-hashicorp
Copy link
Contributor

@harsimranmaan Thanks for bubbling this up! I'll get a reviewer as soon as I can. Thanks!

Copy link
Contributor

@schultz-is schultz-is left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Howdy @pbohman, thanks for the contribution! This looks functionally great. In order to get this merged in, can we get a changelog entry (changelog/10249.txt)?

@hsimon-hashicorp
Copy link
Contributor

Howdy @pbohman, thanks for the contribution! This looks functionally great. In order to get this merged in, can we get a changelog entry (changelog/10249.txt)?

Also, if we can get a documentation update PR (a new PR is fine), if it's needed, that'd be great :)

@vercel vercel bot temporarily deployed to Preview – vault-storybook December 15, 2021 13:56 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook December 15, 2021 14:07 Inactive
@pbohman
Copy link
Contributor Author

pbohman commented Dec 15, 2021

@schultz-is, @hsimon-hashicorp, @harsimranmaan, thanks for the review and pushing this forward. The changelog and docs have been updated.

@schultz-is
Copy link
Contributor

Thanks for contributing this, @pbohman!

@schultz-is schultz-is merged commit 19ef44e into hashicorp:main Dec 15, 2021
harsimranmaan added a commit to harsimranmaan/terraform-provider-vault that referenced this pull request Dec 21, 2021
This PR requires hashicorp/vault#10249 to be merged.
One test is right failing until the feature is released in vault.

The following test shall pass when teh feature lands on vault

```bash
TESTARGS="-run TestPkiSecretBackendRole" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./...) -v -run TestPkiSecretBackendRole -timeout 20m
?       github.com/hashicorp/terraform-provider-vault   [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/coverage      [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/generate      [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/codegen   (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/generated [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/decode    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/encode    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/alphabet    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/role        (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/template    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/transformation      (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/helper    [no test files]
?       github.com/hashicorp/terraform-provider-vault/schema    [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/util      (cached) [no tests to run]
=== RUN   TestPkiSecretBackendRole_basic
    resource_pki_secret_backend_role_test.go:16: Step 2/2 error: Check failed: Check 19/47 error: vault_pki_secret_backend_role.test: Attribute 'allowed_uri_sans_template' expected "true", got "false"
--- FAIL: TestPkiSecretBackendRole_basic (4.00s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-vault/vault     4.255s
FAIL
make: *** [testacc] Error 1
```
heppu pushed a commit to heppu/vault that referenced this pull request Jan 13, 2022
* Add allowed_uri_sans_template

Enables identity templating for the allowed_uri_sans field in PKI cert roles.

Implemented as suggested in hashicorp#8509

* changelog++

* Update docs with URI SAN templating
joatmon08 pushed a commit that referenced this pull request Jan 25, 2022
* Add allowed_uri_sans_template

Enables identity templating for the allowed_uri_sans field in PKI cert roles.

Implemented as suggested in #8509

* changelog++

* Update docs with URI SAN templating
qk4l pushed a commit to qk4l/vault that referenced this pull request Feb 4, 2022
* Add allowed_uri_sans_template

Enables identity templating for the allowed_uri_sans field in PKI cert roles.

Implemented as suggested in hashicorp#8509

* changelog++

* Update docs with URI SAN templating
@dovys
Copy link

dovys commented Feb 4, 2022

Thanks for adding this ❤️ We just ran into this issue at @monzo trying to template spiffe:// SANs. Any chance we could get this released as a new tag? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants