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 user-created admin-scoped pairing links being hidden from listings · pingdotgg/t3code@a9cff67

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/auth/Layers
    • ServerAuth.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/auth/Layers/ServerAuth.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/auth/Layers/ServerAuth.ts
+22-13Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
AuthAccessManageScope,
32
AuthAccessTokenType,
43
AuthAdministrativeScopes,
54
AuthStandardClientScopes,
@@ -229,9 +228,7 @@ export const makeServerAuth = Effect.gen(function* () {
229228
authControlPlane
230229
.createPairingLink({
231230
scopes: input?.scopes ?? AuthStandardClientScopes,
232-
subject: input?.scopes?.includes(AuthAccessManageScope)
233-
? "administrative-bootstrap"
234-
: "one-time-token",
231+
subject: "one-time-token",
235232
...(input?.label ? { label: input.label } : {}),
236233
})
237234
.pipe(
@@ -329,15 +326,27 @@ export const makeServerAuth = Effect.gen(function* () {
329326
);
330327

331328
const issueStartupPairingUrl: ServerAuthShape["issueStartupPairingUrl"] = (baseUrl) =>
332-
issuePairingCredential({ scopes: AuthAdministrativeScopes }).pipe(
333-
Effect.map((issued) => {
334-
const url = new URL(baseUrl);
335-
url.pathname = "/pair";
336-
url.searchParams.delete("token");
337-
url.hash = new URLSearchParams([["token", issued.credential]]).toString();
338-
return url.toString();
339-
}),
340-
);
329+
authControlPlane
330+
.createPairingLink({
331+
scopes: AuthAdministrativeScopes,
332+
subject: "administrative-bootstrap",
333+
})
334+
.pipe(
335+
Effect.mapError(
336+
(cause) =>
337+
new ServerAuthInternalError({
338+
message: "Failed to issue startup pairing credential.",
339+
cause,
340+
}),
341+
),
342+
Effect.map((issued) => {
343+
const url = new URL(baseUrl);
344+
url.pathname = "/pair";
345+
url.searchParams.delete("token");
346+
url.hash = new URLSearchParams([["token", issued.credential]]).toString();
347+
return url.toString();
348+
}),
349+
);
341350

342351
const issueWebSocketTicket: ServerAuthShape["issueWebSocketTicket"] = (session) =>
343352
sessions.issueWebSocketToken(session.sessionId).pipe(

0 commit comments

Comments
0 (0)
You are visitor 01402775 — 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.