Hello, I have been able to run my test code using cloudsearch policy "Allow open access to all services",
i.e. any anonymous user can submit documents.
However, as soon as I set a policy that is suitable for my production environment, i.e. "anonymous can search, only a IAM user can add documents", I get the following error:
Exception in thread "main" aws.services.cloudsearchv2.AmazonCloudSearchRequestException: {
"__type": "#AccessDenied",
"errors": [{"message": "[*Deprecated*: Use the outer message field] User: anonymous is not authorized to perform: cloudsearch:document on resource: arn:aws:cloudsearch:eu-west-1:170264827209:domain/test"}],
"message": "User: anonymous is not authorized to perform: cloudsearch:document on resource: arn:aws:cloudsearch:eu-west-1:170264827209:domain/test",
"status": "error"
}
at aws.services.cloudsearchv2.AmazonCloudSearchClient.updateDocumentRequest(AmazonCloudSearchClient.java:258)
After inspecting the code from your library, it seems that there is no support at all for authenticated requests, because these requests should be signed according to this Signing Amazon CloudSearch Requests.
Here is an excerpt of the method used to add multiple documents:
Hello, I have been able to run my test code using cloudsearch policy "Allow open access to all services", i.e. any anonymous user can submit documents. However, as soon as I set a policy that is suitable for my production environment, i.e. "anonymous can search, only a IAM user can add documents", I get the following error:
After inspecting the code from your library, it seems that there is no support at all for authenticated requests, because these requests should be signed according to this Signing Amazon CloudSearch Requests. Here is an excerpt of the method used to add multiple documents:
I do not see the "Authorization" header or any other authentication information.
Do you confirm that the library only works when CloudSearch is configured to use an anonymous policy?