You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0225759
Browse filesBrowse the repository at this point in the historyBrowse files
feat(spec): declare the nine remaining served `features` keys on the `GET /api/v1/auth/config` response
6
+
7
+
Clause-②: yes (widening)
8
+
Metadata-protocol: added
9
+
10
+
`AuthFeaturesConfigSchema` gains nine optional keys that the server already serves in `features` and the console already reads. The contract did not declare them, so a client that parsed the response through `GetAuthConfigResponseSchema` lost all nine, because a plain object schema strips keys it does not know.
11
+
12
+
-**Flags (booleans):**`multiOrgEnabled` (an organization wall is enforced; default-on, so absent reads as on), `degradedTenancy` (isolation was asked for but is not active), `oidcProvider` (the embedded OIDC authorization server is wired; default-on), `deviceAuthorization` (the device-code CLI login is wired), `admin` (the admin plugin is wired, forced on by SCIM).
13
+
-**Values:**`tenancyPosture` (`single` | `group` | `isolated`, the same vocabulary as `TenancyPostureSchema`), `audiencePosture` (`invite_only` | `email_domain` | `open`, the same vocabulary as `AUDIENCE_POSTURES`), `termsUrl` and `privacyUrl` (the legal links under the login card; absent when the operator suppressed them).
14
+
- None carries a default: a key the server does not send stays absent.
15
+
- A new test holds the schema's declared keys equal to `PUBLIC_AUTH_FEATURES` plus `PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS` (the retired `passkeys` / `magicLink` tombstones excepted), so the next served and classified key cannot be left undeclared.
16
+
- The development-only top-level `devSeedAdmin` hint stays undeclared on purpose: it carries the seeded admin's password and no production deployment serves it.
17
+
18
+
What to do: nothing. Every payload accepted before is accepted unchanged. A client that typed the response from `@objectstack/spec` (for example through `@objectstack/client`'s re-exported `AuthFeaturesConfig`) now sees the nine keys as optional.
'Public Cloudflare Turnstile site key, present only while the opt-in sign-up challenge is on: the sign-up form renders the widget and sends its token in the x-captcha-response header; absent means no challenge',
256
258
),
259
+
// The keys below are served by plugin-auth `getPublicConfig()` (auth-manager.ts,
260
+
// the `features` literal) and classified in PUBLIC_AUTH_FEATURES (flags) or
261
+
// PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS (values); the registry-to-schema pin in
262
+
// auth-endpoints.test.ts keeps the three key sets equal (#29473).
263
+
multiOrgEnabled: z.boolean().optional().describe(
264
+
'Multi-organization capability: true when the effective tenancy posture enforces an organization wall (group or isolated), the same answer the create-organization door gives; '
265
+
+'false on a single posture, and on a degraded deployment that asked for isolation but has none. The console offers creating, switching and leaving organizations only when it is on; '
'Which tenancy posture is in force (single, group or isolated): the effective posture, from the same derivation as multiOrgEnabled. A value, not a gate: multiOrgEnabled stays the capability flag, '
270
+
+'while this tells the console how to render organization context (under group the organization switcher picks the write target and reads span every organization the member belongs to)',
'Who may self-register into this environment (invite_only, email_domain or open): the posture the sign-up path enforces, reported as invite_only when the configured value is off-vocabulary. '
274
+
+'A value, not a gate: emailPassword.disableSignUp stays the boolean that hides the sign-up form, while this lets the login page say that registration is by invitation instead of offering a form the server refuses',
275
+
),
276
+
degradedTenancy: z.boolean().optional().describe(
277
+
'Degraded tenancy: true when multi-organization isolation was requested but is not active (the deployment booted only because OS_ALLOW_DEGRADED_TENANCY=1), so no engine enforces organization boundaries; '
278
+
+'the console can raise an operator warning off it. A status signal, not a capability gate; absent means not degraded',
279
+
),
280
+
oidcProvider: z.boolean().optional().describe(
281
+
'Embedded OIDC authorization server wired, from the same decision that mounts it, so OAuth applications can be registered and managed; on by default alongside the MCP surface. '
282
+
+'It says nothing about sign-in providers, which socialProviders lists; the flag is default-on, so absent reads as on',
'Device authorization (browser-approved CLI login) wired, so the device-code endpoints answer; when false the console device-approval page says device authorization is not enabled instead of calling them. '
286
+
+'Absent means not wired',
287
+
),
288
+
admin: z.boolean().optional().describe(
289
+
'Admin plugin wired (forced on whenever SCIM is enabled), so user administration (creating, banning, unlocking and impersonating users, setting their passwords) is available; '
290
+
+'the console shows those actions only when it is true. Absent means not wired',
291
+
),
292
+
termsUrl: z.string().optional().describe(
293
+
'Terms-of-service link shown beneath the login and register cards: the OS_TERMS_URL value when set, otherwise the public ObjectStack terms page; absent when the operator set OS_TERMS_URL to an empty string to suppress the link',
294
+
),
295
+
privacyUrl: z.string().optional().describe(
296
+
'Privacy-policy link shown beneath the login and register cards: the OS_PRIVACY_URL value when set, otherwise the public ObjectStack privacy page; absent when the operator set OS_PRIVACY_URL to an empty string to suppress the link',
297
+
),
257
298
}));
258
299
259
300
/**
260
301
* Get Auth Config Response
261
302
*
262
303
* Returns the public authentication configuration that the frontend
263
304
* can use to render appropriate login UI (social provider buttons, etc.)
305
+
*
306
+
* `devSeedAdmin` is deliberately NOT declared here. plugin-auth adds it at the
307
+
* top level only under NODE_ENV=development, while the auto-seeded admin still
308
+
* signs in with its default password, and it carries that email and password.
309
+
* A published response contract would advertise a credential-bearing field that
310
+
* no production deployment serves; its one reader, the console LoginPage, reads
311
+
* the raw response and never parses it through this schema.
0 commit comments