fix(federation): 🐛 Use explicit header object destructuring in inbox processing
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 0s
Build Docker Images / lint (push) Failing after 6s
Build Docker Images / check (push) Failing after 6s
Build Docker Images / tests (push) Failing after 6s
Deploy Docs to GitHub Pages / build (push) Failing after 0s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Mirror to Codeberg / Mirror (push) Failing after 1s
Nix Build / check (push) Failing after 1s

This commit is contained in:
Jesse Wierzbinski 2025-04-18 14:58:04 +02:00
parent 6edb0310d8
commit 85ef96fc7f
No known key found for this signature in database
2 changed files with 24 additions and 2 deletions

View file

@ -33,10 +33,21 @@ export default apiRoute((app) =>
), ),
async (context) => { async (context) => {
const body = await context.req.valid("json"); const body = await context.req.valid("json");
const {
"versia-signature": signature,
"versia-signed-at": signedAt,
"versia-signed-by": signedBy,
authorization,
} = context.req.valid("header");
await inboxQueue.add(InboxJobType.ProcessEntity, { await inboxQueue.add(InboxJobType.ProcessEntity, {
data: body, data: body,
headers: context.req.valid("header"), headers: {
"versia-signature": signature,
"versia-signed-at": signedAt,
"versia-signed-by": signedBy,
authorization,
},
request: { request: {
body: await context.req.text(), body: await context.req.text(),
method: context.req.method, method: context.req.method,

View file

@ -90,10 +90,21 @@ export default apiRoute((app) =>
validator("json", z.any(), handleZodError), validator("json", z.any(), handleZodError),
async (context) => { async (context) => {
const body: JSONObject = await context.req.valid("json"); const body: JSONObject = await context.req.valid("json");
const {
"versia-signature": signature,
"versia-signed-at": signedAt,
"versia-signed-by": signedBy,
authorization,
} = context.req.valid("header");
await inboxQueue.add(InboxJobType.ProcessEntity, { await inboxQueue.add(InboxJobType.ProcessEntity, {
data: body, data: body,
headers: context.req.valid("header"), headers: {
"versia-signature": signature,
"versia-signed-at": signedAt,
"versia-signed-by": signedBy,
authorization,
},
request: { request: {
body: await context.req.text(), body: await context.req.text(),
method: context.req.method, method: context.req.method,