Frameio / Frameio/cloudfront-signer

Signed URLS Not Working Fully

Open
#6 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
9
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Thank you for this library. I wrestled with it quite a bit but have learned a lot along the way.

## Description
I have a phoenix 1.7.9 project. Early on in the project, I installed this library and wrote a function to test the integration of my AWS services with my context code. It worked so I was pumped and moved on. Fast forward a few weeks to the point where I was beginning to integrate these services into my web application and I encountered an odd behavior that I still can't fully explain. The URL generation continues to work in an iex session while it fails with a 403 error when called over http. After a lot of time debugging and investing primarily in the AWS side, I was pretty confident in my AWS config and the fact that it _did_ work in iex told me something. So, I looked more closely into the library and just noticed that there has not been a lot of recent activity. I didn't think much of it at the time evaluating the library, but decided to try to pull the library files in as local modules. Along the way, I made one main opportunistic change to use Jason instead of Poison since the Phoenix project comes with Jason already. After pulling in the code locally, my endpoint now works. It leaves me with a question of whether to just use the local code and move on, or see if I could help out in any way. I speculate it could be something with the policy signing but am not sure.

## Environment
Erlang/OTP 26 [erts-14.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Elixir 1.15.6 (compiled with Erlang/OTP 26)

## Current Behavior
Given the above, a phoenix controller action that returns the URL as a plain text response does not work.
## Expected Behavior
A controller action returning the URL should work.
## Possible Solution
I wish I had more ideas.
- update dependencies?
## Steps to Reproduce
- Setup system to match Environment section.
- Create a Phoenix 1.7.9 project
- expose an endpoint that returns the signed URL
- should see a 403 from CloudFront

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the signed-URL endpoint in a Phoenix 1.7.9 project using the environment listed, then compare its HTTP behavior with the working iex case. Investigate the policy-signing path and the Jason-versus-Poison dependency change; done means the controller response produces a CloudFront URL that does not return 403.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, elixir
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.