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

fix: source payloads with query params to be allowed without body #4677

Merged
merged 16 commits into from
May 23, 2024

Conversation

shrouti1507
Copy link
Contributor

@shrouti1507 shrouti1507 commented May 13, 2024

Description

Adjust source will be sending query parameters without a body. Hence we need to allow these kinds of requests and make payload for it.

In order to test added webhook in config/config.yaml in sourceListForParsingParams block and tested with below call :

curl --location 'http://localhost:8080/v1/webhook?writeKey=<writekey>&gps_adid=38400000-8cf0-11bd-b23e-10b96e40000d&adid=18546f6171f67e29d1cb983322ad1329&tracker_token=abc123&tracker_name=Network1%3A%3AChristmas%3A%3AReindeers%3A%3A320x70_en&app_name=MyApp&activity_kind=event&created_at=1404214665&event_token=bkrfgq&event_name=purchase_100_coins%2Fmobile_attribution' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data '{
     "abc":1
}'

Got the output :

Screenshot 2024-05-14 at 7 20 49 PM

Also checked with :

curl --location --request POST 'http://localhost:8080/v1/webhook?writeKey=<writekey>&gps_adid=38400000-8cf0-11bd-b23e-10b96e40000d&adid=18546f6171f67e29d1cb983322ad1329&tracker_token=abc123&tracker_name=Network1%3A%3AChristmas%3A%3AReindeers%3A%3A320x70_en&app_name=MyApp&activity_kind=event&created_at=1404214665&event_token=bkrfgq&event_name=purchase_100_coins%2Fmobile_attribution' \
--header 'Authorization: Basic Og==' \
--data ''

got output:

Screenshot 2024-05-14 at 7 19 31 PM

Linear Ticket

resolves INT-2129
https://linear.app/rudderstack/issue/INT-2129/enabling-query-parameters-handling-for-rudder-sources-in-server-side

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Copy link
Contributor

coderabbitai bot commented May 13, 2024

Important

Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@shrouti1507 shrouti1507 self-assigned this May 13, 2024
@shrouti1507 shrouti1507 requested a review from utsabc May 13, 2024 12:14
Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 76.19048% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 74.49%. Comparing base (96a0180) to head (e3b4afe).

Current head e3b4afe differs from pull request most recent head ce294f5

Please upload reports for the commit ce294f5 to get more accurate results.

Files Patch % Lines
gateway/webhook/webhook.go 76.19% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4677      +/-   ##
==========================================
- Coverage   74.60%   74.49%   -0.12%     
==========================================
  Files         413      413              
  Lines       48744    48708      -36     
==========================================
- Hits        36365    36284      -81     
- Misses      10012    10043      +31     
- Partials     2367     2381      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@achettyiitr achettyiitr self-requested a review May 13, 2024 18:44
@shrouti1507 shrouti1507 added the enhancement New feature or request label May 14, 2024
shrouti1507 and others added 2 commits May 14, 2024 15:07
shrouti1507 and others added 2 commits May 15, 2024 11:06
gateway/webhook/webhook.go Outdated Show resolved Hide resolved
gateway/webhook/webhook.go Outdated Show resolved Hide resolved
gateway/webhook/webhook_test.go Outdated Show resolved Hide resolved
shrouti1507 and others added 2 commits May 15, 2024 17:12
Co-authored-by: Akash Chetty <achetty.iitr@gmail.com>
gateway/webhook/webhook.go Outdated Show resolved Hide resolved
@shrouti1507 shrouti1507 requested a review from cisse21 May 16, 2024 06:04
@shrouti1507 shrouti1507 enabled auto-merge (squash) May 23, 2024 06:52
@shrouti1507 shrouti1507 disabled auto-merge May 23, 2024 07:04
@shrouti1507 shrouti1507 merged commit affd6bc into master May 23, 2024
50 checks passed
@shrouti1507 shrouti1507 deleted the allow_no_body_for_query_parameter_source branch May 23, 2024 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants