feat(web): toggle enrollment adapters live with honest engine-pending labeling#65
Merged
Conversation
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
Flips the enrollment-protocol adapter enable/disable toggle from mock-only to the live manager write path, and makes the control honest about what enabling means.
lib/adapters.ts:setEnabled(kind, on)is now async and returns a write result. Mock mode is unchanged and coherent. Live mode resolves the adapter'snamefrom the loaded live catalog (the web addresses adapters bykind; the RPC keys byname), callsSetAdapterEnabled({ name, enabled }), then refetchesListAdapters. If the adapter for the kind is not loaded it surfaces an inline error rather than sending an empty name.pages/protocols.tsxandpages/protocol-detail.tsx: admin-gate the toggle (non-admins see no writable control), await the write with a pending/disabled state, and render RPC errors inline (no native popups).src/gen) to includeSetAdapterEnabled, synced from the api proto (feat(proto): add SetAdapterEnabled RPC api#62).Merge order: depends on the manager write path (CryptOS-PKI/manager#50), which in turn depends on api#62. Merge api#62, then manager#50, then this. The live path is inert until the manager RPC exists; mock mode works standalone today.
Closes #64
Part of #24
Verification
npm test: 178 passing (46 files), including new live-path and honest-note tests.npm run lint: clean (eslint + prettier).npm run build: succeeds.How this was verified
Wrote a failing live-path test first (RPC called with the adapter NAME, not kind; inline error when unloaded; refetch after write), then implemented. Ran the full test suite, lint, and build locally.