Skip to content

feat: resolve orgs from workspace session tokens in AI Gateway requests - #30902

Merged
SasSwart merged 6 commits into
mainfrom
sdlcgraph/aigov-714-1
Oct 26, 2026
Merged

SasSwart merged 6 commits into
mainfrom
sdlcgraph/aigov-714-1

Conversation

@SasSwart

Copy link
Copy Markdown
Collaborator

Add an AI Gateway org resolver at the coderd IsAuthorized boundary, detect workspace session tokens, load the workspace org, validate the user is still a member of that org, reject missing workspaces or invalid membership, and return the resolved org in IsAuthorizedResponse while leaving it unused by downstream policy. Include tests for successful workspace-token resolution, missing workspace rejection, invalid org membership rejection, and compatibility with the existing ServeHTTP flow.

Fixes AIGOV-714

@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

AIGOV-714

# Conflicts:
#	coderd/aibridged/aibridged_test.go
#	coderd/aibridged/proto/aibridged.pb.go
#	coderd/aibridged/proto/aibridged.proto
#	coderd/aibridged/proto/version.go
@SasSwart
SasSwart requested a review from mtojek October 19, 2026 07:52
@SasSwart SasSwart changed the title Resolve AI Gateway orgs from workspace session tokens feat: resolve orgs from workspace session tokens in AI Gateway requests Oct 19, 2026
@mtojek

mtojek commented Oct 19, 2026

Copy link
Copy Markdown
Member

@SasSwart I see this is a draft, and make gen is failing. Should I wait for the final PR?

@SasSwart
SasSwart marked this pull request as ready for review October 19, 2026 08:06
Comment thread coderd/aibridgedserver/orgresolver.go Resolved
Comment thread coderd/aibridgedserver/orgresolver.go Resolved

@mtojek mtojek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SasSwart
SasSwart merged commit 946c2f0 into main Oct 26, 2026
29 checks passed
@SasSwart
SasSwart deleted the sdlcgraph/aigov-714-1 branch October 26, 2026 09:40
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 26, 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.

2 participants