@fish-under-sea/magpie-neartoken 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -54,6 +54,23 @@
54
54
 
55
55
  `package.json` 必须原样声明这张表:magpie 按它放行,宿主再按同一份声明校验一次。
56
56
 
57
+ ## 和 dsh-neartoken 的关系:只共用站点,不混用标识
58
+
59
+ 这不是 dsh-neartoken 的兼容层,也没有复用它的代码、配置或令牌。两边的连接方式不一样:
60
+
61
+ | | dsh-neartoken | 本插件 |
62
+ | --- | --- | --- |
63
+ | 宿主 | DSH | magpie |
64
+ | 请求由谁发 | DSH Host | magpie 本体(`/api/plugin-pages/call`) |
65
+ | 站点确认页上的称呼 | `DSH 插件` | `magpie` |
66
+ | 请求的 UA | DSH 自己的 | `magpie-neartoken` |
67
+ | 令牌 | 站点写的 `DSH` | 站点按 `magpie` 写 |
68
+ | 供应商 | DSH 的 `neartoken` provider | magpie 的 `neartoken` 供应商 |
69
+
70
+ 共用的只有站点已经实现的那批设备授权端点(`/api/dsh/device/authorize`、`/token`、`/revoke`)与钱包、用量、充值端点——那是站点自己的接口,不是哪一家的实现。作者的 `DSH` 标识原样留着:他的令牌、日志和授权记录仍然只认 `DSH`,我们的连接写 `magpie`,两边在站点后台一眼分得开。
71
+
72
+ 站点对「只有 DSH 授权签发的钥匙能充值」这件事回的是 `DSH_TOKEN_REQUIRED`,那是站点的历史码;插件只按它分支,对外一律说「这把密钥不是本插件登录签发的」。
73
+
57
74
  ## 页面怎么用
58
75
 
59
76
  1. 装上包,侧边栏「插件」→「NearToken」。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fish-under-sea/magpie-neartoken",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "NearToken for magpie: sign in to neartoken.cc from a page of magpie's own window, see the balance, vouchers and spending, top up without leaving it, and let magpie pick the models as it does for any provider.",
5
5
  "type": "module",
6
6
  "license": "MIT",