Compare commits

..
Author SHA1 Message Date
Hermes Agent 5b3e637423 [grade=B urn:ump:mao7vadnesmquhmgr4oeg554edt6fn3ykxyiydtfs2psoekd4s7q] P7 tailscale provider: wire coord client via ctx delegation
CI / Test & Lint (pull_request) Canceled after 0s
CI / Security audit (pull_request) Canceled after 0s
Dogfood finding #2: createTailscaleProvider() built with coordClient=null;
nothing in prod ever called attachCoordClient() (the wiring the provider
docblock promised never landed), so wizard credential validation always
failed not_configured even with a valid stored token. Pass a delegating
proxy that fetches a fresh coord client per call via the sanctioned
ctx.tailscaleCoord.getClient pattern (token re-read from credentialManager
each call). Full suite 3413/3413.
2026-10-04 02:51:18 -07:00
sami7777 ecdb2fd8ee P7 wizard prod wiring fix [grade=B] (PR #2)
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s
Judge B r1 urn:ump:2swys44kxvulm5flu4skibjq3yfvtnzrsbgkvm2g65ht55i4jtoa. Dogfood finding: wizard mount omitted providers. 3413/3413.
2026-10-04 11:41:45 +02:00
+23 -1
View File
@@ -779,7 +779,29 @@ async function createApp() {
// Private Network wizard (DC-152). Dogfood finding 2026-10-04: the wizard // Private Network wizard (DC-152). Dogfood finding 2026-10-04: the wizard
// factory needs INSTANCES keyed by mode id; without them every mode // factory needs INSTANCES keyed by mode id; without them every mode
// selection 503s provider_unavailable (unit tests inject their own map). // selection 503s provider_unavailable (unit tests inject their own map).
const p7TailscaleProvider = require('./network/providers/tailscale').createTailscaleProvider(); // eslint-disable-line global-require // Coord client wiring (dogfood finding #2, 2026-10-04): the provider is
// built with coordClient=null and nothing ever called attachCoordClient()
// in prod (the promised routes/network.js wiring never landed), so wizard
// credential validation always failed not_configured. Delegate every coord
// method to a FRESH client per call — the sanctioned context pattern
// (ctx.tailscaleCoord.getClient re-reads the token from credentialManager
// each call, so wizard-stored tokens take effect without a restart).
const p7CoordProxy = new Proxy({}, {
get(_t, prop) {
if (typeof prop !== 'string') return undefined;
return async (...args) => {
const client = await ctx.tailscaleCoord.getClient();
const fn = client ? client[prop] : null;
if (typeof fn !== 'function') {
throw new Error('coord client method unavailable: ' + String(prop));
}
return fn.apply(client, args);
};
},
});
const p7TailscaleProvider = require('./network/providers/tailscale').createTailscaleProvider({ // eslint-disable-line global-require
coordClient: p7CoordProxy,
});
const p7WireGuardProvider = require('./network/providers/wireguard').createWireGuardProvider(); // eslint-disable-line global-require const p7WireGuardProvider = require('./network/providers/wireguard').createWireGuardProvider(); // eslint-disable-line global-require
apiRouter.use('/network/wizard', networkWizardRoutes({ apiRouter.use('/network/wizard', networkWizardRoutes({
registry: { getActiveProvider }, registry: { getActiveProvider },