Skip to content

Commit 0ba5fde

Browse files
Merge branch 'main' into feat/improve-subject-dn
2 parents ba7c1a9 + e5b7479 commit 0ba5fde

9 files changed

Lines changed: 42 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ All notable changes to this project will be documented in this file.
1515

1616
- Document Helm deployed RBAC permissions and remove unnecessary permissions ([#693]).
1717

18+
### Fixed
19+
20+
- Redact the user-provided PKCS#12 keystore password in operator logs. ([#706]).
21+
1822
[#693]: https://github.com/stackabletech/secret-operator/pull/693
23+
[#706]: https://github.com/stackabletech/secret-operator/pull/706
1924
[#708]: https://github.com/stackabletech/secret-operator/pull/708
2025

2126
## [26.3.0] - 2026-03-16

Tiltfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
meta = read_json('nix/meta.json')
33
operator_name = meta['operator']['name']
44

5-
# If tilt_options.json exists read it and load the default_registry and default_repository value from it
5+
# If tilt_options.json exists read it and load the default_registry, default_operator_repository,
6+
# and default_product_repository value from it
67
settings = read_json('tilt_options.json', default={})
78
registry = settings.get('default_registry', 'oci.stackable.tech')
8-
repository = settings.get('default_repository', registry + '/' + 'sdp')
9-
operator_image_name = repository + '/' + operator_name
109

11-
# Configure default registry either read from config file above, or with default value of "oci.stackable.tech"
10+
# Construct the operator image repository. It uses the "sandbox" instead of the "sdp" namespace to
11+
# separate "testing/local" images from official (published) images.
12+
operator_repository = settings.get('default_operator_repository', registry + '/' + 'sandbox')
13+
operator_image_name = operator_repository + '/' + operator_name
14+
15+
16+
# Configure default registry either read from config file above, or with default value of
17+
# "oci.stackable.tech"
1218
default_registry(registry)
1319

1420
custom_build(
@@ -31,14 +37,14 @@ k8s_kind('DaemonSet', image_json_path='{.spec.template.metadata.annotations.inte
3137
# supported by helm(set).
3238
helm_values = settings.get('helm_values', None)
3339

34-
helm_override_image_repository = 'image.repository=' + repository
40+
helm_override_operator_image_repository = 'image.repository=' + operator_repository
3541

3642
k8s_yaml(helm(
3743
'deploy/helm/' + operator_name,
3844
name=operator_name,
3945
namespace="stackable-operators",
4046
set=[
41-
helm_override_image_repository,
47+
helm_override_operator_image_repository,
4248
],
4349
values=helm_values,
4450
))

deploy/helm/secret-operator/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ helm.sh/test: {{ include "operator.chart" . }}
7979
{{- end }}
8080

8181
{{/*
82-
Build the full container image reference.
82+
Build the full operator container image reference.
8383
*/}}
8484
{{- define "operator.image" -}}
8585
{{- printf "%s/%s:%s" .Values.image.repository .Chart.Name (.Values.image.tag | default .Chart.AppVersion) -}}

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ARG STACKABLE_USER_NAME="stackable"
3737
# "-c": Allows the execution of commands passed as a string
3838
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
3939

40-
# These labels have mostly been superceded by the OpenContainer spec annotations below but it doesn't hurt to include them
40+
# These labels have mostly been superseded by the OpenContainer spec annotations below but it doesn't hurt to include them
4141
# http://label-schema.org/rc1/
4242
LABEL name="Stackable Operator for Stackable Secret Operator"
4343
LABEL maintainer="info@stackable.tech"

nix/meta.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/operator-binary/src/format/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn convert(
2222
(WellKnownSecretData::TlsPem(pem), SecretFormat::TlsPkcs12) => {
2323
Ok(WellKnownSecretData::TlsPkcs12(convert_tls_to_pkcs12(
2424
pem,
25-
compat.tls_pkcs12_password.as_deref().unwrap_or_default(),
25+
&compat.tls_pkcs12_password.unwrap_or_default(),
2626
)?))
2727
}
2828

rust/operator-binary/src/format/well_known.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ use stackable_operator::schemars::{self, JsonSchema};
44
use strum::EnumDiscriminants;
55

66
use super::{ConvertError, SecretFiles, convert};
7-
use crate::{backend::ProvisionParts, utils::ResultExt};
7+
use crate::{
8+
backend::ProvisionParts,
9+
utils::{ResultExt, Unloggable},
10+
};
811

912
const FILE_PEM_CERT_CERT: &str = "tls.crt";
1013
const FILE_PEM_CERT_KEY: &str = "tls.key";
@@ -168,7 +171,7 @@ pub struct CompatibilityOptions {
168171
rename = "secrets.stackable.tech/format.compatibility.tls-pkcs12.password",
169172
default
170173
)]
171-
pub tls_pkcs12_password: Option<String>,
174+
pub tls_pkcs12_password: Option<Unloggable<String>>,
172175
}
173176

174177
/// Options to customize the well-known format file names.

rust/operator-binary/src/utils.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ pub fn asn1time_to_offsetdatetime(asn: &Asn1TimeRef) -> Result<OffsetDateTime, A
181181
// When/if migrating to Valuable, provide a dummy implementation of Value too
182182
pub struct Unloggable<T>(pub T);
183183

184+
impl<T> Default for Unloggable<T>
185+
where
186+
T: Default,
187+
{
188+
fn default() -> Self {
189+
Self(T::default())
190+
}
191+
}
192+
184193
impl<T> Debug for Unloggable<T> {
185194
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
186195
f.write_str("<redacted>")
@@ -201,6 +210,12 @@ impl<T> DerefMut for Unloggable<T> {
201210
}
202211
}
203212

213+
impl<'de, T: serde::Deserialize<'de>> serde::Deserialize<'de> for Unloggable<T> {
214+
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
215+
T::deserialize(deserializer).map(Unloggable)
216+
}
217+
}
218+
204219
/// Wrapper type for [`Iterator::collect`] that flattens the incoming [`Iterator`].
205220
///
206221
/// This isn't super useful for "regular" collects (just call [`Iterator::flatten`]!),

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file includes unstable features, so you need to run "cargo +nightly fmt" to format your code.
2-
# It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nigthly formatter is prefered.
2+
# It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nightly formatter is preferred.
33

44
# https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rustfmt-style-edition.html
55
style_edition = "2024"

0 commit comments

Comments
 (0)