-
Notifications
You must be signed in to change notification settings - Fork 64
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
[BUG]Host' or ':authority' must be a 'SignedHeader' in the AWS Authorization. #248
Comments
@dmnlk I have been modifying https://github.com/dblock/opensearch-php-client-demo and it does work without a custom transport for me.
and the who thing with Psr, working code in https://github.com/dblock/opensearch-php-client-demo/blob/2.4.0/index.php. I used the existing |
@kimpepper I am not sure the |
@dblock |
@dblock Upon investigation, I found that in the sendRequest method of the SigningClientDecorator, neither the URL nor the host could be retrieved when calling $request->getUri()->getHost(). Getting it from environment variables introduces too much dependency, so I believe it would be better to retrieve it from within the request object. I will continue investigating, and if I manage to fix it, I will submit a PR request. |
I've added a test to show how it works. |
The test in #252 shows that the Host can be retrieved. I wonder how you are configuring the client in order for it not to be? I don't think we should just re-add the header in the |
Let's discuss in #253. I couldn't get the header from the client in my sample. |
Confirmed that you need to set the default |
@kimpepper Unfortunately it works with a mock implementation but doesn't work with the real one. The If you have an AWS OpenSearch you can try it with https://github.com/dblock/opensearch-php-client-demo/tree/2.4.0 ( Maybe I missed something or you have a better idea? If the above is correct, the |
Ah I see. Yes the problem is the |
What is the bug?
We are performing a migration based on PR233.
This is a service that used IAM role authentication within a container on AWS Fargate.
After the migration, when executing a request, the following error occurs:
Host' or ':authority' must be a 'SignedHeader' in the AWS Authorization.
The code is as follows:
After changing the code as shown below, a 400 Bad Request is returned
SigningClientDecorator.php
Since it works without any issues on the local environment with OpenSearch, I believe there might be a problem with the request process to AWS OpenSearch.
https://github.com/opensearch-project/opensearch-php/blob/main/USER_GUIDE.md#setsigv4credentialprovider-for-aws-opensearch-service
This page is not yet updated to support the new code, so I am proceeding with the migration through trial and error.
If the migration is successful, I plan to create a PR to update this user guide.
How can one reproduce the bug?
use openseach in AWS
What is the expected behavior?
A clear and concise description of what you expected to happen.
migrate psr interface
What is your host/environment?
Operating system, version.
debian php
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
Add any other context about the problem.
The text was updated successfully, but these errors were encountered: