Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ All notable changes to this project will be documented in this file.

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

### Fixed

- Redact the user-provided PKCS#12 keystore password in operator logs. ([#706]).

[#693]: https://github.com/stackabletech/secret-operator/pull/693
[#706]: https://github.com/stackabletech/secret-operator/pull/706

## [26.3.0] - 2026-03-16

Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/format/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn convert(
(WellKnownSecretData::TlsPem(pem), SecretFormat::TlsPkcs12) => {
Ok(WellKnownSecretData::TlsPkcs12(convert_tls_to_pkcs12(
pem,
compat.tls_pkcs12_password.as_deref().unwrap_or_default(),
&compat.tls_pkcs12_password.unwrap_or_default(),
)?))
}

Expand Down
7 changes: 5 additions & 2 deletions rust/operator-binary/src/format/well_known.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use stackable_operator::schemars::{self, JsonSchema};
use strum::EnumDiscriminants;

use super::{ConvertError, SecretFiles, convert};
use crate::{backend::ProvisionParts, utils::ResultExt};
use crate::{
backend::ProvisionParts,
utils::{ResultExt, Unloggable},
};

const FILE_PEM_CERT_CERT: &str = "tls.crt";
const FILE_PEM_CERT_KEY: &str = "tls.key";
Expand Down Expand Up @@ -168,7 +171,7 @@ pub struct CompatibilityOptions {
rename = "secrets.stackable.tech/format.compatibility.tls-pkcs12.password",
default
)]
pub tls_pkcs12_password: Option<String>,
pub tls_pkcs12_password: Option<Unloggable<String>>,
}

/// Options to customize the well-known format file names.
Expand Down
15 changes: 15 additions & 0 deletions rust/operator-binary/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ pub fn asn1time_to_offsetdatetime(asn: &Asn1TimeRef) -> Result<OffsetDateTime, A
// When/if migrating to Valuable, provide a dummy implementation of Value too
pub struct Unloggable<T>(pub T);

impl<T> Default for Unloggable<T>
where
T: Default,
{
fn default() -> Self {
Self(T::default())
}
}

impl<T> Debug for Unloggable<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("<redacted>")
Expand All @@ -201,6 +210,12 @@ impl<T> DerefMut for Unloggable<T> {
}
}

impl<'de, T: serde::Deserialize<'de>> serde::Deserialize<'de> for Unloggable<T> {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
T::deserialize(deserializer).map(Unloggable)
}
}

/// Wrapper type for [`Iterator::collect`] that flattens the incoming [`Iterator`].
///
/// This isn't super useful for "regular" collects (just call [`Iterator::flatten`]!),
Expand Down
Loading