Skip to content
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

Added doc to use oauth for pulsar scaler #1161

Merged
merged 8 commits into from
Sep 17, 2023

Conversation

mingmcb
Copy link
Contributor

@mingmcb mingmcb commented Jun 19, 2023

Added doc to use oauth for pulsar scaler

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)

Related to kedacore/keda#4709

@mingmcb mingmcb requested a review from a team as a code owner June 19, 2023 14:33
@netlify
Copy link

netlify bot commented Jun 19, 2023

Deploy Preview for keda ready!

Name Link
🔨 Latest commit 16a7f97
🔍 Latest deploy log https://app.netlify.com/sites/keda/deploys/650473031883f30008855c5b
😎 Deploy Preview https://deploy-preview-1161--keda.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

Thank you for your contribution! 🙏 We will review your PR as soon as possible.

While you are waiting, make sure to:

  • Add your contribution to all applicable KEDA versions
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Learn more about:

Signed-off-by: Ming Meng <ming.meng@collibra.com>
Comment on lines 36 to 39
- `oauthTokenURI` - Token endpoint for your OAuth provider
- `grantType` - only `client_credentials` is supported
- `scopes` - space delimited oauth scopes(Optional).
- `clientID` - clientID from your OAuth provider. It will be ignored if clientID is also provided from `authenticationRef`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move this to TriggerAuthentication. We tend to not put credentials related stuff into trigger config.

@tomkerkhove @JorTurFer WDYT

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that clientID and oauthTokenURI are secrets, I mean, AFAIK, only the clientSecret is a sensitive data, clientId usually is part of the query string

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we can move it into TriggerAuthentication as it's related with the credentials, but they aren't sensitive data

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this is what I mean. It logically belongs there imho. Kafka is done this way also.

Copy link
Contributor Author

@mingmcb mingmcb Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clientID is already part of TirggerAuthentication. see the code example: https://github.com/kedacore/keda-docs/pull/1161/files#diff-36e3935f303a0a808c6ee2bc08e18d62f54d555079a822c101882f3aec0198a6R268-R280

The idea is to have the additional clientID in the metadata is mainly for ease of use. with OAuth RFC8705, it is possible to request the access token without the secret. In this case, developer can just have everything in the metadata without secret. see example for this case: https://github.com/kedacore/keda-docs/pull/1161/files#diff-36e3935f303a0a808c6ee2bc08e18d62f54d555079a822c101882f3aec0198a6R308-R328

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay make sense. Could you please then add also the scopes and oauthTokenURI to TriggerAuth as well? The same way clientID is done.

- `authModes` - a comma separated list of authentication modes to use. (Values: `bearer`, `tls`,`basic`, Default: `""`, Optional, `tls,bearer` or `tls,basic` are valid combinations and would indicate mutual TLS to secure the connection and then `bearer` or `basic` headers should be added to the HTTP request)
- `authModes` - a comma separated list of authentication modes to use. (Values: `bearer`, `tls`, `basic`, `oauth`, Default: `""`, Optional, `tls,bearer` or `tls,basic` are valid combinations and would indicate mutual TLS to secure the connection and then `bearer` or `basic` headers should be added to the HTTP request)
- `oauthTokenURI` - Token endpoint for your OAuth provider
- `grantType` - only `client_credentials` is supported
Copy link
Member

@zroubalik zroubalik Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if client_credentials is the only supported type, then we can make it a default one, right? And we don't have make it configurable and add a property for it in here, am I correct in my assumption? If we add another type in the future, we can expose this config then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I can make it as default if works better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah and remove the property from the config pls

@mingmcb mingmcb force-pushed the feat-pulsar-oauth-extension branch from 9e2d4a4 to b37416c Compare June 21, 2023 21:59
Signed-off-by: Ming Meng <ming.meng@collibra.com>
@mingmcb mingmcb force-pushed the feat-pulsar-oauth-extension branch from b37416c to 4b49f3d Compare June 21, 2023 22:02
@mingmcb mingmcb requested review from zroubalik and JorTurFer June 21, 2023 22:02
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope should be a comma separated list, not space separated list. To be consistent with the rest of the config (eg. authModes). I missed that when I did the previous review.

@mingmcb could you please fix that?

content/docs/2.10/scalers/pulsar.md Outdated Show resolved Hide resolved
content/docs/2.10/scalers/pulsar.md Outdated Show resolved Hide resolved
mingmcb and others added 3 commits June 22, 2023 15:00
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
Signed-off-by: Ming Meng <101287520+mingmcb@users.noreply.github.com>
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
Signed-off-by: Ming Meng <101287520+mingmcb@users.noreply.github.com>
@mingmcb mingmcb requested a review from zroubalik June 22, 2023 19:05
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move this to content/docs/2.12

mingmcb and others added 2 commits July 6, 2023 08:14
@mingmcb mingmcb force-pushed the feat-pulsar-oauth-extension branch from b23b3d1 to 7572aa4 Compare July 6, 2023 13:46
@mingmcb mingmcb requested a review from zroubalik July 6, 2023 13:47
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JorTurFer JorTurFer merged commit 3c74b90 into kedacore:main Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants