This repository was archived by the owner on Aug 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Assumes domain has public access? #23
Copy link
Copy link
Open
Description
If I add a policy to a domain which restricts access (to an IAM user or AWS account), adding/updating/searching all fail with:
"User: anonymous is not authorized to perform: cloudsearch:search on resource: arn:aws:cloudsearch:my-domain"
I believe this is because the gem is going through HTTP and not passing through any credentials. For example, in cloud_search.rb:
def self.post_sdf_list endpoint, sdf_list
uri = URI.parse("http://#{endpoint}/#{API_VERSION}/documents/batch")
req = Net::HTTP::Post.new(uri.path)
req.body = JSON.generate sdf_list
req["Content-Type"] = "application/json"
response = Net::HTTP.start(uri.host, uri.port){|http| http.request(req)}
if response.is_a? Net::HTTPSuccess
JSON.parse response.body
else
# Raise an exception based on the response see http://ruby-doc.org/stdlib-1.9.2/libdoc/net/http/rdoc/Net/HTTP.html
response.error!
end
end
or is this expected behavior (the gem only supports public domains)?
Thanks,
Rob
Metadata
Metadata
Assignees
Labels
No labels