@@ -99,19 +99,7 @@ pub struct ClientAuthenticationDetails<O = ()> {
99
99
/// is flattened into the final CRD.
100
100
///
101
101
/// Use [`ClientAuthenticationDetails::oidc_or_error`] to get the value or report an error to the user.
102
- ///
103
- /// We are aware that this prevents users from e.g. configuring oidc and ldap clientAuthenticationOptions
104
- /// simultaneously. This might be helpful in cases of a migration of the provider of an AuthenticationClass,
105
- /// but we consider a good validation for 90% of the use-cases more important.
106
- #[ serde( flatten) ]
107
- client_authentication_options : Option < ClientAuthenticationOptions < O > > ,
108
- }
109
-
110
- #[ derive( Clone , Debug , Deserialize , Eq , JsonSchema , PartialEq , Serialize ) ]
111
- #[ serde( rename_all = "camelCase" ) ]
112
-
113
- pub enum ClientAuthenticationOptions < O > {
114
- Oidc ( oidc:: ClientAuthenticationOptions < O > ) ,
102
+ oidc : Option < oidc:: ClientAuthenticationOptions < O > > ,
115
103
}
116
104
117
105
impl < O > ClientAuthenticationDetails < O > {
@@ -132,12 +120,11 @@ impl<O> ClientAuthenticationDetails<O> {
132
120
& self ,
133
121
auth_class_name : & str ,
134
122
) -> OperatorResult < & oidc:: ClientAuthenticationOptions < O > > {
135
- match & self . client_authentication_options {
136
- Some ( ClientAuthenticationOptions :: Oidc ( oidc ) ) => Ok ( oidc ) ,
137
- None => Err ( Error :: OidcAuthenticationDetailsNotSpecified {
123
+ self . oidc
124
+ . as_ref ( )
125
+ . ok_or ( Error :: OidcAuthenticationDetailsNotSpecified {
138
126
auth_class_name : auth_class_name. to_string ( ) ,
139
- } ) ,
140
- }
127
+ } )
141
128
}
142
129
}
143
130
0 commit comments