Skip to content

Commit 71489c2

Browse files
committed
enforce org id argument
1 parent d26216e commit 71489c2

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

coderd/database/queries.sql.go

Lines changed: 1 addition & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/provisionerjobs.sql

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,7 @@ WHERE
1919
provisioner_jobs AS nested
2020
WHERE
2121
nested.started_at IS NULL
22-
AND CASE
23-
-- For backwards compatibility, the old provisionerd api did
24-
-- not take organization_id as a parameter. In the future if
25-
-- we scope provisioner auth to a given org, we can apply
26-
-- this argument for the caller.
27-
WHEN @organization_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid
28-
THEN nested.organization_id = @organization_id
29-
ELSE TRUE
30-
END
22+
AND nested.organization_id = @organization_id
3123
-- Ensure the caller has the correct provisioner.
3224
AND nested.provisioner = ANY(@types :: provisioner_type [ ])
3325
AND CASE

0 commit comments

Comments
 (0)