-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate additional OAuth 0.15.0 config options #9970
Conversation
8eef877
to
94337b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we would include docs on how to configure it for the Servic Accoutn configuration. Or will that be a separate Pr?
@@ -99,6 +99,7 @@ public class KafkaBridgeCluster extends AbstractModel implements SupportsLogging | |||
protected static final String ENV_VAR_KAFKA_BRIDGE_OAUTH_ACCESS_TOKEN = "KAFKA_BRIDGE_OAUTH_ACCESS_TOKEN"; | |||
protected static final String ENV_VAR_KAFKA_BRIDGE_OAUTH_REFRESH_TOKEN = "KAFKA_BRIDGE_OAUTH_REFRESH_TOKEN"; | |||
protected static final String ENV_VAR_KAFKA_BRIDGE_OAUTH_PASSWORD_GRANT_PASSWORD = "KAFKA_BRIDGE_OAUTH_PASSWORD_GRANT_PASSWORD"; | |||
protected static final String ENV_VAR_KAFKA_BRIDGE_OAUTH_CLIENT_ASSERTION = "KAFKA_BRIDGE_OAUTH_CLIENT_ASSERTION"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be used only in tests. So why do we need it? Should we move it to the test class? Or should it be actually set somewhere? The same applies to some of the other classes as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just following a pattern here. It's the kafka_bridge_config_generator.sh shell script that uses these same env vars to configure the bridge. I assume they are in this class as they are considered part of the contract. What does @ppatierno think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I'm a bit curios how you set the environment variable if you don't use the name anywhere in the production code. Is it assembled somewhere on the fly from some prefix and suffix? But I'm not aware of any contract that we add there a variable not referenced from the Java code itself - I'm certainly not following such contract in any of my PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these constants are indeed only used in tests and could be moved into some test class. But I'll defer to @ppatierno to give an opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the above env vars related constant were used here in the past as well IIRC but then we moved to this approach to build them https://github.com/strimzi/strimzi-kafka-operator/blob/main/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaBridgeCluster.java#L458
At this point, I guess we can removed them from here and move to test classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A separate PR is fine with me. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is fine to move the others in a separate PR. But we should not introduce new variables like this in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mstruk I saw you moved the env vars within this PR. Wasn't the plan to do that in a different one as stated above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ppatierno Given that I had to move one constant based on additional feedback, it was actually trivial to move the others as well and avoid the overhead of doing another PR. The idea of another PR was to get this one merged ASAP. But at this point doing another PR is an overhead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok makes sense thanks
I'm making a separate PR for that. But I can also add it to this one if you prefer. |
Doing it in a separate PR is fine. It was just not clear to me. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mstruk This looks good to me now. Thanks. Could you please rebase it so that I can run the regression tests?
The following options have been added to `authentication` section of type `oauth` of Kafka CR: - `userNamePrefix` - `serverBearerTokenLocation` The following options have been added to `authentication` section of type `oauth` of KafkaMirrorMaker, KafkaMirrorMaker2, KafkaConnectCluster, and KafkaBridge CRs: - `clientAssertion` - `clientAssertionLocation` - `clientAssertionType` - `saslExtensions` Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
…checkAccessTokenType` Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
/azp run regression |
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks @mstruk |
Type of change
Description
The following options have been added to
authentication
section of typeoauth
of Kafka CR:serverBearerTokenLocation
userNamePrefix
The following options have been added to
authentication
section of typeoauth
of KafkaMirrorMaker, KafkaMirrorMaker2, KafkaConnectCluster, and KafkaBridge CRs:accessTokenLocation
clientAssertion
clientAssertionLocation
clientAssertionType
saslExtensions
Checklist
Please go through this checklist and make sure all applicable tasks have been done