Support for Signed Requests?
jgandt opened this issue · comments
Hi there,
The library looks great! It was easy to setup and use which is exactly what I was looking for.
However, I had "Enforce Signed Requests" turned on for my application but I can't find support for that option anywhere in the library.
Am I missing it?
If it's not in place, I would love to contribute. I am pretty new to Elixir and I haven't the foggiest of where to begin to add support. I'll see what I can do anyhow.
For now I've turned off Enforcing Signed Requests, but for some of the IG API features, it is a required setting.
Hi @jgandt, when I first wrote this library, Instagram provided open access to their API. Right now it is severely locked down and I don't even have live access anymore. I maintain this library in it's current state and fix bugs, but I am not currently developing it any further.
However, if you wish to add support for Secure Requests and send me a PR, I'll happily merge it and release a new version for you. I do ask that you include some tests (you can see some of my tests, they are very simple and use exvcr to replay requests/responses).
If I were to implement this, I would probably either add a :secure
atom flag to the functions which can use secure requests (this would be a little more tedious) or alternatively add a :secure
flag to Elixtagram.configure
and then set an application variable (using Application.put_env/2
) there. There's an examples in ruby of how to implement this here. The way you would then do this is to write a function to generate the signatures, and call in the base API (http functions) if the aforementioned application variable is set.
If you do give this a go and get stuck, let me know and I'll help if I can.
I've already got an implementation without tests. Will probably put up a PR in the next day or so :)
Also, WOW IG really neutered their sandbox applications. I didn't realize how bad it was until I saw the "Limited to sandbox users." AUGH!
Gonna close this for now. If you have a PR with ExVCR tests @sudostack (or anyone else) please feel free to submit it ;)