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

Commit 7e897a5

Browse files
authored
chore(vault-github): Add partner github and tests (#142)
1 parent ac54966 commit 7e897a5

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

vault-github/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ display_name: Hashicorp Vault Integration (GitHub)
33
description: Authenticates with Vault using GitHub
44
icon: ../.icons/vault.svg
55
maintainer_github: coder
6+
partner_github: hashicorp
67
verified: true
78
tags: [helper, integration, vault, github]
89
---
@@ -14,7 +15,7 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec
1415
```tf
1516
module "vault" {
1617
source = "registry.coder.com/modules/vault-github/coder"
17-
version = "1.0.2"
18+
version = "1.0.3"
1819
agent_id = coder_agent.example.id
1920
vault_addr = "https://vault.example.com"
2021
}
@@ -23,13 +24,13 @@ module "vault" {
2324
Then you can use the Vault CLI in your workspaces to fetch secrets from Vault:
2425

2526
```shell
26-
vault kv get -mount=secret my-secret
27+
vault kv get -mount=coder my-secret
2728
```
2829

2930
or using the Vault API:
3031

3132
```shell
32-
curl -H "X-Vault-Token: ${VAULT_TOKEN}" -X GET "${VAULT_ADDR}/v1/secret/data/my-secret"
33+
curl -H "X-Vault-Token: ${VAULT_TOKEN}" -X GET "${VAULT_ADDR}/v1/coder/data/my-secret"
3334
```
3435

3536
![Vault login](../.images/vault-login.png)
@@ -45,7 +46,7 @@ To configure the Vault module, you must set up a Vault GitHub auth method. See t
4546
```tf
4647
module "vault" {
4748
source = "registry.coder.com/modules/vault-github/coder"
48-
version = "1.0.2"
49+
version = "1.0.3"
4950
agent_id = coder_agent.example.id
5051
vault_addr = "https://vault.example.com"
5152
coder_github_auth_id = "my-github-auth-id"
@@ -57,7 +58,7 @@ module "vault" {
5758
```tf
5859
module "vault" {
5960
source = "registry.coder.com/modules/vault-github/coder"
60-
version = "1.0.2"
61+
version = "1.0.3"
6162
agent_id = coder_agent.example.id
6263
vault_addr = "https://vault.example.com"
6364
coder_github_auth_id = "my-github-auth-id"
@@ -70,7 +71,7 @@ module "vault" {
7071
```tf
7172
module "vault" {
7273
source = "registry.coder.com/modules/vault-github/coder"
73-
version = "1.0.2"
74+
version = "1.0.3"
7475
agent_id = coder_agent.example.id
7576
vault_addr = "https://vault.example.com"
7677
vault_cli_version = "1.15.0"

vault-github/main.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { describe } from "bun:test";
2+
import { runTerraformInit, testRequiredVariables } from "../test";
3+
4+
describe("vault-token", async () => {
5+
await runTerraformInit(import.meta.dir);
6+
7+
testRequiredVariables(import.meta.dir, {
8+
agent_id: "foo",
9+
vault_addr: "foo",
10+
});
11+
});

vault-github/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ resource "coder_script" "vault" {
4949
display_name = "Vault (GitHub)"
5050
icon = "/icon/vault.svg"
5151
script = templatefile("${path.module}/run.sh", {
52-
VAULT_ADDR : var.vault_addr,
5352
AUTH_PATH : var.vault_github_auth_path,
5453
GITHUB_EXTERNAL_AUTH_ID : data.coder_external_auth.github.id,
5554
INSTALL_VERSION : var.vault_cli_version,

vault-github/run.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Convert all templated variables to shell variables
44
INSTALL_VERSION=${INSTALL_VERSION}
5-
VAULT_ADDR=${VAULT_ADDR}
65
GITHUB_EXTERNAL_AUTH_ID=${GITHUB_EXTERNAL_AUTH_ID}
76
AUTH_PATH=${AUTH_PATH}
87

@@ -92,8 +91,6 @@ if [ $? -ne 0 ]; then
9291
exit 1
9392
fi
9493

95-
export VAULT_ADDR="$${VAULT_ADDR}"
96-
9794
# Login to vault using the GitHub token
9895
printf "🔑 Logging in to Vault ...\n\n"
9996
vault login -no-print -method=github -path=/$${AUTH_PATH} token="$${GITHUB_TOKEN}"

0 commit comments

Comments
 (0)