Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
6 changes: 6 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Add Kerberos AuthenticationProvider ([#880]).

[#880]: https://github.com/stackabletech/operator-rs/pull/880

## [0.77.1] - 2024-09-27

### Fixed
Expand Down
12 changes: 12 additions & 0 deletions crates/stackable-operator/src/commons/authentication/kerberos.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(
Clone, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize,
)]
#[serde(rename_all = "camelCase")]
pub struct AuthenticationProvider {
/// Mandatory SecretClass used to obtain keytabs.
#[serde(default)]
pub kerberos_secret_class: String,
}
14 changes: 13 additions & 1 deletion crates/stackable-operator/src/commons/authentication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use strum::Display;

use crate::client::Client;

pub mod kerberos;
pub mod ldap;
pub mod oidc;
pub mod static_;
Expand Down Expand Up @@ -77,6 +78,10 @@ pub enum AuthenticationClassProvider {
/// The [TLS provider](DOCS_BASE_URL_PLACEHOLDER/concepts/authentication#_tls).
/// The TLS AuthenticationClass is used when users should authenticate themselves with a TLS certificate.
Tls(tls::AuthenticationProvider),

/// The [Kerberos provider](DOCS_BASE_URL_PLACEHOLDER/concepts/authentication#_kerberos).
/// The Kerberos AuthenticationClass is used when users should authenticate themselves via Kerberos.
Kerberos(kerberos::AuthenticationProvider),
}

impl AuthenticationClass {
Expand Down Expand Up @@ -183,6 +188,13 @@ mod tests {
let tls_provider = AuthenticationClassProvider::Tls(AuthenticationProvider {
client_cert_secret_class: None,
});
assert_eq!("Tls", tls_provider.to_string())
assert_eq!("Tls", tls_provider.to_string());

let kerberos_provider = AuthenticationClassProvider::Kerberos(
crate::commons::authentication::kerberos::AuthenticationProvider {
kerberos_secret_class: "kerberos".to_string(),
},
);
assert_eq!("Kerberos", kerberos_provider.to_string());
}
}
Loading