I edited my nginx vhost for this duniter node:
# if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
# }
# if ($request_method = 'POST') {
# add_header 'Access-Control-Allow-Origin' '*';
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
# add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
# add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
# }
# if ($request_method = 'GET') {
# add_header 'Access-Control-Allow-Origin' '*';
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
# add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
# add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
# }
I commented the request_method
conditions, that mean I use the same headers rules for all requests kind, based on OPTION one. And that’s ok now, you don’t have any CORS problem for POST with that: CORS Tester - Test a URL for valid CORS headers, everything is green …
But, the thing is, i guess you should not have to use POST for GVA requests, since it’s graphql so it use websocket, which is OPTIONS kind, but maybe i’m wrong about it. You use same lib me for graphql with flutter, which is inspired from Apollo js lib, so this is websocket.
Why do you need post request on GVA exactly ?
This nginx vhost was made by Elois, who create this API, so he probably split request_method
headers option for a reason, but honestly, I couldn’t tell you which ones. So I let my config like that for now, I think there is no problem with that.
You can’t, g1nkgo is only for temporary fast account, he designed it like this.
It doesn’t store the private key on a “website”, but only in the local storage of your browser, so it’s local storage (like cesium web used to do before it was bricked, and like Ğecko web could do very easily too).
Yes, that’s what safety purists advocate. Use a web extension that signs transactions instead of the web pages themselves. This is what polkadot.js does for example.
… but this risk is relative.
This is for the sole purpose of preventing man-in-the-middle attacks. But if the domain is safe, and people are connected to proper DNS servers, then I have a hard time even conceiving of security problems. Nor any kind of other potential attacks on people’s devices directly, for which the browser extension would not protect at all.
@flodef can you please share the link to the solana web client you showed me the other day?
Apparently they don’t care about this kind of security convention…
But beyond the security aspect, I see a lot of advantages of focusing on the Ğ1-companion browser extension:
- It makes it accessible to any developer to perform fully secure payments, as well as any kind of transaction, through a simple HTML web page with very little javascript, only for calling the extension for the signature. Anyone can create a Ğ1 web client without having to worry about implementing cryptographic mechanisms or security, since everything is marked out by the calls to the web extension.
- This extension will allow a whole bunch of extra things, overloading some web pages, especially to allow authentication to any service provided for, with its Ğ1 keys (the absolute SSO for Ğ1 users).
So g1nkgo is a client made to be coded quickly, especially thanks to the durt lib, but those who want to use the Ğ1v1 quickly, without much commitment.
I also remind that it is only a payment client, and does not contain all the logic of interaction with the web of trust. So the need for security is less important.
Maybe it would be interesting to encourage users to load these temporary wallets only with small amounts, with maximum limits for example? But it might make the UX more cumbersome for not much.
@vjrj I think we should consider this client as temporary, meeting an urgent need for the users now. But do you agree to join forces on Ğecko and Ğ1companion for what concerns v2?
edit: ok i had problems with jaklis with this nginx configuration, so I rollback.