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
- Object schema: `namespace: 'sys'`, `name: '{short_name}'` (no `sys_` prefix in name)
339
+
- Table derivation: `tableName` auto-derived as `sys_{name}` unless explicitly overridden
322
340
323
341
**Rationale:**
324
342
- Prevents naming collisions between system objects and business objects (e.g., a CRM `account` vs. `sys_account`)
325
343
- Aligns with ServiceNow and similar platforms that use `sys_` as a reserved namespace
326
344
- ObjectStack already uses namespace + FQN for business object isolation; the `sys_` prefix completes the picture for kernel-level objects
327
345
- Physical storage table names can differ via `ObjectSchema.tableName` + `StorageNameMapping.resolveTableName()` for backward compatibility
346
+
- Namespace-based auto-derivation eliminates manual `tableName` boilerplate and ensures consistency
347
+
348
+
**Plugin Architecture:**
349
+
- Each plugin (plugin-auth, plugin-security, plugin-audit) owns and registers its own `sys` namespace objects
350
+
- Plugins remain decoupled and optional — consumers aggregate all `sys` objects at runtime
351
+
- Object definitions follow the ObjectSchema protocol with `isSystem: true`
328
352
329
353
**Migration (v3.x → v4.0):**
330
354
- v3.x: The `SystemObjectName` constants now emit `sys_`-prefixed names. Implementations using `StorageNameMapping.resolveTableName()` can set `tableName` to preserve legacy physical table names during the transition.
@@ -333,7 +357,7 @@ business/custom objects, aligning with industry best practices (e.g., ServiceNow
333
357
- v3.x: **Bug fix** — `AuthManager.createDatabaseConfig()` now wraps the ObjectQL adapter as a `DBAdapterInstance` factory function (`(options) => DBAdapter`). Previously the raw adapter object was passed, which fell through to the Kysely adapter path and failed silently. `AuthManager.handleRequest()` and `AuthPlugin.registerAuthRoutes()` now inspect `response.status >= 500` and log the error body, since better-auth catches internal errors and returns 500 Responses without throwing.
334
358
- v3.x: **Bug fix** — `AuthPlugin` now defers HTTP route registration to a `kernel:ready` hook instead of doing it synchronously in `start()`. This makes the plugin resilient to plugin loading order — the `http-server` service is guaranteed to be available after all plugins complete their init/start phases. The CLI `serve` command also registers `HonoServerPlugin` before config plugins (with duplicate detection) for the same reason.
335
359
- v3.x: **Bug fix** — Studio `useApiDiscovery` hook no longer hardcodes auth endpoints as `/api/auth/...`. The `discover()` callback now fetches `/api/v1/discovery` and reads `routes.auth` to dynamically construct auth endpoint paths (falling back to `/api/v1/auth`). The session endpoint is corrected from `/session` to `/get-session` to align with better-auth's `AuthEndpointPaths.getSession`.
336
-
- v4.0: Legacy un-prefixed aliases will be fully removed.
360
+
- v4.0: Legacy un-prefixed aliases and `Auth*` export names will be fully removed.
0 commit comments