lundi 2 mars 2015

Access denied when linking to markdown file on s3

I have a application that includes release notes for deploying apps. I am storing the release note for an app on s3. I store the url to the release notes in the app class. When clicking on the link I get an access denied error. I've tried this with both secure: false and secure: true using the aws-sdk.


error



<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>...</RequestId>
<HostId>...</HostId>
</Error>


.rake



begin
notes = bucket.objects["_inbox/#{name}_RELEASE_NOTES.md"]
notes.try do
notes_path = File.join('ios', name, version,
build_string, "#{name}_RELEASE_NOTES.md")
notes_url = notes.move_to(notes_path).public_url(secure: false).to_s
end
rescue StandardError => e
puts "No #{name}_RELEASE_NOTES.md found"
puts e.messages
end


_full.html.erb



<li>
<% if version.release_notes_url %>
<%= link_to "Release Notes", version.release_notes_url %>
<% else %>
<%= "No Release Notes" %>
<% end %>
</li>




Aucun commentaire:

Enregistrer un commentaire