Added Secondary token support for Raw Http input#25544
Open
Nithin-Kasam wants to merge 3 commits intomasterfrom
Open
Added Secondary token support for Raw Http input#25544Nithin-Kasam wants to merge 3 commits intomasterfrom
Nithin-Kasam wants to merge 3 commits intomasterfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This change introduces support for a secondary token in Raw HTTP input. It allows users to include an additional authentication token alongside the primary token when making HTTP requests.
The implementation ensures that both tokens are properly parsed and handled without affecting existing workflows. Backward compatibility is maintained for users who rely on a single token.
Motivation and Context
Previously, when the token is invalid the user needs to update to new token ,But now user can specify additional token such that when first token is invalid it will use the second token and process the request.
closes https://github.com/Graylog2/graylog-plugin-enterprise/issues/13702
How Has This Been Tested?
Configured input with both tokens token1 and token2 and sent request using curl,
curl -X POST http://localhost:5555/raw \n -H "Content-Type: application/json" \n -H "Authorization: Bearer old-token" \n -d '{"version":"1.1","host":"test","short_message":"primary token test"}'
curl -X POST http://localhost:5555/raw \n -H "Content-Type: application/json" \n -H "Authorization: Bearer new-token" \n -d '{"version":"1.1","host":"test","short_message":"secondary token test"}'
curl -X POST http://localhost:5555/raw \n -H "Content-Type: application/json" \n -H "Authorization: Bearer new-token" \n -d '{"version":"1.1","host":"test","short_message":"secondary token test 2 by deleting old token"}'
verfied the logs in Graylog dashboard.
Screenshots (if appropriate):
Types of changes
Checklist: