opensearch-project / opensearch-project/opensearch-ruby
[BUG] request_signer inconsistent body serialization
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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