-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rpc): Opt-in HTTP RPC API Authorization #10218
Conversation
@lidel I have some concerns / questions here:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hacdias quick answers:
client/rpc
passing custom client is fine for now, let's keep this PR small, we can improve later (add support for creating RPC client with arbitrary options like custom headers and auth).- limiting blast radius sgtm, goal here is to establish tests, configuration and UX. we can upstream later if needed.
- yes, rename
--api-secret
to--api-auth
and make it use the same syntax as config (basic:user:pass
orbearer:foo
). To make UX nicer, let's assumebearer
when:
is not present in the string)
- see comments inline below
40e4eb8
to
25e8d3d
Compare
User should be informed when access is limited.
25e8d3d
to
a8966e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @hacdias!
I've added some additional docs and negative tests, should be ready for 0.25.0-rc1.
CI is green, merging.
Closes #10187 ← see design requirements and purpose there.
I tried not to touch
go-ipfs-cmds
. However, what I did in Kubo could've been done there too.Closes #1532
Closes #2389
CC ipfs/ipfs-webui#1586 ipfs/go-ipfs-api#172
Feature Summary
This PR provides Kubo users with a basic HTTP Auth primitives for locking the RPC API down, and exposing only a subset of commands per access token defined in
API.Authorization
map.Future work, such as UCANs mentioned here, or sandboxing MSF, keys, IPNS names per user hinted here, could be built on top of this at a later time.