Skip to content

Added Secondary token support for Raw Http input#25544

Merged
danotorrey merged 7 commits intomasterfrom
issue-13702
Apr 8, 2026
Merged

Added Secondary token support for Raw Http input#25544
danotorrey merged 7 commits intomasterfrom
issue-13702

Conversation

@Nithin-Kasam
Copy link
Copy Markdown
Collaborator

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@Nithin-Kasam Nithin-Kasam requested a review from a team April 2, 2026 12:19
Copy link
Copy Markdown
Contributor

@ryan-carroll-graylog ryan-carroll-graylog left a comment

Choose a reason for hiding this comment

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

Looks good and tests successfully!

Copy link
Copy Markdown
Contributor

@kingzacko1 kingzacko1 left a comment

Choose a reason for hiding this comment

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

Tests successfully, existing inputs behave as normal after upgrade.

Copy link
Copy Markdown
Contributor

@danotorrey danotorrey left a comment

Choose a reason for hiding this comment

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

LGTM and tests successfully.

FYI, I just pushed up one changelog nit to note that this affects multiple HTTP-based inputs (those extending AbstractHttpTransport — Raw HTTP, GELF HTTP, and OTel HTTP). Also cleaned up a couple test nits and extended OTel tests.

If all looks good with my last commit, we should be good to merge this when checks are green again.

@danotorrey danotorrey merged commit c5fbd0b into master Apr 8, 2026
22 of 23 checks passed
@danotorrey danotorrey deleted the issue-13702 branch April 8, 2026 16:37
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.

4 participants