Skip to content

feat(api): enable and disable a connection through the bearer API - #51

Merged
cevheri merged 1 commit into
mainfrom
feat/api-v1-connection-active
Oct 25, 2026
Merged

cevheri merged 1 commit into
mainfrom
feat/api-v1-connection-active

Conversation

@cevheri

@cevheri cevheri commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Adds PATCH /api/v1/connections/{id} with the strict body { "active": true | false }, for the Platform admin mode of LibreDB Mobile.
It answers 200 with the connection in the shape of one item of GET /api/v1/connections, and is documented in docs/api/v1.md next to the grant routes.

setConnectionActive (src/features/connections/lib/connection-service.ts) runs the checks of the web console: CONNECTION_EDIT, the install tenant, and requireSeatsForReactivation on an enable.
A change records connection.update on channel api with the before and after snapshots; the value a connection already has writes nothing and records nothing.
DatabaseConnectionRepository.update now returns the updated connection, so the route needs no second read.

Differences from the proposal: an extra field answers 400 with fieldErrors on the empty key "", as every strict body of /api/v1 does today; the doc says Studio reloads on the change notification, typically within a second, with GOVERNANCE_REFRESH_MS as the bound when a notification is lost. The web action updateDatabaseConnection is unchanged.

Verified: npm run lint (0 errors), npm run typecheck, npm test (1010 passed on Node 24), npm run test:db (174 passed, including the new route.db.test.ts).

Closes #50

PATCH /api/v1/connections/{id} takes the strict body { "active": true | false } and answers 200 with the connection in the shape of GET /api/v1/connections.
setConnectionActive in src/features/connections/lib/connection-service.ts runs the checks of the web console: CONNECTION_EDIT, the install tenant, and the seat gate of a reactivation.
A change records connection.update on channel api with the before and after snapshots, and the value a connection already has writes nothing.
DatabaseConnectionRepository.update now returns the updated connection, so the route needs no second read.

Closes #50
@cevheri
cevheri merged commit d6ad8f5 into main Oct 25, 2026
11 checks passed
@cevheri
cevheri deleted the feat/api-v1-connection-active branch October 25, 2026 02:20
cevheri added a commit that referenced this pull request Oct 25, 2026
Raise the installer and chart to 1.3.0 and pin the Platform 1.3.0 image index digest sha256:e53ca9b82e337bb995a575ac4082de3da092d33c098a020a13292584fbc49ea9 in the release manifest, the chart values and the Artifact Hub images.
LibreDB Studio stays at 1.1.0 with the Studio chart 0.1.103.
Platform 1.3.0 adds PATCH /api/v1/connections/{id} to the bearer API (#51), which the chart's Artifact Hub changes describe.

release/history/1.3.0.json comes from release:record and the Helm jobs bundle from build:helm-jobs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable and disable a connection through the bearer API

1 participant