Context
The current model is single-user: a User owns links and keys directly. Real-world usage (agencies, teams) requires shared ownership.
Goal
Introduce Workspace as the ownership boundary. A user belongs to one or more workspaces with a role (owner, member).
Approach (high-level)
- New tables:
Workspace, WorkspaceMember(userId, workspaceId, role).
Link.userId -> Link.workspaceId. Migration with a default workspace per existing user.
- JWT payload gains a
workspaceId (active workspace).
POST /v1/workspaces, POST /v1/workspaces/:id/invitations, GET /v1/workspaces.
- API keys get scoped to a workspace.
Acceptance criteria
Notes
This is a significant change. Likely split into 3-4 PRs: data model, scoping, invitations, API keys.
Context
The current model is single-user: a
Userowns links and keys directly. Real-world usage (agencies, teams) requires shared ownership.Goal
Introduce
Workspaceas the ownership boundary. A user belongs to one or more workspaces with a role (owner,member).Approach (high-level)
Workspace,WorkspaceMember(userId, workspaceId, role).Link.userId->Link.workspaceId. Migration with a default workspace per existing user.workspaceId(active workspace).POST /v1/workspaces,POST /v1/workspaces/:id/invitations,GET /v1/workspaces.Acceptance criteria
/v1/links*endpoints scoped by workspaceNotes
This is a significant change. Likely split into 3-4 PRs: data model, scoping, invitations, API keys.