Repository navigation
Commit 3c231cd
feat(platform-objects): the Register SSO Provider form names the token, authorization and JWKS endpoints (#33417)
Fixes #33395
Clause-②: yes (widening) — the `register_sso_provider` action on
`sys_sso_provider` gains three optional params, `authorizationEndpoint`,
`tokenEndpoint` and `jwksEndpoint` (type `url`), and the object
translation bundles gain their label and help-text keys. The register
bridge already accepted all three; nothing accepted before is refused
now.
Metadata-protocol: none
## 维护者速读
- 改了什么:Setup 里「注册 SSO 提供方」表单新增三个可选输入框:Token URL、Authorization URL、JWKS
URL,与 Discovery URL / Userinfo URL 并列,按同名字段提交给注册桥接,落进 `oidcConfig`。
- 为什么改:Google 这类 IdP 的 token、密钥、userinfo 地址不在 issuer
的域名下,注册会因「不受信任的端点」被拒并提示填写这些字段;#33314 只让 API
入口收这些字段,表单里没有输入框,不会写代码的管理员仍然注册不了。
- 风险与回滚:只加三个可选表单参数,留空时什么都不发,已有注册行为不变;回滚即还原 `sys-sso-provider.object.ts`
并重新生成翻译包。
-
先看:`packages/platform-objects/src/identity/sys-sso-provider.object.ts`(三个新参数与帮助文字);`packages/plugins/plugin-auth/src/register-sso-provider.test.ts`(新
describe:表单参数到 `oidcConfig` 的钉子);`content/docs/permissions/sso.mdx`。
- 两分钟验证:`pnpm --filter @objectstack/plugin-auth exec vitest run
src/register-sso-provider.test.ts`,预期 43 个用例全绿,其中「the Setup form
register_sso_provider names each endpoint …」两条通过。
- 需要你做的:无,席位落地。
## What changes
- **Setup form.** `sys_sso_provider` action `register_sso_provider`
gains optional **Authorization URL** (`authorizationEndpoint`), **Token
URL** (`tokenEndpoint`) and **JWKS URL** (`jwksEndpoint`) params, type
`url`, between `discoveryEndpoint` and `userInfoEndpoint` (the order of
the bridge's own endpoint list). Each help text says the endpoint is
kept instead of the one the discovery document names, is trusted for
this provider, and is to be named when the registration is refused
because the discovery document names that endpoint on a host the server
does not trust; the token and JWKS texts give Google's URL as the
example.
- **Bridge.** No change. `runRegisterSsoProviderFromForm` already
carries all five named endpoints into `oidcConfig` by name (landed in
#33314); the new params reach it under exactly those names, now pinned.
- **Translations.** Regenerated with `node
scripts/check-i18n-bundles.mjs --write --filter=platform-objects` (no
hand edit). The translated locales carry the English text for the six
new keys until translated.
- **Docs.** `content/docs/permissions/sso.mdx` names the four endpoint
fields of the Setup form and says a Google registration can fill Token
URL, JWKS URL and Userinfo URL there.
- **Changeset.** `.changeset/33395-sso-form-named-endpoints.md`,
`@objectstack/platform-objects` patch.
## Tests
- `packages/plugins/plugin-auth/src/register-sso-provider.test.ts`, new
top-level describe "the Setup form register_sso_provider names each
endpoint under the oidcConfig member the bridge carries it to": (1) the
form's `url` params are exactly the five endpoints the bridge takes,
each optional; (2) every `url` param the form posts, driven through
`runRegisterSsoProviderFromForm`, arrives in `oidcConfig` under its own
name. It reads the action from `@objectstack/platform-objects` (resolved
through `dist/`), so it crosses the form-to-bridge seam.
- `packages/platform-objects/src/platform-objects.test.ts`: the existing
param-list pin now lists the three new params, and the trusted-endpoint
help-text check covers all five endpoints.
## Acceptance notes
- Nothing beyond this card's scope.
## Verification
Final head before this PR: `4f536ba5e` (main merged at `b63c89493..`
plus 5 incoming commits; the incoming ones touch plugin-auth files this
PR does not).
<details><summary>platform-objects: build, test, typecheck (pre-merge
head e890295)</summary>
```
Test Files 122 passed (122)
Tests 1957 passed (1957)
check:test-typecheck: OK — @objectstack/platform-objects's test layer compiles under packages/platform-objects/tsconfig.test.json
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>plugin-auth: full suite and typecheck (pre-merge head
e890295, pin as first written)</summary>
```
Test Files 272 passed (272)
Tests 5247 passed | 10 skipped (5257)
check:test-typecheck: OK — @objectstack/plugin-auth's test layer compiles under packages/plugins/plugin-auth/tsconfig.test.json
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>After merging main (head 4f536ba): scoped
re-run</summary>
```
plugin-auth vitest: register-sso-provider.test.ts, organization-delete-read-fault.test.ts, sso-discovery-companion-origins.test.ts
Test Files 3 passed (3)
Tests 72 passed (72)
plugin-auth typecheck: check:test-typecheck: OK
platform-objects vitest src/platform-objects.test.ts
Test Files 1 passed (1)
Tests 156 passed (156)
os-verify-lock: VERDICT command-exit 0
eslint --no-inline-config on the three changed .ts files: exit 0
```
</details>
<details><summary>Ablation A: the form param spelled otherwise
(platform-objects source, rebuilt into dist)</summary>
`ablation-replace.mjs` renamed `{ name: 'tokenEndpoint', label: 'Token
URL'` to `{ name: 'tokenUrl', label: 'Token URL'` (anchor 1 to 0, blob
aaf4547 to 3d63005b49ad), then `pnpm --filter
@objectstack/platform-objects build`, then `ablation-dist-preflight.mjs
@objectstack/platform-objects tokenUrl` (marker present in 6 built
files), then the pin file:
```
× offers every endpoint the bridge takes as an optional url param of the same name
× each url param the form posts reaches oidcConfig under its own name
AssertionError: tokenUrl: expected undefined to be 'https://tokenurl.idp.example.com/path'
Test Files 1 failed (1)
Tests 2 failed | 41 passed (43)
ablation-replace: ok restored: blob == HEAD (aaf4547) and `git diff HEAD` is empty
```
Restore leg: rebuild, `ablation-dist-preflight.mjs
@objectstack/platform-objects tokenUrl --absent` (absent from all 66
built files; working tree clean against HEAD), pin file `Tests 43 passed
(43)`.
</details>
<details><summary>Ablation B: the bridge pass-through removed
(plugin-auth source)</summary>
`ablation-replace.mjs` replaced `if (value) oidcConfig[member] = value;`
with a no-op (anchor 1 to 0, blob dba2012 to f696afc0abe1):
```
× sends userInfoEndpoint in oidcConfig, where the register door trusts its origin, and skipUserInfo at the top level
× sends each named endpoint, trimmed, in oidcConfig under the member of the same name
× each url param the form posts reaches oidcConfig under its own name
Test Files 1 failed (1)
Tests 3 failed | 40 passed (43)
ablation-replace: ok restored: blob == HEAD (dba2012) and `git diff HEAD` is empty
```
</details>
<details><summary>Derived gate families (dispatch-gates --commands at
4f536ba)</summary>
98 families derived at 4f536ba; each run with its exit captured before
any pipe; `dispatch-gates --ran` with the exit codes: `98 derived
famil(ies) accounted for — 95 run, 3 NOT-MEASURED (3 DERIVED from a
recorded exit 3)`.
- 93 exit 0.
- NOT MEASURED, prerequisite (exit 3): `pnpm --filter @objectstack/spec
run check:skill-examples` (spec declarations not built), `pnpm
check:dual-build-cjs-loads` (workspace not fully built), `pnpm
check:type-check-debt` (its closure build never got a turn on the shared
verify lock).
- NOT MEASURED, stale local build (exit 1, not a finding): `pnpm
--filter @objectstack/spec run check:docs` (refused:
`packages/spec/json-schema is older than packages/spec/src`, a
gitignored artifact), and `pnpm check:docs-transcript-drift` (4 rows,
all in docs this PR does not touch, reading the validate rule count 65
from a `packages/lint` build taken before the merge of main brought
#33321's two new rules; the docs say 67).
- Re-running those five needs a rebuild of spec and lint under the
shared verify lock; two 9-minute tries
(`OS_VERIFY_LOCK_SLOT=issue-33395-a1`) never acquired it, held
throughout by another session's dogfood run (holder pid 20551). They are
CI's: Lint & Repo Gates and TypeScript Type Check run each on this PR.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 31b4b9f commit 3c231cd
26 files changed
Lines changed: 270 additions & 12 deletions
File tree
- .changeset
- content/docs/permissions
- packages
- platform-objects/src
- apps/translations
- identity
- plugins/plugin-auth/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
170 | | - | |
| 172 | + | |
| 173 | + | |
171 | 174 | | |
172 | 175 | | |
173 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2167 | 2167 | | |
2168 | 2168 | | |
2169 | 2169 | | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
2170 | 2182 | | |
2171 | 2183 | | |
2172 | 2184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2167 | 2167 | | |
2168 | 2168 | | |
2169 | 2169 | | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
2170 | 2182 | | |
2171 | 2183 | | |
2172 | 2184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
208 | 212 | | |
| 213 | + | |
| 214 | + | |
209 | 215 | | |
210 | 216 | | |
211 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2167 | 2167 | | |
2168 | 2168 | | |
2169 | 2169 | | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
2170 | 2182 | | |
2171 | 2183 | | |
2172 | 2184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2167 | 2167 | | |
2168 | 2168 | | |
2169 | 2169 | | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
2170 | 2182 | | |
2171 | 2183 | | |
2172 | 2184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| 154 | + | |
| 155 | + | |
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2167 | 2167 | | |
2168 | 2168 | | |
2169 | 2169 | | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
2170 | 2182 | | |
2171 | 2183 | | |
2172 | 2184 | | |
| |||
0 commit comments