Skip to content

Commit d5411e0

Browse files
author
StackMemory Bot (CLI)
committed
feat(provenant-api): workspace + key provisioning endpoints
- POST /v1/setup — bootstrap workspace, project, first API key (no auth) - GET /v1/workspaces/:id — workspace details with members/projects/keys - POST /v1/workspaces/:id/keys — create additional API keys - POST /v1/workspaces/:id/members — invite with seat limit enforcement - Migration v2: workspaces, workspace_members, projects tables - API keys now linked to workspace_id - Deployed to CF Workers, Neon migration applied - Add .dev.vars to .gitignore
1 parent 9fce7a2 commit d5411e0

4 files changed

Lines changed: 387 additions & 19 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ out/
2121
.env.production
2222
.env.development
2323
.env.linear
24+
.dev.vars
2425

2526
# IDE & Editor
2627
.vscode/
@@ -80,6 +81,10 @@ ENV/
8081
target/
8182
Cargo.lock
8283

84+
# Swift
85+
.build/
86+
**/.build/
87+
8388
# Go
8489
*.test
8590
*.out

packages/provenant-api/src/auth.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function authenticate(request, env, sql, responseHeaders = {}) {
2828
const keyHash = createHash('sha256').update(token).digest('hex');
2929

3030
const rows = await sql`
31-
SELECT id, user_email, project_id FROM api_keys
31+
SELECT id, user_email, project_id, workspace_id FROM api_keys
3232
WHERE key_hash = ${keyHash}
3333
AND revoked_at IS NULL
3434
`;
@@ -47,5 +47,9 @@ export async function authenticate(request, env, sql, responseHeaders = {}) {
4747
() => {}
4848
);
4949

50-
return { projectId: key.project_id, email: key.user_email };
50+
return {
51+
projectId: key.project_id,
52+
workspaceId: key.workspace_id,
53+
email: key.user_email,
54+
};
5155
}

0 commit comments

Comments
 (0)