X-Parse-Revocable-Session with Parse REST API - parse-platform

I'm trying to migrate to Revocable Sessions with Parse. I haven't enabled it yet in the console because all my clients don't fully support it yet, but I was following Parse's blog post on migration and added X-Parse-Revocable-Session to my header using Parse's REST API. When I make the call I get the following back:
Request header field X-Parse-Revocable-Session is not allowed by Access-Control-Allow-Headers.
Then I checked the response header and noticed the following coming back from Parse:
Access-Control-Allow-Headers:X-Parse-REST-API-Key, X-Parse-Application-Id, X-Parse-Client-Version, X-Parse-Session-Token, X-Requested-With, Content-Type
X-Parse Revocable-Session isn't in the list. Has anyone been able to get it working using the REST API? Am I missing something?

This is a bug on Parse side and has been confirmed by the team. https://developers.facebook.com/bugs/322026507921274/ . It will sorted soon.

Related

Using Rate Limiting doesn't add Header to response and gets CORS error in client

I'm trying to adapt this tutorial to my server using the Bucket4j Spring Boot Starter.
I'm using an application.properties file.
I can limit the api queries with no problem, but the client doesn't get a 429 error, on the client I get a CORS error.
I figure this is because I'm not adding a header to my server response when I'm limiting the api queries, but is there any way to add this throught the application.properties template?
On the official documentation there is a value called "bucket4j.filters[0].http-response-headers.<MY_CUSTOM_HEADER>=MY_CUSTOM_HEADER_VALUE" but I can't figure how to use it, did anybody use it?
Thanks
You can avoid CORS errors by adding the proper header:
bucket4j.filters[0].http-response-headers.Access-Control-Allow-Origin="https://<clientUri>:<clientPort>"
and if you are using some form of authentication you may want to also add this:
bucket4j.filters[0].http-response-headers.Access-Control-Allow-Credentials=true

How to do a REST POST with Grafana AJAX panel?

I have a SpringBoot API with a POST end-point.
Trying to make a call to end-point from Grafana AJAX panel
It seems to be hitting the end-point but error occurs complaining about missing body.
error: "Bad Request" message: "Required request body is missing: public org.springframework.http.ResponseEntity status: 400
But the request has indeed a body.
Have been looking for possible POST examples for hrs now but no joy, e.g.
https://community.grafana.com/t/using-ajax-plugin-to-make-rest-call/6674
Any tips or solutions would be much appreciated.
Asked this same question on Grafana support forum.
Turns out the plugin/panel in question does not support POST with body.
Indeed, it looks like POST JSON data to backend is not currently supported. There seem to be two related issues here:
https://github.com/ryantxu/ajax-panel/issues/48
https://github.com/ryantxu/ajax-panel/issues/13
You're welcome to share your thoughts there, it looks like this feature request has been added as a future enhancement but I am not sure when that work will be completed. In the meantime, you may need to forego using the AJAX Plugin.
So it's basically useless as my backend API end-point requires a body.
try the new JSON API plugin
https://grafana.com/grafana/plugins/marcusolsson-json-datasource/?tab=changelog
or AjaxPanel plugin for more control

Content Security Violation in Shopify

I am using Shopify and I'm making an ajax get request to a different server. I have just implemented it so I'm testing it on the console. The request is getting through and I'm getting the response I want but I am also getting the following message:
[Report Only] Refused to connect to 'https://myurl.com/ApiClientes/ciudades' because it violates the >following Content Security Policy directive: "connect-src 'self' *.shopifycloud.com .shopifysvc.com >.amazon.com *.paypal.com *.facebook.com sessions.bugsnag.com analytics.tiktok.com bat.bing.com >www.google-analytics.com ct.pinterest.com stats.g.doubleclick.net".
I would like to get rid of it. Don't know what it is or what it means. I could really use some help. Thanks in advance :)
To handle this issue, don't make direct request to third-party server instead create one url at 'https://yourdomain.com/anypath/handlereqeust?r={requestURL}' to handle all the requests from Shopify store
Then make request to Shopify app as mentioned in this link: https://shopify.dev/apps/online-store/app-proxies

Shopify webhook verification in parse

I am trying to get a shopify webhook to fill my customer class in parse.com, however something must go wrong. I don't know how to verify the parse response since Shopify sends this webhook out from it's ruby backend. I used requestbin to catch the webhook and I replicated a post request using postman to my parse url and everything works fine. Does anyone know how to debug requests like these? Is there a console in Parse where I can see all the incoming requests and the responses Parse.com sent back?
Try using Runscope for debugging webhooks. Full guide here: https://www.runscope.com/provider-guide/troubleshooting-webhooks - this is more than just a request bin. It's a full transparent proxy that will, like a bin, record the webhook notification, but will also pass it along to the intended destination (your webhook receiver) and record that response as well.

Venmo API call from client side. Access-Control-Allow-Origin?

I'm building a small web app with Ember.js and Firebase so as of now I don't have a framework. I'm trying to use Venmo's OAuth and API to get usernames, emails, and friends. I got OAuth to work and I get a client-side access token to use in an API call, but whenever I try and send a GET to https://api.venmo.com/v1/me?access_token=<access_token> using AJAX or CORS I get an error saying XMLHttpRequest cannot load https://api.venmo.com/v1/me?access_token=<access_token>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Is there a way to do this with javascript
I'm an API engineer over # Venmo, and we're looking to open up CORS support very soon, in the next couple months hopefully. Feel free to email developer#venmo.com and bug us if you need to :P

Resources