Use OAuth 2.0 to obtain pinning service access token

未关闭
#1,879 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
javascript, react

调研方向

首先检查 WebUI 中现有的 pinning-service 配置和 Pinata 集成;该 issue 未指定具体的文件或测试。定义 client ID、callback page、scopes、provider authorization endpoint 和 token endpoint,以及 settings page entry point。完成标准是:一个有文档说明的 Pinata OAuth 流程能够返回 WebUI 并配置 provider,同时记录 provider 侧的注册要求。

由索引模型根据 Issue 内容生成。

描述

effort/weeks help wanted kind/enhancement P3

Current situation

At the moment, configuring a pinning service requires a few manual steps:

  • Accessing the pinning provider (e.g. Pinata)
  • Creating an access token on the API Key management UI of the provider
  • Figuring out the desired scope of actions the key should allow
  • Pasting the access token on the client (IPFS WebUI settings page)

While the experience is already quite simple for the current IPFS audience, it could be improved for lazy and/or less technical users, in line with the purpose of IPFS WebUI.

Possible improvement: OAuth 2.0 authorization flow

User experience

With Pinata for instance, the UX would be:

  • From WebUI, I click on Pinata icon. I'm directed to Pinata's consent page, showing IPFS WebUI logo and name, as well as the desired scope (around the lines of "Manage pinning").
  • I click on "Authorize".
  • Et voilà. I'm back to my WebUI instance and the provider is configured.
Technical changes
  • Decide on (and document) a client_id constant, say ipfs_webui.
  • Implement (and document) a callback page that receives the OAuth 2.0 response after the user has granted access, and does the token fetching logic. There are libraries that help greatly with that bit.
  • Define (and document) one or several scopes based on consent granularity. I'm not familiar with the feature enough yet, but one scope might be enough at first, e.g. pinning.
  • Add a clickable button to send the user to the provider's authorization endpoint, with the proper client_id, redirect_uri and scope (the same libraries can generate that link too).
    • Currently that would be only for Pinata but the process would be identical for any provider, changing only the endpoints, or even only the base hostname thanks to RFC 8414 and/or OIDC Discovery.
    • Possibly also an input box for configuring custom providers.

For reference, on the provider side:

  • Expose OAuth 2.0 endpoints (namely the authorization endpoint and the token endpoint).
  • Make the token endpoint automatically generate an API key with the right permissions (taken from the scope).
  • Register IPFS WebUI as a public client, with logo and name, and the documented client_id and callback URI.

Additional notes

A similar approach would exist for other clients such as Desktop UI, CLI etc., with different callback URIs (native deep link etc.).

主要语言
JavaScript
星标
1.6k
派生
539
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ipfs/ipfs-webui 的其他 Issue

查看 ipfs/ipfs-webui 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。