ipfs / notes

IPFS Collaborative Notebook for Research
MIT License
401 stars 30 forks source link

Is it possible now to use authenticate http token request? #234

Open baimurzin opened 7 years ago

baimurzin commented 7 years ago

I have found some issues where were discussions about http tokens? But it was about half year ago. Is it possible now can someone point me to that have to do to implement this. And is it possible to set any permissions to tokens, for example, one token can read all files, and another one can read only limited quantity? Thanks advance

lidel commented 7 years ago

Hi, I think access control via tokens is not implemented yet:

baimurzin commented 7 years ago

@lidel Hi! It means that I cannot create any token to make http request and do something?

lidel commented 7 years ago

There are no tokens in current implementation.

You have full (writable) API at port :5001 and a read-only subset of it at :8080:

That is what you have to work with right now. If you need to use writable API, it is up to you to secure it by other means.

One way to do it, is to add a reverse HTTP proxy as a gatekeeper.

I think you should be able to find ready-to-use projects that do just that. Examples below authenticate via OAuth:

baimurzin commented 7 years ago

Correct me if I'm wrong understood. No it it's impossible to include tokens implementation, but we can do the same things using oauth or doorman?

lidel commented 7 years ago

Tokens are possible, but not implemented yet. You need to use third-party solution for now.

baimurzin commented 7 years ago

@lidel thanks a lot! If you don't mind could, can I get one other question? Are there any example how to integrate ipfs with with libraries? May be you know

lidel commented 7 years ago

If your question was about things like doorman or other auth2 proxies, no, I did not see any examples, sorry.

If you ask about embedding IPFS library inside of your application to work around security concerns related to HTTP API, then yes. It may be more difficult, but you can do it with both JS and Go versions:

baimurzin commented 7 years ago

@lidel Thanks! How do you think is it a good idea to use ipfs as a solution in my task. What I want: For example, I have IoT device and I need to share resources between others. How I think I will do: I think I will try to install this IPFS on device and then release grants/tokens to users with diverse permissions How do you think am I on the right track?

lidel commented 7 years ago

Tokens are only for securing access to HTTP API. Read-only data itself is not encrypted in IPFS. Please keep in mind that it is up to you to keep it secure (by encrypting it or using closed, private peer network).

Hard to say if IPFS is the right match for your product without going deep into specifics (and I am afraid i don't have bandwidth for that 🙃 ), but I'll point you to some relevant reading material that may help you in making decision:

Sadly this repository is not a place for this kind of discussion – I suggest closing this issue and asking questions at https://github.com/ipfs/faq/ or http://ipfs.trydiscourse.com/c/help.

You may get better answers there.