Skip to content

[Merged by Bors] - Added AuthenticationClass provider static #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 6 additions & 0 deletions 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

- Added `AuthenticationClass` provider static ([#514]).

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

## [0.27.1] - 2022-11-17

### Changed
Expand Down
17 changes: 17 additions & 0 deletions src/commons/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ pub struct AuthenticationClassSpec {
pub enum AuthenticationClassProvider {
Ldap(LdapAuthenticationProvider),
Tls(TlsAuthenticationProvider),
Static(StaticAuthenticationProvider),
}

#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StaticAuthenticationProvider {
/// Secret providing the usernames and password.
/// The secret must contain an entry for every user, with the key being the username and the value the password in plain text.
/// It must be located in the same namespace as the product using it.
user_credentials_secret: UserCredentialsSecretRef,
}

#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct UserCredentialsSecretRef {
/// Name of the secret
name: String,
}

#[cfg(test)]
Expand Down