holochain / soa-toolbox

soa-toolbox is a set of plugins for Miro that give special functionality
22 stars 0 forks source link

Use config file to protect authentication data #5

Closed qubist closed 5 years ago

qubist commented 5 years ago

In my understanding this is what needs to happen:

Connoropolous commented 5 years ago

@qubist I can offer a bit of help here...

Connoropolous commented 5 years ago

For the environment variable aspect... you'll want to generate a Github token for Github calls.

This is the lib to take a look into: https://www.npmjs.com/package/dotenv

Imagine the env var name is GH_TOKEN in a .env file you might set GH_TOKEN=1nasdkfj...

In the nodejs simpleserver.js you would reference it by process.env.GH_TOKEN

Connoropolous commented 5 years ago

For the HTTP calls...

I would recommend using a POST request with fetch for the client side JS call to the ngrok/simpleserver

For the simpleserver pass through to GH... there's lots of nice simple HTTP libs, I would recommend request. Take the body of the data passed to the endpoint, and potentially just pass it straight to the github API call that needs to be made

qubist commented 5 years ago

Thanks @Connoropolous!

qubist commented 5 years ago

Whoops; this isn't resolved until we commit 🙃

qubist commented 5 years ago

Resolved by 019b0ea93050857184e605cec063247e53901b65