feat(cli): mount runtime datasource admin in serve by default (ADR-0015 Addendum)#1511
Merged
Merged
Conversation
…0015 Addendum) Wire `@objectstack/service-datasource-admin` into the `serve` composition root so a self-host runtime is a complete low-code platform out of the box — the "Add Datasource" wizard (list/test/create/update/remove + REST routes under /api/v1/datasources) works without code or redeploy. Mechanism is open; the tier line stays on which ICryptoProvider / driver factory a host injects, not on whether the UI can manage datasources. Details: - A single shared crypto provider now backs ALL of sys_secret (datasource creds + secret fields). One instance ⇒ one key, so everything decrypts consistently. The datasource secret binder is wired BEFORE runtime.start() (its kernel:ready boot rehydration decrypts persisted creds); the post-start secret-field wiring reuses the same instance. - Fail-closed preserved: if no crypto provider can be created, `secrets` is left undefined and secret-bearing create/update rejects instead of storing cleartext. - REST routes registered via a tiny init-time plugin that resolves http.server (same pattern as the hostname guard). Graceful skip if the package or http.server is absent. - New @objectstack/service-datasource-admin dep on the cli package. Tests: - Adds admin-routes integration test against the REAL HonoHttpServer adapter (list / test-secret-split / create-201 / 503-unavailable / 400-error). 34 pass (was 29); cli typecheck + build green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| const { InMemoryCryptoProvider } = await import( | ||
| /* webpackIgnore: true */ '@objectstack/service-settings' | ||
| ); | ||
| sharedCryptoProvider = sharedCryptoProvider ?? new InMemoryCryptoProvider(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires
@objectstack/service-datasource-admin(added in #1502) into theservecomposition root, mounted by default. A self-host runtime now ships the "Add Datasource" wizard backend out of the box — list / test-connection / create / update / remove runtime datasources via/api/v1/datasources, no code or redeploy.Why
From a platform-completeness standpoint, data connectivity is the bedrock of the low-code promise: every view/flow/dashboard sits on it. Leaving "add a datasource" as the one code-only, redeploy-required step is a conspicuous hole — and since datasource is already a Studio-managed metadata type, not mounting the backend leaves a visible-but-dead UI surface. Mechanism is open; the tier line stays on which
ICryptoProvider/ driver factory a host injects, so this gives nothing paid away.How
sys_secret(datasource creds + secret fields). Single instance ⇒ single key ⇒ everything decrypts consistently. The datasource secret binder is wired beforeruntime.start()(the plugin'skernel:readyboot rehydration decrypts persisted creds); the existing post-start secret-field wiring reuses the same instance.secretsis left undefined and secret-bearing create/update rejects rather than storing cleartext.http.server(same pattern as the hostname guard). Graceful skip when the package orhttp.serveris absent.Tests
admin-routesintegration test against the realHonoHttpServeradapter (the same IHttpServerservemounts): list / secret-split / create-201 / 503-unavailable / 400-error.Related
🤖 Generated with Claude Code