Skip to content

Commit

Permalink
test(secret): use correct RW_SECRET_STORE_PRIVATE_KEY_HEX length in t…
Browse files Browse the repository at this point in the history
…est (#19092)
  • Loading branch information
yuhao-su authored Oct 24, 2024
1 parent 73a3d97 commit 707a0d2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env_scripts = [
set_env ENABLE_TELEMETRY "false"
set_env RW_TELEMETRY_TYPE "test"
set_env RW_SECRET_STORE_PRIVATE_KEY_HEX "0123456789abcdef"
set_env RW_SECRET_STORE_PRIVATE_KEY_HEX "0123456789abcdef0123456789abcdef"
set_env RW_TEMP_SECRET_FILE_DIR "${PREFIX_SECRET}"
is_sanitizer_enabled = get_env ENABLE_SANITIZER
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export MCLI_DOWNLOAD_BIN=https://rw-ci-deps-dist.s3.amazonaws.com/mc
export GCLOUD_DOWNLOAD_TGZ=https://rw-ci-deps-dist.s3.amazonaws.com/google-cloud-cli-475.0.0-linux-x86_64.tar.gz
export NEXTEST_HIDE_PROGRESS_BAR=true
export RW_TELEMETRY_TYPE=test
export RW_SECRET_STORE_PRIVATE_KEY_HEX="0123456789abcdef"
export RW_SECRET_STORE_PRIVATE_KEY_HEX="0123456789abcdef0123456789abcdef"
export RUST_MIN_STACK=4194304

unset LANG
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ services:
# If ENABLE_TELEMETRY is not set, telemetry will start by default
ENABLE_TELEMETRY: ${ENABLE_TELEMETRY:-true}
RW_TELEMETRY_TYPE: ${RW_TELEMETRY_TYPE:-"docker-compose"}
RW_SECRET_STORE_PRIVATE_KEY_HEX: ${RW_SECRET_STORE_PRIVATE_KEY_HEX:-0123456789abcdef}
RW_SECRET_STORE_PRIVATE_KEY_HEX: ${RW_SECRET_STORE_PRIVATE_KEY_HEX:-0123456789abcdef0123456789abcdef}
RW_LICENSE_KEY: ${RW_LICENSE_KEY:-}
container_name: risingwave-standalone
healthcheck:
Expand Down
3 changes: 3 additions & 0 deletions src/common/secret/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ thiserror = "1"
thiserror-ext = { workspace = true }
tracing = "0.1"

[dev-dependencies]
hex = "0.4"

[lints]
workspace = true
3 changes: 2 additions & 1 deletion src/common/secret/src/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ mod test {
use super::*;
#[test]
fn test_secret_encryption_decyption() {
let key = b"0123456789abcdef";
let key = &hex::decode("0123456789abcdef0123456789abcdef").unwrap();
assert!(key.len() == 16);
let plaintext = "Hello, world!".as_bytes();
let secret = SecretEncryption::encrypt(key, plaintext).unwrap();
let decrypted = secret.decrypt(key).unwrap();
Expand Down
4 changes: 3 additions & 1 deletion src/meta/src/manager/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ impl MetaOpts {
object_store_config: ObjectStoreConfig::default(),
max_trivial_move_task_count_per_loop: 256,
max_get_task_probe_times: 5,
secret_store_private_key: Some("0123456789abcdef".as_bytes().to_vec()),
secret_store_private_key: Some(
hex::decode("0123456789abcdef0123456789abcdef").unwrap(),
),
temp_secret_file_dir: "./secrets".to_string(),
table_info_statistic_history_times: 240,
actor_cnt_per_worker_parallelism_hard_limit: usize::MAX,
Expand Down

0 comments on commit 707a0d2

Please sign in to comment.