Skip to content

Commit 57c401c

Browse files
adwk67sbernauer
andauthored
feat: add kerberos authentication provider (#880)
* add kerberos authentication provider * changelog * Update crates/stackable-operator/src/commons/authentication/kerberos.rs Co-authored-by: Sebastian Bernauer <[email protected]> * Update crates/stackable-operator/src/commons/authentication/mod.rs Co-authored-by: Sebastian Bernauer <[email protected]> * formatting * added docs link * Update crates/stackable-operator/src/commons/authentication/kerberos.rs Co-authored-by: Sebastian Bernauer <[email protected]> --------- Co-authored-by: Sebastian Bernauer <[email protected]>
1 parent cb4460f commit 57c401c

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

crates/stackable-operator/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Add Kerberos AuthenticationProvider ([#880]).
10+
11+
[#880]: https://github.com/stackabletech/operator-rs/pull/880
12+
713
## [0.77.1] - 2024-09-27
814

915
### Fixed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use schemars::JsonSchema;
2+
use serde::{Deserialize, Serialize};
3+
4+
#[derive(
5+
Clone, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize,
6+
)]
7+
#[serde(rename_all = "camelCase")]
8+
pub struct AuthenticationProvider {
9+
/// Mandatory SecretClass used to obtain keytabs.
10+
pub kerberos_secret_class: String,
11+
}

crates/stackable-operator/src/commons/authentication/mod.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use strum::Display;
66

77
use crate::client::Client;
88

9+
pub mod kerberos;
910
pub mod ldap;
1011
pub mod oidc;
1112
pub mod static_;
@@ -77,6 +78,10 @@ pub enum AuthenticationClassProvider {
7778
/// The [TLS provider](DOCS_BASE_URL_PLACEHOLDER/concepts/authentication#_tls).
7879
/// The TLS AuthenticationClass is used when users should authenticate themselves with a TLS certificate.
7980
Tls(tls::AuthenticationProvider),
81+
82+
/// The [Kerberos provider](DOCS_BASE_URL_PLACEHOLDER/concepts/authentication#_kerberos).
83+
/// The Kerberos AuthenticationClass is used when users should authenticate themselves via Kerberos.
84+
Kerberos(kerberos::AuthenticationProvider),
8085
}
8186

8287
impl AuthenticationClass {
@@ -183,6 +188,13 @@ mod tests {
183188
let tls_provider = AuthenticationClassProvider::Tls(AuthenticationProvider {
184189
client_cert_secret_class: None,
185190
});
186-
assert_eq!("Tls", tls_provider.to_string())
191+
assert_eq!("Tls", tls_provider.to_string());
192+
193+
let kerberos_provider = AuthenticationClassProvider::Kerberos(
194+
crate::commons::authentication::kerberos::AuthenticationProvider {
195+
kerberos_secret_class: "kerberos".to_string(),
196+
},
197+
);
198+
assert_eq!("Kerberos", kerberos_provider.to_string());
187199
}
188200
}

0 commit comments

Comments
 (0)