Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(coderd): enforce required external auth on workspace create (#26314) - #26791

Merged
f0ssel merged 1 commit into
release/2.33from
rowan/backport_26314_233
Jun 29, 2026
Merged

fix(coderd): enforce required external auth on workspace create (#26314)#26791
f0ssel merged 1 commit into
release/2.33from
rowan/backport_26314_233

Conversation

@rowansmithau

Copy link
Copy Markdown
Member

backport of #26314 for the 2.33 branch.

Required external auth (optional = false) was only enforced by client-side preflight checks, so creating a workspace via the REST API succeeded even when the owner had never authenticated, producing a broken workspace.

createWorkspace now validates the workspace owner's external auth server-side and returns 403 before any row is inserted or prebuild is claimed. The owner (not the initiator) is checked because build-time token injection uses their links, so this also covers admin-on-behalf-of creates and prebuild claims. Use optional = true to allow pre-provisioning for unauthenticated users.

Fixes PLAT-241.

This PR was generated by Coder Agents on behalf of
@dylanhuff-at-coder.

Required external auth (`optional = false`) was only enforced by
client-side preflight checks, so creating a workspace via the REST API
succeeded even when the owner had never authenticated, producing a
broken workspace.

`createWorkspace` now validates the workspace owner's external auth
server-side and returns 403 before any row is inserted or prebuild is
claimed. The owner (not the initiator) is checked because build-time
token injection uses their links, so this also covers admin-on-behalf-of
creates and prebuild claims. Use `optional = true` to allow
pre-provisioning for unauthenticated users.

Fixes PLAT-241.

> This PR was generated by Coder Agents on behalf of
@dylanhuff-at-coder.
@rowansmithau rowansmithau self-assigned this Jun 29, 2026
@linear-code

linear-code Bot commented Jun 29, 2026

Copy link
Copy Markdown

PLAT-241

@rowansmithau
rowansmithau requested a review from f0ssel June 29, 2026 04:18
@rowansmithau
rowansmithau marked this pull request as ready for review June 29, 2026 04:18
@f0ssel
f0ssel merged commit 30f8b64 into release/2.33 Jun 29, 2026
53 of 55 checks passed
@f0ssel
f0ssel deleted the rowan/backport_26314_233 branch June 29, 2026 16:29
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants