File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/auth Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ public InMemoryReactiveClientRegistrationRepository clientRegistrationRepository
99
99
final OAuth2ClientProperties props = OAuthPropertiesConverter .convertProperties (properties );
100
100
final List <ClientRegistration > registrations =
101
101
new ArrayList <>(new OAuth2ClientPropertiesMapper (props ).asClientRegistrations ().values ());
102
+ if (registrations .isEmpty ()) {
103
+ throw new IllegalArgumentException ("OAuth2 authentication is enabled but no providers specified." );
104
+ }
102
105
return new InMemoryReactiveClientRegistrationRepository (registrations );
103
106
}
104
107
Original file line number Diff line number Diff line change 1
1
package com .provectus .kafka .ui .config .auth .condition ;
2
2
3
3
import com .provectus .kafka .ui .service .rbac .AbstractProviderCondition ;
4
+ import org .jetbrains .annotations .NotNull ;
4
5
import org .springframework .context .annotation .Condition ;
5
6
import org .springframework .context .annotation .ConditionContext ;
6
7
import org .springframework .core .type .AnnotatedTypeMetadata ;
7
8
8
9
public class CognitoCondition extends AbstractProviderCondition implements Condition {
9
10
@ Override
10
- public boolean matches (final ConditionContext context , final AnnotatedTypeMetadata metadata ) {
11
+ public boolean matches (final ConditionContext context , final @ NotNull AnnotatedTypeMetadata metadata ) {
11
12
return getRegisteredProvidersTypes (context .getEnvironment ()).stream ().anyMatch (a -> a .equalsIgnoreCase ("cognito" ));
12
13
}
13
- }
14
+ }
You can’t perform that action at this time.
0 commit comments