fix(control-plane): encode enroll hostContentSecret as base64url (agent decodes base64url)
This commit is contained in:
@@ -129,7 +129,8 @@ export function buildRouter(deps: ProvisionDeps): FastifyPluginAsync {
|
|||||||
agentPubkey: new Uint8Array(Buffer.from(body.agentPubkey, 'base64')),
|
agentPubkey: new Uint8Array(Buffer.from(body.agentPubkey, 'base64')),
|
||||||
csr: decodeCsrWire(body.csr),
|
csr: decodeCsrWire(body.csr),
|
||||||
})
|
})
|
||||||
await reply.code(201).send({ ...result, hostContentSecret: Buffer.from(result.hostContentSecret).toString('base64') })
|
// base64URL (not base64) — the agent decodes this via decodeBase64UrlBytes (enroll/pair.ts).
|
||||||
|
await reply.code(201).send({ ...result, hostContentSecret: Buffer.from(result.hostContentSecret).toString('base64url') })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
sendError(reply, err)
|
sendError(reply, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user