Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 407655b

Browse files
committed
update readme
1 parent 248c31c commit 407655b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

vault-jwt/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,42 @@ module "vault" {
143143
vault_jwt_token = jwt_signed_token.vault[0].token
144144
}
145145
```
146+
#### example vault jwt role
147+
```
148+
vault write auth/<JWT_MOUNT>/role/workspace -<<EOF
149+
{
150+
"user_claim": "sub",
151+
"bound_audiences": "https://vault.example.com",
152+
"role_type": "jwt",
153+
"ttl": "1h",
154+
"claim_mappings": {
155+
"owner": "owner",
156+
"owner_email": "owner_email",
157+
"owner_login_type": "owner_login_type",
158+
"owner_name": "owner_name",
159+
"provisioner": "provisioner",
160+
"provisioner_arch": "provisioner_arch",
161+
"provisioner_os": "provisioner_os",
162+
"sub": "sub",
163+
"template": "template",
164+
"template_name": "template_name",
165+
"template_version": "template_version",
166+
"workspace": "workspace",
167+
"workspace_name": "workspace_name",
168+
"workspace_id": "workspace_id"
169+
}
170+
}
171+
EOF
172+
```
173+
#### example workspace access vault policy
174+
```hcl
175+
path "kv/data/app/coder/{{identity.entity.aliases.<MOUNT_ACCESSOR>.metadata.owner_name}}/{{identity.entity.aliases.<MOUNT_ACCESSOR>.metadata.workspace_name}}" {
176+
capabilities = ["create", "read", "update", "delete", "list", "subscribe"]
177+
subscribe_event_types = ["*"]
178+
}
179+
path "kv/metadata/app/coder/{{identity.entity.aliases.<MOUNT_ACCESSOR>.metadata.owner_name}}/{{identity.entity.aliases.<MOUNT_ACCESSOR>.metadata.workspace_name}}" {
180+
capabilities = ["create", "read", "update", "delete", "list", "subscribe"]
181+
subscribe_event_types = ["*"]
182+
}
183+
```
184+

0 commit comments

Comments
 (0)