Skip to content

Commit 1ba8e0e

Browse files
committed
test: add bindle keyring & secret keys
Signed-off-by: Frank Yang <[email protected]>
1 parent d84b52d commit 1ba8e0e

File tree

8 files changed

+72
-40
lines changed

8 files changed

+72
-40
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
extension: "",
2626
# We have this enabled for releases, so we should test it.
2727
extraArgs: "--features openssl/vendored",
28-
bindleUrl: "https://bindle.blob.core.windows.net/releases/bindle-v0.8.0-linux-amd64.tar.gz",
28+
bindleUrl: "https://bindle.blob.core.windows.net/releases/bindle-v0.9.0-rc.1-linux-amd64.tar.gz",
2929
bindleBinary: "bindle-server",
3030
pathInBindleArchive: "bindle-server",
3131
nomadUrl: "https://releases.hashicorp.com/nomad/1.3.1/nomad_1.3.1_linux_amd64.zip",
@@ -41,7 +41,7 @@ jobs:
4141
os: "macos-latest",
4242
extension: "",
4343
extraArgs: "",
44-
bindleUrl: "https://bindle.blob.core.windows.net/releases/bindle-v0.8.0-macos-amd64.tar.gz",
44+
bindleUrl: "https://bindle.blob.core.windows.net/releases/bindle-v0.9.0-rc.1-macos-amd64.tar.gz",
4545
bindleBinary: "bindle-server",
4646
pathInBindleArchive: "bindle-server",
4747
nomadUrl: "https://releases.hashicorp.com/nomad/1.3.1/nomad_1.3.1_darwin_amd64.zip",
@@ -53,7 +53,7 @@ jobs:
5353
os: "windows-latest",
5454
extension: ".exe",
5555
extraArgs: "",
56-
bindleUrl: "https://bindle.blob.core.windows.net/releases/bindle-v0.8.0-windows-amd64.tar.gz",
56+
bindleUrl: "https://bindle.blob.core.windows.net/releases/bindle-v0.9.0-rc.1-windows-amd64.tar.gz",
5757
bindleBinary: "bindle-server.exe",
5858
pathInBindleArchive: "bindle-server.exe",
5959
nomadUrl: "https://releases.hashicorp.com/nomad/1.3.1/nomad_1.3.1_windows_amd64.zip",

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ test-integration:
3030

3131
.PHONY: test-e2e
3232
test-e2e:
33-
RUST_LOG=$(LOG_LEVEL) cargo test --test integration --features e2e-tests --no-fail-fast -- integration_tests::test_dependencies --nocapture
34-
RUST_LOG=$(LOG_LEVEL) cargo test --test integration --features e2e-tests --no-fail-fast -- --skip integration_tests::test_dependencies --nocapture
33+
RUST_LOG=$(LOG_LEVEL) cargo test --test integration --features e2e-tests --no-fail-fast -- integration_tests::e2e_tests::test_dependencies --nocapture
34+
RUST_LOG=$(LOG_LEVEL) cargo test --test integration --features e2e-tests --no-fail-fast -- --skip integration_tests::e2e_tests::test_dependencies --nocapture
3535

3636
.PHONY: test-outbound-redis
3737
test-outbound-redis:

crates/publish/src/expander.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ async fn get_bindle_first_matching_key(
494494
role: &SignatureRole,
495495
label_match: Option<&LabelMatch>,
496496
) -> Result<SecretKeyEntry> {
497-
let keys = SecretKeyFile::load_file(&fpath).await?;
497+
let keys = SecretKeyFile::load_file(&fpath)
498+
.await
499+
.with_context(|| format!("can't read file {:?}", &fpath))?;
498500

499501
keys.key
500502
.iter()

src/commands/deploy.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,6 @@ pub struct DeployCommand {
4848
)]
4949
pub app: PathBuf,
5050

51-
/// URL of bindle server
52-
#[clap(
53-
name = BINDLE_SERVER_URL_OPT,
54-
long = "bindle-server",
55-
env = BINDLE_URL_ENV,
56-
)]
57-
pub bindle_server_url: String,
58-
59-
/// Basic http auth username for the bindle server
60-
#[clap(
61-
name = BINDLE_USERNAME,
62-
long = "bindle-username",
63-
env = BINDLE_USERNAME,
64-
requires = BINDLE_PASSWORD
65-
)]
66-
pub bindle_username: Option<String>,
67-
68-
/// Basic http auth password for the bindle server
69-
#[clap(
70-
name = BINDLE_PASSWORD,
71-
long = "bindle-password",
72-
env = BINDLE_PASSWORD,
73-
requires = BINDLE_USERNAME
74-
)]
75-
pub bindle_password: Option<String>,
76-
7751
/// Bindle secret file path to load key
7852
#[clap(
7953
name = BINDLE_SECRET_FILE,
@@ -123,14 +97,6 @@ pub struct DeployCommand {
12397
)]
12498
pub insecure: bool,
12599

126-
/// URL of hippo server
127-
#[clap(
128-
name = HIPPO_SERVER_URL_OPT,
129-
long = "hippo-server",
130-
env = HIPPO_URL_ENV,
131-
)]
132-
pub hippo_server_url: String,
133-
134100
/// Path to assemble the bindle before pushing (defaults to
135101
/// a temporary directory)
136102
#[clap(

tests/http/client_keyring.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version = "1.0"
2+
3+
[[key]]
4+
label = "Test<[email protected]>"
5+
roles = ["creator"]
6+
key = "HfXxdRvgUWEE0f36EIa8+njPJVoMvmF6/gO/T19aV90="
7+
labelSignature = "En2GtxiLbzAIoFu2zQ5HWXwck5lONq/ALYGt8RQYUDNpStk23JcaN/Gx9zh9oEJGnVeDwHLNj9/Cql6j23O1Cw=="

tests/http/client_secret_keys.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version = "1.0"
2+
3+
[[key]]
4+
label = "Test<[email protected]>"
5+
keypair = "O6QdMC7mvxepvqDIXtj9b66ooMf4Mlz4Mmz65Em2Q8Ed9fF1G+BRYQTR/foQhrz6eM8lWgy+YXr+A79PX1pX3Q=="
6+
roles = ["creator"]

tests/http/server_keyring.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version = "1.0"
2+
3+
[[key]]
4+
label = "Test<[email protected]>"
5+
roles = ["creator"]
6+
key = "HfXxdRvgUWEE0f36EIa8+njPJVoMvmF6/gO/T19aV90="
7+
labelSignature = "En2GtxiLbzAIoFu2zQ5HWXwck5lONq/ALYGt8RQYUDNpStk23JcaN/Gx9zh9oEJGnVeDwHLNj9/Cql6j23O1Cw=="

tests/integration.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ mod integration_tests {
4949
const BINDLE_SERVER_BASIC_AUTH_HTPASSWD_FILE: &str = "tests/http/htpasswd";
5050
const BINDLE_SERVER_BASIC_AUTH_USER: &str = "bindle-user";
5151
const BINDLE_SERVER_BASIC_AUTH_PASSWORD: &str = "topsecret";
52+
const BINDLE_CLIENT_SECRET_FILE: &str = "tests/http/client_secret_keys.toml";
53+
pub const BINDLE_CLIENT_KEYRING_FILE: &str = "tests/http/server_keyring.toml";
54+
const BINDLE_SERVER_KEYRING_FILE: &str = "tests/http/client_keyring.toml";
55+
const BINDLE_LABEL: &str = "\"Test<[email protected]>\"";
5256

5357
const HIPPO_BASIC_AUTH_USER: &str = "hippo-user";
5458
const HIPPO_BASIC_AUTH_PASSWORD: &str = "topsecret";
@@ -88,6 +92,12 @@ mod integration_tests {
8892
),
8993
"--bindle-server",
9094
&b.url,
95+
"--bindle-secret-file",
96+
BINDLE_CLIENT_SECRET_FILE,
97+
"--bindle-keyring-file",
98+
BINDLE_CLIENT_KEYRING_FILE,
99+
"--bindle-label",
100+
BINDLE_LABEL,
91101
],
92102
None,
93103
None,
@@ -129,6 +139,12 @@ mod integration_tests {
129139
BINDLE_SERVER_BASIC_AUTH_USER,
130140
"--bindle-password",
131141
BINDLE_SERVER_BASIC_AUTH_PASSWORD,
142+
"--bindle-secret-file",
143+
BINDLE_CLIENT_SECRET_FILE,
144+
"--bindle-keyring-file",
145+
BINDLE_CLIENT_KEYRING_FILE,
146+
"--bindle-label",
147+
BINDLE_LABEL,
132148
],
133149
None,
134150
None,
@@ -166,6 +182,12 @@ mod integration_tests {
166182
),
167183
"--bindle-server",
168184
&b.url,
185+
"--bindle-secret-file",
186+
BINDLE_CLIENT_SECRET_FILE,
187+
"--bindle-keyring-file",
188+
BINDLE_CLIENT_KEYRING_FILE,
189+
"--bindle-label",
190+
BINDLE_LABEL,
169191
],
170192
None,
171193
None,
@@ -211,6 +233,12 @@ mod integration_tests {
211233
),
212234
"--bindle-server",
213235
&b.url,
236+
"--bindle-secret-file",
237+
BINDLE_CLIENT_SECRET_FILE,
238+
"--bindle-keyring-file",
239+
BINDLE_CLIENT_KEYRING_FILE,
240+
"--bindle-label",
241+
BINDLE_LABEL,
214242
],
215243
None,
216244
None,
@@ -266,6 +294,12 @@ mod integration_tests {
266294
),
267295
"--bindle-server",
268296
&b.url,
297+
"--bindle-secret-file",
298+
BINDLE_CLIENT_SECRET_FILE,
299+
"--bindle-keyring-file",
300+
BINDLE_CLIENT_KEYRING_FILE,
301+
"--bindle-label",
302+
BINDLE_LABEL,
269303
],
270304
None,
271305
None,
@@ -327,6 +361,12 @@ mod integration_tests {
327361
"{}/{}",
328362
RUST_HTTP_HEADERS_ENV_ROUTES_TEST, DEFAULT_MANIFEST_LOCATION
329363
),
364+
"--bindle-secret-file",
365+
BINDLE_CLIENT_SECRET_FILE,
366+
"--bindle-keyring-file",
367+
BINDLE_CLIENT_KEYRING_FILE,
368+
"--bindle-label",
369+
BINDLE_LABEL,
330370
],
331371
None,
332372
None,
@@ -406,6 +446,8 @@ mod integration_tests {
406446
server_cache.path().to_string_lossy().to_string().as_str(),
407447
"-i",
408448
address.as_str(),
449+
"--keyring",
450+
BINDLE_SERVER_KEYRING_FILE,
409451
],
410452
auth_args.as_slice(),
411453
]
@@ -871,6 +913,8 @@ mod integration_tests {
871913
bindle_url,
872914
"--listen",
873915
&url,
916+
"--bindle-keyring-file",
917+
e2e_tests::BINDLE_CLIENT_KEYRING_FILE,
874918
];
875919
for v in env {
876920
args.push("--env");

0 commit comments

Comments
 (0)