-
Notifications
You must be signed in to change notification settings - Fork 599
Fix for #3295 to ensure custom httpjson input with oauth2 auth and explicit scopes definition works #3297
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
Merged
Merged
Fix for #3295 to ensure custom httpjson input with oauth2 auth and explicit scopes definition works #3297
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you add a test to ensure that this is working as expected? You can construct an endpoint in the packages/httpjson/_dev/deploy/docker/files/config.yml file and make a test in the packages/httpjson/data_stream/generic/_dev/test/system/ directory to check that the scopes are correctly set.
Uh oh!
There was an error while loading. Please reload this page.
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.
Hi @efd6 - I've added the variable as per my commit no. 3 ( 3105bd5 ) ... there's nothing to add to the docker config file, I don't know if the stream container which provides a HTTP interface to test against is capable of echo'ing back the requested scopes as a "scope" value in the response, and my quick look at it suggests it isn't... and "scope" in an Oauth2 token response is optional. This should do the trick in terms of testing render of a list of scopes as would be generated by the Kibana/Fleet webUI to the Fleet API though.
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.
Hmm, actually, my bad, seems like it can
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.
Still an optional part of the response though... OAuth2 token endpoint doesn't need to include scopes, the assumption is that if a code comes back from a request that include scopes, then the token is valid for those.
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 what you will need to do is write some rules into the packages/httpjson/_dev/deploy/docker/files/config.yml file. This is the configuration for the stream tool.
Uh oh!
There was an error while loading. Please reload this page.
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.
That's lovely, where's the actual doco, or is the paying customer who's bug fixing Elastic's product (yes that means me.) supposed to reverse engineer stream tool too? Right now, the product I'm paying Elastic for - multiple platinum and enterprise level subscription Elastic Cloud deployments - can't do what it says it can do. The tests are clearly non-existent at present and I'm not going to burn a bunch of my time creating tests for Elastic's commercial product that I'm paying for, creating something that doesn't currently exist, based on documentation that doesn't exist.
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 can pick this up if you would like.
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.
TBH, noting "Contributor"... if you're not getting paid for this I don't feel you should burn your time either... is there no Elastic support team that this can be assigned to?
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 am an Elastic employee, so this is something I'm happy to do. If you'd like me to take this on, I can pick it up.