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)
341
+
- Table derivation: `tableName` auto-derived as `sys_{name}` unless explicitly overridden
322
342
323
343
**Rationale:**
324
344
- Prevents naming collisions between system objects and business objects (e.g., a CRM `account` vs. `sys_account`)
325
345
- Aligns with ServiceNow and similar platforms that use `sys_` as a reserved namespace
326
346
- ObjectStack already uses namespace + FQN for business object isolation; the `sys_` prefix completes the picture for kernel-level objects
327
347
- Physical storage table names can differ via `ObjectSchema.tableName` + `StorageNameMapping.resolveTableName()` for backward compatibility
348
+
- Namespace-based auto-derivation eliminates manual `tableName` boilerplate and ensures consistency
349
+
350
+
**Plugin Architecture:**
351
+
- Each plugin (plugin-auth, plugin-security, plugin-audit) owns and registers its own `sys` namespace objects
352
+
- Plugins remain decoupled and optional — consumers aggregate all `sys` objects at runtime
353
+
- Object definitions follow the ObjectSchema protocol with `isSystem: true`
328
354
329
355
**Migration (v3.x → v4.0):**
330
356
- 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 +359,7 @@ business/custom objects, aligning with industry best practices (e.g., ServiceNow
333
359
- 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
360
- 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
361
- 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.
362
+
- v4.0: Legacy un-prefixed aliases and `Auth*` export names will be fully removed.
0 commit comments