use of io.strimzi.api.kafka.model.listener.KafkaListenerAuthenticationOAuth in project strimzi by strimzi.
the class KafkaClusterOAuthValidationTest method testOAuthValidationRefreshSecondsSetWithExpirySecondsNotSet.
@ParallelTest
public void testOAuthValidationRefreshSecondsSetWithExpirySecondsNotSet() {
assertThrows(InvalidResourceException.class, () -> {
KafkaListenerAuthenticationOAuth auth = new KafkaListenerAuthenticationOAuthBuilder().withValidIssuerUri("http://valid-issuer").withJwksEndpointUri("http://jwks-endpoint").withJwksRefreshSeconds(333).build();
ListenersValidator.validate(Reconciliation.DUMMY_RECONCILIATION, 3, getListeners(auth));
});
}
use of io.strimzi.api.kafka.model.listener.KafkaListenerAuthenticationOAuth in project strimzi by strimzi.
the class KafkaClusterOAuthValidationTest method testOAuthValidationWithOAuthWithIntrospectionWithNoTypeCheck.
@ParallelTest
public void testOAuthValidationWithOAuthWithIntrospectionWithNoTypeCheck() {
assertThrows(InvalidResourceException.class, () -> {
KafkaListenerAuthenticationOAuth auth = new KafkaListenerAuthenticationOAuthBuilder().withValidIssuerUri("http://valid-issuer").withClientId("my-kafka-id").withNewClientSecret().withSecretName("my-secret-secret").withKey("my-secret-key").endClientSecret().withIntrospectionEndpointUri("http://introspection-endpoint").withCheckAccessTokenType(false).build();
ListenersValidator.validate(Reconciliation.DUMMY_RECONCILIATION, 3, getListeners(auth));
});
}
use of io.strimzi.api.kafka.model.listener.KafkaListenerAuthenticationOAuth in project strimzi by strimzi.
the class KafkaClusterOAuthValidationTest method testOAuthValidationRefreshSecondsWithoutEndpointUri.
@ParallelTest
public void testOAuthValidationRefreshSecondsWithoutEndpointUri() {
assertThrows(InvalidResourceException.class, () -> {
KafkaListenerAuthenticationOAuth auth = new KafkaListenerAuthenticationOAuthBuilder().withIntrospectionEndpointUri("http://introspection").withClientId("my-client-id").withJwksRefreshSeconds(40).build();
ListenersValidator.validate(Reconciliation.DUMMY_RECONCILIATION, 3, getListeners(auth));
});
}
use of io.strimzi.api.kafka.model.listener.KafkaListenerAuthenticationOAuth in project strimzi by strimzi.
the class KafkaClusterOAuthValidationTest method testOAuthValidationRefreshSecondsNotSetWithExpirySecondsSet.
@ParallelTest
public void testOAuthValidationRefreshSecondsNotSetWithExpirySecondsSet() {
assertThrows(InvalidResourceException.class, () -> {
KafkaListenerAuthenticationOAuth auth = new KafkaListenerAuthenticationOAuthBuilder().withValidIssuerUri("http://valid-issuer").withJwksEndpointUri("http://jwks-endpoint").withJwksExpirySeconds(150).build();
ListenersValidator.validate(Reconciliation.DUMMY_RECONCILIATION, 3, getListeners(auth));
});
}
use of io.strimzi.api.kafka.model.listener.KafkaListenerAuthenticationOAuth in project strimzi by strimzi.
the class KafkaClusterOAuthValidationTest method testOAuthValidationWithMinimumJWKS.
@ParallelTest
public void testOAuthValidationWithMinimumJWKS() {
KafkaListenerAuthenticationOAuth auth = new KafkaListenerAuthenticationOAuthBuilder().withValidIssuerUri("http://valid-issuer").withJwksEndpointUri("http://jwks-endpoint").build();
ListenersValidator.validate(Reconciliation.DUMMY_RECONCILIATION, 3, getListeners(auth));
}
Aggregations