Skip to content

Commit

Permalink
Pull in new operator-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Nov 20, 2023
1 parent ac75ba3 commit 50002fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions deploy/helm/trino-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,13 @@ spec:
default: []
description: Authentication options for Trino.
items:
description: |-
An enum of supported authentication providers. Each variant contains provider specific options. The structure is based on disussions around the [OIDC ADR][oidc-adr].

[oidc-adr]: https://docs.stackable.tech/home/nightly/contributor/adr/adr032-oauth-oidc-support
oneOf:
- required:
- oidc
properties:
authenticationClass:
description: A name/key which references an authentication class. To get the concrete [`AuthenticationClass`], we must resolve it. This resolution can be achieved by using [`ClientAuthenticationDetails::resolve_class`].
type: string
oidc:
description: OIDC specific config options. These are set on the product config level.
description: This field contains authentication provider specific configuration. It is flattened into the final CRD.
nullable: true
properties:
clientCredentialsSecret:
description: A reference to the OIDC client credentials secret. The secret contains the client id and secret.
Expand Down
7 changes: 2 additions & 5 deletions rust/crd/src/authentication.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use snafu::{ResultExt, Snafu};
use stackable_operator::{
client::Client,
commons::authentication::{
oidc, AuthenticationClass, ClientAuthenticationConfig, ClientAuthenticationDetails,
},
commons::authentication::{oidc, AuthenticationClass, ClientAuthenticationDetails},
};

#[derive(Snafu, Debug)]
Expand Down Expand Up @@ -33,11 +31,10 @@ pub async fn resolve_authentication_classes(
.resolve_class(client)
.await
.context(AuthenticationClassRetrievalSnafu)?;
let ClientAuthenticationConfig::Oidc(oidc) = &client_authentication_detail.config;

resolved_auth_classes.push(ResolvedAuthenticationClassRef {
authentication_class: resolved_auth_class,
oidc: Some(oidc.clone()),
oidc: client_authentication_detail.oidc.clone(),
});
}

Expand Down

0 comments on commit 50002fc

Please sign in to comment.