@kne/fastify-oidc 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.
package/README.md CHANGED
@@ -66,7 +66,7 @@ npm i --save @kne/fastify-oidc
66
66
 
67
67
  | 资源 | identifier | scope | 用途 |
68
68
  |------|------------|-------|------|
69
- | 本项目 API | `${ORIGIN}/api` | `api` | SPA 调用本项目接口 |
69
+ | 本项目 API(名称为 `name`) | `${ORIGIN}/api` | `api` | SPA 调用本项目接口 |
70
70
  | 服务接口 | `${issuer origin}${prefix}` | `user:read tenant:read` | 子项目以 client_credentials 读取用户 / 租户 |
71
71
 
72
72
  client 只能申请 `allowedResources` 中的资源;子项目 token 的 `aud` 是子项目 API,拿到主项目会被拒绝。
package/libs/idp/index.js CHANGED
@@ -45,7 +45,7 @@ module.exports = ({ fastify, options, translator }) => {
45
45
  const resourceServers = [...(options.resourceServers || [])];
46
46
  const clients = [...(options.clients || [])];
47
47
  if (options.seedSelf) {
48
- resourceServers.push({ identifier: runtime.audience, name: `${options.name} API` });
48
+ resourceServers.push({ identifier: runtime.audience, name: options.name });
49
49
  resourceServers.push({ identifier: runtime.serviceAudience, name: 'OIDC 服务接口', scope: options.serviceScopes.join(' ') });
50
50
  clients.push(
51
51
  Object.assign(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-oidc",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "基于 oidc-provider 的 Fastify OIDC 认证插件,支持 standalone / central 多项目单点登录、租户与跨项目令牌",
5
5
  "main": "index.js",
6
6
  "scripts": {