opensearch-project / opensearch-project/opensearch-ruby

[BUG] request_signer inconsistent body serialization

Open
#311 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
114
Forks
60
PR merge metrics
No merged PRs in 30d

Description

What is the bug?

The body that is being used by the request signer is not the same as the one being sent on the wire. This results in a invalid signature 403 error.

How can one reproduce the bug?

Use the latest beta versions of the gems.

What is the expected behavior?

The body used in the signature generation should be the same as the one actually sent to server.

Do you have any additional context?

This was originally fixed in https://github.com/opensearch-project/opensearch-ruby-aws-sigv4/pull/24 However, the new rewrite of this functionality has caused a regression. The request_signer is calling body.to_json on the body, however the transports are using __convert_to_json(body).

Original issue #141

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the request_signer path with the transports' __convert_to_json(body) serialization; the issue identifies request_signer and the transport code as the relevant entry points. Confirm the signature input and wire body use identical serialization, then verify the regression no longer produces an invalid signature 403.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.