Skip to content

Commit fe43bdb

Browse files
committed
wip: zen
1 parent a849a17 commit fe43bdb

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ export async function handler(
7474
const dict = i18n(localeFromRequest(input.request))
7575
const t = (key: Key, params?: Record<string, string | number>) => resolve(dict[key], params)
7676
const ADMIN_WORKSPACES = [
77-
"wrk_01K46JDFR0E75SG2Q8K172KF3Y", // frank
78-
"wrk_01K6W1A3VE0KMNVSCQT43BG2SX", // opencode bench
77+
"wrk_01K46JDFR0E75SG2Q8K172KF3Y", // anomaly
78+
"wrk_01K6W1A3VE0KMNVSCQT43BG2SX", // benchmark
79+
"wrk_01KKZDKDWCS1VTJF8QTX62DD50", // contributors
7980
]
8081

8182
try {

packages/console/core/script/lookup-user.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (!identifier) {
1919
if (identifier.startsWith("wrk_")) {
2020
await printWorkspace(identifier)
2121
}
22-
// lookup by API key
22+
// lookup by API key ID
2323
else if (identifier.startsWith("key_")) {
2424
const key = await Database.use((tx) =>
2525
tx
@@ -34,6 +34,21 @@ else if (identifier.startsWith("key_")) {
3434
}
3535
await printWorkspace(key.workspaceID)
3636
}
37+
// lookup by API key value
38+
else if (identifier.startsWith("sk-")) {
39+
const key = await Database.use((tx) =>
40+
tx
41+
.select()
42+
.from(KeyTable)
43+
.where(eq(KeyTable.key, identifier))
44+
.then((rows) => rows[0]),
45+
)
46+
if (!key) {
47+
console.error("API key not found")
48+
process.exit(1)
49+
}
50+
await printWorkspace(key.workspaceID)
51+
}
3752
// lookup by email
3853
else {
3954
const authData = await Database.use(async (tx) =>

0 commit comments

Comments
 (0)