Skip to content

Commit f7fe895

Browse files
committed
chore: use vault naming in environment variables
Signed-off-by: Francesco Noacco <francesco.noacco@secomind.com>
1 parent 8f9b1d8 commit f7fe895

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ VERNEMQ_ENABLE_SSL_LISTENER=true
2020
CLUSTERING_STRATEGY=docker-compose
2121
RELEASE_COOKIE=astarte-docker-compose
2222

23-
ASTARTE_OPENBAO_AUTHENTICATION_MECHANISM="token"
24-
ASTARTE_OPENBAO_TOKEN="astarte_token"
23+
ASTARTE_VAULT_AUTHENTICATION_MECHANISM="token"
24+
ASTARTE_VAULT_TOKEN="astarte_token"
2525

2626
PAIRING_ENABLE_FDO=true
2727
ASTARTE_BASE_URL_PORT=50000

.github/workflows/astarte-apps-build-workflow.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- warmup
7676
runs-on: ubuntu-22.04
7777
env:
78-
ASTARTE_OPENBAO_TOKEN: "astarte_token"
78+
ASTARTE_VAULT_TOKEN: "astarte_token"
7979
strategy:
8080
fail-fast: false
8181
matrix:
@@ -110,7 +110,7 @@ jobs:
110110
ports:
111111
- 8200:8200
112112
env:
113-
BAO_DEV_ROOT_TOKEN_ID: ${{ env.ASTARTE_OPENBAO_TOKEN }}
113+
BAO_DEV_ROOT_TOKEN_ID: ${{ env.ASTARTE_VAULT_TOKEN }}
114114
BAO_DEV_LISTEN_ADDRESS: "0.0.0.0:8200"
115115
options: >-
116116
--health-cmd "bao status -address=http://127.0.0.1:8200 || exit 1"

.github/workflows/astarte-libs-build-workflow.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
- warmup
7979
runs-on: ubuntu-22.04
8080
env:
81-
ASTARTE_OPENBAO_TOKEN: "astarte_token"
81+
ASTARTE_VAULT_TOKEN: "astarte_token"
8282
strategy:
8383
fail-fast: false
8484
matrix:
@@ -112,7 +112,7 @@ jobs:
112112
ports:
113113
- 8200:8200
114114
env:
115-
BAO_DEV_ROOT_TOKEN_ID: ${{ env.ASTARTE_OPENBAO_TOKEN }}
115+
BAO_DEV_ROOT_TOKEN_ID: ${{ env.ASTARTE_VAULT_TOKEN }}
116116
BAO_DEV_LISTEN_ADDRESS: "0.0.0.0:8200"
117117
options: >-
118118
--health-cmd "bao status -address=http://127.0.0.1:8200 || exit 1"

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ services:
6868
ASTARTE_BASE_URL_PROTOCOL: "http"
6969
PAIRING_FDO_RENDEZVOUS_URL: "http://rendezvous:8041"
7070
PAIRING_FDO_ENABLE_CREDENTIAL_REUSE: true
71-
ASTARTE_OPENBAO_URL: "http://openbao:8200"
71+
ASTARTE_VAULT_URL: "http://openbao:8200"
7272
restart: on-failure
7373
# TODO: add a health check for all services
7474
depends_on:
@@ -231,7 +231,7 @@ services:
231231
- BAO_ADDR=http://0.0.0.0:8200
232232
ports:
233233
- 8200:8200
234-
command: server -dev -dev-listen-address="0.0.0.0:8200" -dev-root-token-id="${ASTARTE_OPENBAO_TOKEN}"
234+
command: server -dev -dev-listen-address="0.0.0.0:8200" -dev-root-token-id="${ASTARTE_VAULT_TOKEN}"
235235
healthcheck:
236236
test: ["CMD", "bao", "status", "-address=http://127.0.0.1:8200"]
237237
interval: 2s
@@ -247,7 +247,7 @@ services:
247247
condition: service_healthy
248248
environment:
249249
- BAO_ADDR=http://openbao:8200
250-
- BAO_TOKEN=${ASTARTE_OPENBAO_TOKEN}
250+
- BAO_TOKEN=${ASTARTE_VAULT_TOKEN}
251251
command: bao secrets enable transit
252252

253253
rendezvous:

libs/astarte_secrets/lib/astarte_secrets/config/config.ex

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,50 +26,50 @@ defmodule Astarte.Secrets.Config do
2626
alias Astarte.Secrets.Config
2727
alias Astarte.Secrets.Config.AuthenticationMechanism
2828

29-
@envdoc "The URL to access OpenBao."
29+
@envdoc "The URL to access Vault."
3030
app_env :bao_url, :astarte_secrets, :bao_url,
31-
os_env: "ASTARTE_OPENBAO_URL",
31+
os_env: "ASTARTE_VAULT_URL",
3232
type: :binary,
3333
default: "http://localhost:8200"
3434

35-
@envdoc "Internal variable used to store bao authentication"
35+
@envdoc "Internal variable used to store Vault authentication"
3636
app_env :bao_authentication, :astarte_secrets, :bao_authentication,
3737
binding_skip: [:system],
3838
type: :any
3939

40-
@envdoc "The mechanism to use for authenticating with OpenBao"
40+
@envdoc "The mechanism to use for authenticating with Vault"
4141
app_env :bao_authentication_mechanism, :astarte_secrets, :bao_authentication_mechanism,
42-
os_env: "ASTARTE_OPENBAO_AUTHENTICATION_MECHANISM",
42+
os_env: "ASTARTE_VAULT_AUTHENTICATION_MECHANISM",
4343
type: AuthenticationMechanism
4444

45-
@envdoc "Token to authenticate with OpenBao"
45+
@envdoc "Token to authenticate with Vault"
4646
app_env :bao_token, :astarte_secrets, :bao_token,
47-
os_env: "ASTARTE_OPENBAO_TOKEN",
47+
os_env: "ASTARTE_VAULT_TOKEN",
4848
type: :binary
4949

50-
@envdoc "Enable SSL for the OpenBao connection. If not specified, SSL is disabled."
50+
@envdoc "Enable SSL for the Vault connection. If not specified, SSL is disabled."
5151
app_env :bao_ssl_enabled, :astarte_secrets, :bao_ssl_enabled,
52-
os_env: "ASTARTE_OPENBAO_SSL_ENABLED",
52+
os_env: "ASTARTE_VAULT_SSL_ENABLED",
5353
type: :boolean,
5454
default: false
5555

5656
@envdoc """
57-
Specifies the certificates of the root Certificate Authorities to be trusted for the OpenBao connection. When not specified, the bundled cURL certificate bundle will be used.
57+
Specifies the certificates of the root Certificate Authorities to be trusted for the Vault connection. When not specified, the bundled cURL certificate bundle will be used.
5858
"""
5959
app_env :bao_ssl_ca_file, :astarte_secrets, :bao_ssl_ca_file,
60-
os_env: "ASTARTE_OPENBAO_SSL_CA_FILE",
60+
os_env: "ASTARTE_VAULT_SSL_CA_FILE",
6161
type: :binary,
6262
default: CAStore.file_path()
6363

64-
@envdoc "Disable Server Name Indication. Defaults to false."
64+
@envdoc "Disable Server Name Indication for Vault. Defaults to false."
6565
app_env :bao_ssl_disable_sni, :astarte_secrets, :bao_ssl_disable_sni,
66-
os_env: "ASTARTE_OPENBAO_SSL_DISABLE_SNI",
66+
os_env: "ASTARTE_VAULT_SSL_DISABLE_SNI",
6767
type: :boolean,
6868
default: false
6969

70-
@envdoc "Specify the hostname to be used in TLS Server Name Indication extension. If not specified, the amqp consumer host will be used. This value is used only if Server Name Indication is enabled."
70+
@envdoc "Specify the hostname to be used in TLS Server Name Indication extension for Vault. If not specified, the Vault host will be used. This value is used only if Server Name Indication is enabled."
7171
app_env :bao_ssl_custom_sni, :astarte_secrets, :bao_ssl_custom_sni,
72-
os_env: "ASTARTE_OPENBAO_SSL_CUSTOM_SNI",
72+
os_env: "ASTARTE_VAULT_SSL_CUSTOM_SNI",
7373
type: :binary
7474

7575
def bao_ssl_options! do
@@ -116,11 +116,11 @@ defmodule Astarte.Secrets.Config do
116116
defp parse_bao_authentication! do
117117
case Config.bao_authentication_mechanism!() do
118118
nil ->
119-
raise "OpenBao authentication method not set"
119+
raise "Vault authentication method not set"
120120

121121
:token ->
122122
case Config.bao_token!() do
123-
nil -> raise "OpenBao token not set"
123+
nil -> raise "Vault token not set"
124124
token -> {:token, token}
125125
end
126126
end

0 commit comments

Comments
 (0)