-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Oauth2 Client credentials flow use scopes from the keyfile as w…
…ell (#1244) ### Motivation As the issue shows when using Pulsarctl which works with a context as configuration style, Oauth2 is used under the hood. However the library does not expose any way to inject the context configuration `scope` value, and then relies on reading that from the `keyFile` for `client_credentials flow`. However that is not being utilized in the current code as the scope value is not read from from the file. *Explain here the context, and why you're making that change. What is the problem you're trying to solve.* To allow the usage of oauth2 with a keyfile in Pulsarctl 3+ which it doesn't right now ### Modifications Alters so reading the keyFile for client credentials also returns the `scope` value. The value is then split on spaces, and added to a temporary slice. After that the value of any additionalScopes that was already in the options is then added to the temp slice as well. In the end the additionalScopes property on the options is set to the temp slice containing values from previous additionalScopes and the ones from the keyFile. (cherry picked from commit c3b0633)
- Loading branch information
1 parent
73fd374
commit 3cbb353
Showing
4 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters