|
1 | 1 | use kube::CustomResource;
|
2 | 2 | use schemars::JsonSchema;
|
3 | 3 | use serde::{Deserialize, Serialize};
|
4 |
| -use stackable_versioned::versioned; |
| 4 | + |
| 5 | +use crate::versioned::versioned; |
5 | 6 |
|
6 | 7 | mod v1alpha1_impl;
|
7 | 8 |
|
8 | 9 | #[versioned(version(name = "v1alpha1"))]
|
9 | 10 | pub mod versioned {
|
10 |
| - // This makes v1alpha1 versions of all authentication providers available to the |
11 |
| - // AuthenticationClassProvider enum below. |
12 |
| - mod v1alpha1 { |
| 11 | + pub mod v1alpha1 { |
| 12 | + // Re-export the v1alpha1-specific error type from the private impl module. |
| 13 | + pub use v1alpha1_impl::Error; |
| 14 | + |
| 15 | + // This makes v1alpha1 versions of all authentication providers available to the |
| 16 | + // AuthenticationClassProvider enum below. |
13 | 17 | use crate::crd::authentication::{kerberos, ldap, oidc, r#static, tls};
|
14 | 18 | }
|
15 | 19 | /// The Stackable Platform uses the AuthenticationClass as a central mechanism to handle user
|
@@ -79,18 +83,20 @@ pub mod versioned {
|
79 | 83 | Oidc(oidc::v1alpha1::AuthenticationProvider),
|
80 | 84 |
|
81 | 85 | /// The [TLS provider](DOCS_BASE_URL_PLACEHOLDER/concepts/authentication#_tls).
|
82 |
| - /// The TLS AuthenticationClass is used when users should authenticate themselves with a TLS certificate. |
| 86 | + /// The TLS AuthenticationClass is used when users should authenticate themselves with a |
| 87 | + /// TLS certificate. |
83 | 88 | Tls(tls::v1alpha1::AuthenticationProvider),
|
84 | 89 |
|
85 | 90 | /// The [Kerberos provider](DOCS_BASE_URL_PLACEHOLDER/concepts/authentication#_kerberos).
|
86 |
| - /// The Kerberos AuthenticationClass is used when users should authenticate themselves via Kerberos. |
| 91 | + /// The Kerberos AuthenticationClass is used when users should authenticate themselves via |
| 92 | + /// Kerberos. |
87 | 93 | Kerberos(kerberos::v1alpha1::AuthenticationProvider),
|
88 | 94 | }
|
89 | 95 |
|
90 |
| - /// Common [`v1alpha1::ClientAuthenticationDetails`] which is specified at the client/ product |
91 |
| - /// cluster level. It provides a name (key) to resolve a particular [`AuthenticationClass`]. |
92 |
| - /// Additionally, it provides authentication provider specific configuration (OIDC and LDAP for |
93 |
| - /// example). |
| 96 | + /// Common client authentication details which is specified at the client/ product cluster level. |
| 97 | + /// |
| 98 | + /// It provides a name (key) to resolve a particular [`AuthenticationClass`]. Additionally, it |
| 99 | + /// provides authentication provider specific configuration (OIDC and LDAP for example). |
94 | 100 | ///
|
95 | 101 | /// If the product needs additional (product specific) authentication options, it is recommended
|
96 | 102 | /// to wrap this struct and use `#[serde(flatten)]` on the field.
|
@@ -123,19 +129,22 @@ pub mod versioned {
|
123 | 129 | pub struct ClientAuthenticationDetails<O = ()> {
|
124 | 130 | /// Name of the [AuthenticationClass](https://docs.stackable.tech/home/nightly/concepts/authentication) used to
|
125 | 131 | /// authenticate users.
|
126 |
| - // |
127 |
| - // To get the concrete [`AuthenticationClass`], we must resolve it. This resolution can be achieved by using |
128 |
| - // [`ClientAuthenticationDetails::resolve_class`]. |
| 132 | + /// |
| 133 | + /// To get the concrete [`AuthenticationClass`], we must resolve it. This resolution can be |
| 134 | + /// achieved by using [`ClientAuthenticationDetails::resolve_class`]. |
129 | 135 | #[serde(rename = "authenticationClass")]
|
130 | 136 | authentication_class_ref: String,
|
131 | 137 |
|
132 |
| - /// This field contains OIDC-specific configuration. It is only required in case OIDC is used. |
| 138 | + /// This field contains OIDC-specific configuration. It is only required in case OIDC is |
| 139 | + /// used. |
| 140 | + /// |
| 141 | + /// Use [`ClientAuthenticationDetails::oidc_or_error`] to get the value or report an error |
| 142 | + /// to the user. |
133 | 143 | //
|
134 |
| - // Use [`ClientAuthenticationDetails::oidc_or_error`] to get the value or report an error to the user. |
135 |
| - // TODO: Ideally we want this to be an enum once other `ClientAuthenticationOptions` are added, so |
136 |
| - // that user can not configure multiple options at the same time (yes we are aware that this makes a |
137 |
| - // changing the type of an AuthenticationClass harder). |
138 |
| - // This is a non-breaking change though :) |
| 144 | + // TODO: Ideally we want this to be an enum once other `ClientAuthenticationOptions` are |
| 145 | + // added, so that user can not configure multiple options at the same time (yes we are aware |
| 146 | + // that this makes a changing the type of an AuthenticationClass harder). This is a |
| 147 | + // non-breaking change though :) |
139 | 148 | oidc: Option<oidc::v1alpha1::ClientAuthenticationOptions<O>>,
|
140 | 149 | }
|
141 | 150 | }
|
0 commit comments