Skip to content

Commit 225e21e

Browse files
committed
Address review comments from Paul
Signed-off-by: Gantigmaa Selenge <[email protected]>
1 parent 30578b4 commit 225e21e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

1xx-reauth-config-for-scram-listener.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
# Support `connections.max.reauth.ms` configuration for SCRAM listeners
1+
# Add support `connections.max.reauth.ms` configuration for SCRAM listeners
2+
This proposal adds support for configuring the Kafka `connections.max.reauth.ms` parameter at the listener level for SCRAM authentication in Strimzi.
23

34
## Current situation
45

56
Apache Kafka provides the [`connections.max.reauth.ms`](https://kafka.apache.org/documentation/#brokerconfigs_connections.max.reauth.ms) configuration parameter which can be set at broker level for all listeners or a specific listener.
67

7-
Currently, Strimzi doesn't have support for specifying such a parameter at both broker or listener level because the `listener.` prefix is part of the list of the forbidden configurations for the `spec.kafka.config` section.
8+
Currently, Strimzi supports setting `connections.max.reauth.ms` broker-wide through `spec.kafka.config`. Per-listener settings cannot be configured this way, because `listener.` properties are forbidden.
89

9-
However, this configuration is already supported for [OAuth](https://strimzi.io/docs/operators/latest/full/configuring.html#type-KafkaListenerAuthenticationOAuth-reference) at listener level under `authentication` field and can be set for [`custom` type authentication](https://strimzi.io/docs/operators/latest/full/configuring.html#type-KafkaListenerAuthenticationCustom-schema-reference) under `listenerConfig` field.
10+
The configuration is already supported at the listener level for [OAuth](https://strimzi.io/docs/operators/latest/full/configuring.html#type-KafkaListenerAuthenticationOAuth-reference) through the `authentication` field, and for [`custom` type authentication](https://strimzi.io/docs/operators/latest/full/configuring.html#type-KafkaListenerAuthenticationCustom-schema-reference) through the `listenerConfig` field.
11+
12+
Note: OAuth configuration through `type: oauth` is planned to be deprecated. Future configurations would use `type: custom` with the appropriate OAuth settings instead.
1013

1114
## Motivation
1215

13-
The `connections.max.reauth.ms` is a useful configuration for SCRAM authentications enabled on a specific listener to define the maximum lifetime of a client connection before re-authentication is required. This ensures that clients with long lived connections periodically re-authenticate in case passwords already changed and reduces the risk of having connections with expired or compromised credentials. Since this is already supported/can be set for both OAuth and `custom` type authentications, it makes sense to support it for SCRAM authentications too.
16+
The `connections.max.reauth.ms` is a useful configuration for SCRAM authentications enabled on a specific listener to define the maximum lifetime of a client connection before re-authentication is required. This ensures that clients with long lived connections periodically re-authenticate in case passwords already changed and reduces the risk of having connections with expired or compromised credentials. Since this configuration is already supported for OAuth and `custom` type authentications, it makes sense to support it for SCRAM authentications too.
1417

1518
## Proposal
1619

17-
`maxSecondsWithoutReauthentication` field already exists for `KafkaListenerAuthenticationOAuth` class, so for consistency, the same field will be added `KafkaListenerAuthenticationScramSha512` class. User can set the configuration shown in the following example:
20+
The `maxSecondsWithoutReauthentication` field already exists for `KafkaListenerAuthenticationOAuth` class, so for consistency, the same field will be added to the `KafkaListenerAuthenticationScramSha512` class. Users can set the configuration as shown in the following example:
1821

1922
```yaml
2023
apiVersion: kafka.strimzi.io/v1beta2
@@ -41,6 +44,10 @@ spec:
4144
4245
## Compatibility
4346
44-
As this is a new configuration, there is no backwards compatibility issues relating to this proposal.
47+
As this is a new configuration, there are no backwards compatibility issues relating to this proposal.
4548
4649
## Rejected alternatives
50+
51+
- Allow users configure per-listener options in `.spec.kafka.config` instead of adding a new API field. This will help avoid ending up with too many various options like OAuth authentication, which is one of the reason it is getting deprecated. To implement this, one way would be to add this field to the [`FORBIDDEN_PREFIX_EXCEPTIONS`](https://github.com/strimzi/strimzi-kafka-operator/blob/main/api/src/main/java/io/strimzi/api/kafka/model/kafka/KafkaClusterSpec.java#L70) with some form of regular expression, however, this could be quite an expensive check to do for all configurations. Given that there is not many other configurations that can be configured at listener level for SCRAM authentication, I think the risk of ending up with too many API fields like OAuth is small.
52+
53+
- This field can be already configured for `type: custom` authentication so we don't need to add support for it. However, if existing users of SCRAM authentication, want to set this field, they would have to reconfigure their entire authentication section in their Kafka CR to change it from `type: scram` to `type: custom` and then change/set all the neccessary fields for `type: custom`.

0 commit comments

Comments
 (0)