Skip to content

Commit 990e565

Browse files
committed
Added TlsAuthenticationProvider to be used in AuthenticationClass (#387)
## Description - added TlsAuthenticationProvider as discussed in stackabletech/documentation#186 - removed MutualTlsVerification Co-authored-by: Malte Sander <malte.sander.it@gmail.com>
1 parent 59bb7fb commit 990e565

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ All notable changes to this project will be documented in this file.
66

77
### Added
88

9-
- New commons::s3 module with common S3 connection structs ([#377])
9+
- New commons::s3 module with common S3 connection structs ([#377]).
10+
- New `TlsAuthenticationProvider` for `AuthenticationClass` ([#387]).
1011

1112
[#377]: https://github.com/stackabletech/operator-rs/issues/377
13+
[#387]: https://github.com/stackabletech/operator-rs/pull/387
1214

1315
## [0.17.0] - 2022-04-14
1416

src/commons/authentication.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use serde::{Deserialize, Serialize};
22

3-
use crate::commons::ldap::LdapAuthenticationProvider;
3+
use crate::commons::{ldap::LdapAuthenticationProvider, tls::TlsAuthenticationProvider};
44
use kube::CustomResource;
55
use schemars::JsonSchema;
66

@@ -24,6 +24,8 @@ pub struct AuthenticationClassSpec {
2424

2525
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
2626
#[serde(rename_all = "camelCase")]
27+
#[allow(clippy::large_enum_variant)]
2728
pub enum AuthenticationClassProvider {
2829
Ldap(LdapAuthenticationProvider),
30+
Tls(TlsAuthenticationProvider),
2931
}

src/commons/tls.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ pub enum TlsVerification {
1414
None {},
1515
/// Use TLS and ca certificate to verify the server
1616
Server(TlsServerVerification),
17-
/// Use TLS and ca certificate to verify the server and the client
18-
Mutual(TlsMutualVerification),
1917
}
2018

2119
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
@@ -43,3 +41,13 @@ pub enum CaCert {
4341
/// So if you got provided with a ca cert but don't have access to the key you can still use this method.
4442
SecretClass(String),
4543
}
44+
45+
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
46+
#[serde(rename_all = "camelCase")]
47+
pub struct TlsAuthenticationProvider {
48+
/// See `<https://docs.stackable.tech/home/contributor/adr/ADR016-tls-authentication.html>`.
49+
/// If `client_cert_secret_class` is not set, the TLS settings may also be used for client authentication.
50+
/// If `client_cert_secret_class` is set, the [SecretClass](https://docs.stackable.tech/secret-operator/secretclass.html)
51+
/// will be used to provision client certificates.
52+
pub client_cert_secret_class: Option<String>,
53+
}

0 commit comments

Comments
 (0)