Skip to content

feat(ep): restrict resource-creation endpoints to admin emails only#331

Merged
jameswillis99 merged 2 commits into
masterfrom
feat/ep-restrict-creation-to-admins
May 22, 2026
Merged

feat(ep): restrict resource-creation endpoints to admin emails only#331
jameswillis99 merged 2 commits into
masterfrom
feat/ep-restrict-creation-to-admins

Conversation

@jameswillis99
Copy link
Copy Markdown
Collaborator

@jameswillis99 jameswillis99 commented May 22, 2026

What does this MR do?

Restricts workspace and team creation to users listed in `ADMIN_EMAILS` only, using the existing `adminOnly` middleware. Project endpoints remain open — EP provisioned users need to create and manage projects themselves.

Changes

  • `POST /api/v1/teams` — now requires `adminOnly`
  • `POST /api/v1/workspaces` — now requires `adminOnly`

Design decisions

`adminOnly` was chosen over a new email-domain guard because admin identity is already defined by the `ADMIN_EMAILS` env var and used consistently for all `/api/v1/admin/*` routes. No schema changes or new config is needed.

Testing

Manually verify: a non-admin session hitting `POST /api/v1/teams` or `POST /api/v1/workspaces` should receive `403 Forbidden`; an admin session should succeed as before. Project creation endpoints should be unaffected for all authenticated users.

jwillis24 added 2 commits May 22, 2026 13:29
POST /api/v1/projects, /workspaces, /teams, and clone routes now require
the requesting user to be in ADMIN_EMAILS, using the existing adminOnly
middleware.
Project endpoints remain open for EP provisioned users who need to
create and manage projects themselves.
@jameswillis99 jameswillis99 merged commit 177a675 into master May 22, 2026
15 of 17 checks passed
@jameswillis99 jameswillis99 deleted the feat/ep-restrict-creation-to-admins branch May 22, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants