Skip to content

Commit 9dfe57e

Browse files
committed
replaced random key with hard-coded one with comment
1 parent f391768 commit 9dfe57e

File tree

6 files changed

+8
-26
lines changed

6 files changed

+8
-26
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ product-config = { git = "https://github.com/stackabletech/product-config.git",
1414
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.93.1" }
1515

1616
anyhow = "1.0"
17-
base64 = "0.22.1"
1817
built = { version = "0.7", features = ["chrono", "git2"] }
1918
clap = "4.5"
2019
const_format = "0.2"
2120
fnv = "1.0"
2221
futures = { version = "0.3", features = ["compat"] }
2322
indoc = "2.0"
2423
lazy_static = "1.4"
25-
rand = "0.8.5"
2624
rstest = "0.25"
2725
semver = "1.0"
2826
serde = { version = "1.0", features = ["derive"] }

docs/modules/airflow/partials/supported-versions.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// This is a separate file, since it is used by both the direct Airflow-Operator documentation, and the overarching
33
// Stackable Platform documentation.
44

5+
- 3.0.1 (experimental)
56
- 2.10.5
67
- 2.10.4 (deprecated)
78
- 2.9.3 (LTS)

rust/operator-binary/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ product-config.workspace = true
1313
stackable-operator.workspace = true
1414

1515
anyhow.workspace = true
16-
base64.workspace = true
1716
clap.workspace = true
1817
const_format.workspace = true
1918
fnv.workspace = true
2019
futures.workspace = true
2120
lazy_static.workspace = true
22-
rand.workspace = true
2321
serde.workspace = true
2422
serde_json.workspace = true
2523
serde_yaml.workspace = true

rust/operator-binary/src/env_vars.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ use std::{
33
path::PathBuf,
44
};
55

6-
use base64::{Engine, engine::general_purpose::STANDARD};
7-
use lazy_static::lazy_static;
86
use product_config::types::PropertyNameKind;
9-
use rand::Rng;
107
use snafu::Snafu;
118
use stackable_operator::{
129
commons::product_image_selection::ResolvedProductImage,
@@ -56,14 +53,12 @@ const ADMIN_EMAIL: &str = "ADMIN_EMAIL";
5653

5754
const PYTHONPATH: &str = "PYTHONPATH";
5855

59-
lazy_static! {
60-
pub static ref JWT_KEY: String = {
61-
let mut rng = rand::thread_rng();
62-
// Generate 16 random bytes and encode to base64 string
63-
let random_bytes: [u8; 16] = rng.gen();
64-
STANDARD.encode(random_bytes)
65-
};
66-
}
56+
/// TODO This key is only intended for use during experimental support and will
57+
/// be replaced with a secret at a later stage. The key should be consistent
58+
/// across replicas/roles for a given cluster, but should be cluster-specific
59+
/// and should be accessed from a secret to avoid cluster restarts being
60+
/// triggered by an operator restart.
61+
const JWT_KEY: &str = "ThisKeyIsNotIntendedForProduction!";
6762

6863
#[derive(Snafu, Debug)]
6964
pub enum Error {
@@ -477,7 +472,7 @@ fn add_version_specific_env_vars(
477472
"AIRFLOW__API_AUTH__JWT_SECRET".into(),
478473
EnvVar {
479474
name: "AIRFLOW__API_AUTH__JWT_SECRET".into(),
480-
value: Some(JWT_KEY.clone()),
475+
value: Some(JWT_KEY.into()),
481476
..Default::default()
482477
},
483478
);

0 commit comments

Comments
 (0)