Skip to content

test: include per-org default roles in rbac user subjects#26003

Merged
Emyrk merged 1 commit into
mainfrom
gateway-accounts/test-subject-default-roles
Jun 5, 2026
Merged

test: include per-org default roles in rbac user subjects#26003
Emyrk merged 1 commit into
mainfrom
gateway-accounts/test-subject-default-roles

Conversation

@Emyrk

@Emyrk Emyrk commented Jun 2, 2026

Copy link
Copy Markdown
Member

Just fixing tests

Refs #25936. Stacks on #25994.

Aligns the coderdtest user subject helper with production so per-org default member roles surface in tests.

  • AuthzUserSubjectWithDB unions organizations.default_org_member_roles into the subject's roles, matching GetAuthorizationUserRoles.
  • Without it, any test using the helper sees organization-member only and silently masks regressions on permissions granted via the union.
  • MemberSubject moves out of coderdtest/subjects.go into its sole consumer and unexports.
  • coderd/coderdtest/subjects.go is deleted.
Implementation notes
  • testutil/websocket.go swaps its example doc to a generic mySubject placeholder since MemberSubject is no longer importable.
  • Both items surfaced during the Gateway Accounts (PLAT-217) resolve-at-read audit on feat: configurable default org member roles #25994. Extracted here because they only touch test scaffolding.

Coder Agents on behalf of @Emyrk.

@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from c5afc1c to 4d52fbe Compare June 2, 2026 23:02
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from e0c052e to bc9063b Compare June 2, 2026 23:02
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from 4d52fbe to 286774c Compare June 2, 2026 23:19
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from bc9063b to f2aed83 Compare June 2, 2026 23:19
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from 286774c to e6dfeb2 Compare June 2, 2026 23:28
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from f2aed83 to 71b14db Compare June 2, 2026 23:28
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from e6dfeb2 to 85045f1 Compare June 3, 2026 13:15
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch 2 times, most recently from bdc563e to dc2e810 Compare June 3, 2026 13:58
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from 85045f1 to d15a3f0 Compare June 3, 2026 13:58
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from dc2e810 to 888096e Compare June 3, 2026 14:56
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch 2 times, most recently from 03fe290 to 9edae41 Compare June 3, 2026 16:02
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 888096e to e18d560 Compare June 3, 2026 16:02
@Emyrk Emyrk changed the title test: include default_org_member_roles in AuthzUserSubjectWithDB test: include per-org default roles in rbac user subjects Jun 3, 2026
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from e18d560 to b61e0b0 Compare June 3, 2026 16:06
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from 9edae41 to ad60bf1 Compare June 3, 2026 20:48
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from b61e0b0 to 3bf0cd9 Compare June 3, 2026 20:48
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from ad60bf1 to 926baff Compare June 3, 2026 21:09
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 3bf0cd9 to 4347bf4 Compare June 3, 2026 21:09
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from 926baff to e25bccb Compare June 3, 2026 21:23
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 4347bf4 to e4356f7 Compare June 3, 2026 21:23
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from e25bccb to 932db6e Compare June 3, 2026 21:43
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch 2 times, most recently from 00b5c1f to 0988f35 Compare June 3, 2026 21:56
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from 7702c39 to b96becd Compare June 3, 2026 22:14
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 0988f35 to 27102b3 Compare June 3, 2026 22:14
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from b96becd to 56ddb69 Compare June 3, 2026 22:20
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 27102b3 to e3705f7 Compare June 3, 2026 22:20
@Emyrk Emyrk marked this pull request as ready for review June 3, 2026 22:24
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from e3705f7 to 6c14675 Compare June 3, 2026 22:29
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from 56ddb69 to dce59fb Compare June 3, 2026 22:29
@Emyrk Emyrk requested a review from geokat June 4, 2026 14:42
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 6c14675 to 5f27760 Compare June 5, 2026 14:19
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch 2 times, most recently from 662646e to 16724f9 Compare June 5, 2026 15:32
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 5f27760 to bca7a5d Compare June 5, 2026 15:32
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from bca7a5d to c76dc3f Compare June 5, 2026 18:59
@Emyrk Emyrk force-pushed the gateway-accounts/org-default-roles branch from ed135cf to 0474e9f Compare June 5, 2026 19:20
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from c76dc3f to 71515b0 Compare June 5, 2026 19:20
@Emyrk Emyrk changed the base branch from gateway-accounts/org-default-roles to graphite-base/26003 June 5, 2026 19:33
@Emyrk Emyrk force-pushed the graphite-base/26003 branch from 0474e9f to 938c208 Compare June 5, 2026 19:33
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 71515b0 to 8f093d5 Compare June 5, 2026 19:33
@graphite-app graphite-app Bot changed the base branch from graphite-base/26003 to main June 5, 2026 19:34
Aligns coderdtest.AuthzUserSubjectWithDB with GetAuthorizationUserRoles
so tests built via this helper see the per-org default_org_member_roles
union, not just organization-member. Also moves the single-use
MemberSubject helper into its sole consumer and unexports it.

Refs #25936.
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 8f093d5 to 92e48cc Compare June 5, 2026 19:34
@Emyrk Emyrk merged commit 8a5e04e into main Jun 5, 2026
25 checks passed
@Emyrk Emyrk deleted the gateway-accounts/test-subject-default-roles branch June 5, 2026 20:01
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.

2 participants