Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
shopify-graphql_proxy
Advanced tools
Gem to securely proxy graphql requests to Shopify from Rack based Apps
Add the following to your Gemfile
gem 'shopify-graphql_proxy', '-> 0.1.0'
Or install:
gem install shopify-graphql_proxy
It is recommended to use the omniauth-shopify-oauth2 to authenticate requests with Shopify
use Shopify::GraphQLProxy
This middleware expects that the session data is stored in the shopify key
session[:shopify] = {
shop: shop_name,
token: token
}
It will proxy any POST
request to /graphql
on your app to the current logged in shop found in session
fetch('/graphql', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query: '{ shop { name } }' }),
credentials: 'include'
})
.then(res => res.json())
.then(res => console.log(res.data));
You can use the Rack::Builder#map method to specify middleware to run under specific path
# /shopify/graphql
map('/shopify') do
use Shopify::GraphQLProxy
run Proc.new { |env| [200, {'Content-Type' => 'text/plain'}, ['get rack\'d']]}
end
map('/') do
run App
end
FAQs
Unknown package
We found that shopify-graphql_proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.