GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): denying a device that was already approved no longer rep… · HNRow/r3code@17cba26

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src
    • auth
      • EnvironmentAuth.test.ts
    • persistence
      • AuthPairingLinks.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/auth/EnvironmentAuth.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/auth/EnvironmentAuth.test.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodePlatformCrypto.layer))(
352352
expect(retried.credential).toBe(requested.credential);
353353

354354
expect(yield* serverAuth.approveConnectDevice(request!.id)).toBe(true);
355+
// A stale prompt on another client must not report denying an approved device.
356+
expect(yield* serverAuth.revokePairingLink(request!.id)).toBe(false);
355357
expect(
356358
(yield* serverAuth.listPairingLinks()).some((link) => link.connectDeviceRequest),
357359
).toBe(false);
Collapse file

‎apps/server/src/persistence/AuthPairingLinks.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/persistence/AuthPairingLinks.ts
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ export const make = Effect.gen(function* () {
329329
WHERE id = ${id}
330330
AND revoked_at IS NULL
331331
AND consumed_at IS NULL
332+
-- An approved request is answered; denying it now would leave the device trusted.
333+
AND NOT (
334+
requires_connect_approval = 1
335+
AND proof_key_thumbprint IN (SELECT proof_key_thumbprint FROM auth_connect_devices)
336+
)
332337
RETURNING id AS "id"
333338
`,
334339
});

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.