Skip to content

include description field for user tokens#84

Merged
fairclothjm merged 2 commits intohashicorp:mainfrom
drewmullen:main
Mar 13, 2025
Merged

include description field for user tokens#84
fairclothjm merged 2 commits intohashicorp:mainfrom
drewmullen:main

Conversation

@drewmullen
Copy link
Contributor

@drewmullen drewmullen commented Mar 10, 2025

closes: #83

Description is not supported by Org or Team tokens. Only implemented for user tokens

CGO_ENABLED=0 VAULT_TOKEN= VAULT_ACC=1 go test -v -tags='vault-plugin-secrets-terraform' $(go list ./... | grep -v /vendor/ | grep -v /integ) --run=TestUserRole -count=1 -timeout=10m -parallel=4
?   	github.com/hashicorp/vault-plugin-secrets-terraform/cmd/vault-plugin-secrets-terraform	[no test files]
=== RUN   TestUserRole
=== RUN   TestUserRole/Create_User_Role_-_fail
=== RUN   TestUserRole/Create_User_Role_-_pass
=== RUN   TestUserRole/Read_User_Role
=== RUN   TestUserRole/Update_User_Role
=== RUN   TestUserRole/Re-read_User_Role
--- PASS: TestUserRole (0.00s)
    --- PASS: TestUserRole/Create_User_Role_-_fail (0.00s)
    --- PASS: TestUserRole/Create_User_Role_-_pass (0.00s)
    --- PASS: TestUserRole/Read_User_Role (0.00s)
    --- PASS: TestUserRole/Update_User_Role (0.00s)
    --- PASS: TestUserRole/Re-read_User_Role (0.00s)
PASS
ok  	github.com/hashicorp/vault-plugin-secrets-terraform	0.264s

running tests locally:

$ vault write sys/plugins/catalog/terraform sha256="414b412a4f024195d4585c1942be9ea8354c281eaeb0ed72ab318477a9d80793" command="vault-plugin-secrets-terraform"
$ vault secrets enable -plugin-name='terraform' plugin
$ vault write terraform/config token=$TFE_TOKEN
$ vault write terraform/role/tfc-mgmt user_id=user-<redacted> ttl=7200 description="test description"
$ vault read terraform/role/tfc-mgmt
Key            Value
---            -----
description    test description
max_ttl        0s
name           tfc-mgmt
ttl            2h
user_id        user-<redacted>
Screenshot 2025-03-10 at 4 05 29 PM

@drewmullen drewmullen requested a review from a team as a code owner March 10, 2025 20:11
@fairclothjm fairclothjm merged commit b7ac127 into hashicorp:main Mar 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Allow specifying description during role definition

2 participants