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

Commit 5c5cf8e

Browse files
authored
fix(vault-jwt): store vault token for use in vault jwt module (#435)
Co-authored-by: Birdie K <5210502+moo-im-a-cow@users.noreply.github.com>
1 parent fd2dec7 commit 5c5cf8e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

vault-jwt/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec
1616
module "vault" {
1717
count = data.coder_workspace.me.start_count
1818
source = "registry.coder.com/modules/vault-jwt/coder"
19-
version = "1.0.20"
19+
version = "1.0.21"
2020
agent_id = coder_agent.example.id
2121
vault_addr = "https://vault.example.com"
2222
vault_jwt_role = "coder" # The Vault role to use for authentication
@@ -43,7 +43,7 @@ curl -H "X-Vault-Token: ${VAULT_TOKEN}" -X GET "${VAULT_ADDR}/v1/coder/secrets/d
4343
module "vault" {
4444
count = data.coder_workspace.me.start_count
4545
source = "registry.coder.com/modules/vault-jwt/coder"
46-
version = "1.0.20"
46+
version = "1.0.21"
4747
agent_id = coder_agent.example.id
4848
vault_addr = "https://vault.example.com"
4949
vault_jwt_auth_path = "oidc"
@@ -59,7 +59,7 @@ data "coder_workspace_owner" "me" {}
5959
module "vault" {
6060
count = data.coder_workspace.me.start_count
6161
source = "registry.coder.com/modules/vault-jwt/coder"
62-
version = "1.0.20"
62+
version = "1.0.21"
6363
agent_id = coder_agent.example.id
6464
vault_addr = "https://vault.example.com"
6565
vault_jwt_role = data.coder_workspace_owner.me.groups[0]
@@ -72,7 +72,7 @@ module "vault" {
7272
module "vault" {
7373
count = data.coder_workspace.me.start_count
7474
source = "registry.coder.com/modules/vault-jwt/coder"
75-
version = "1.0.20"
75+
version = "1.0.21"
7676
agent_id = coder_agent.example.id
7777
vault_addr = "https://vault.example.com"
7878
vault_jwt_role = "coder" # The Vault role to use for authentication

vault-jwt/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@ rm -rf "$TMP"
107107

108108
# Authenticate with Vault
109109
printf "🔑 Authenticating with Vault ...\n\n"
110-
echo "$${CODER_OIDC_ACCESS_TOKEN}" | vault write auth/"$${VAULT_JWT_AUTH_PATH}"/login role="$${VAULT_JWT_ROLE}" jwt=-
110+
echo "$${CODER_OIDC_ACCESS_TOKEN}" | vault write -field=token auth/"$${VAULT_JWT_AUTH_PATH}"/login role="$${VAULT_JWT_ROLE}" jwt=- | vault login -
111111
printf "🥳 Vault authentication complete!\n\n"
112112
printf "You can now use Vault CLI to access secrets.\n"

0 commit comments

Comments
 (0)