feat: validate aiproxy allowlisted domains have aibridge provider mappings at startup#21577
Merged
ssncferreira merged 1 commit intomainfrom Jan 20, 2026
Merged
Conversation
e13c853 to
519b70f
Compare
519b70f to
ca096f7
Compare
| // Validate that all allowlisted domains have correct aibridge provider mappings. | ||
| for _, domain := range opts.DomainAllowlist { | ||
| if aibridgeProviderFromHost(domain) == "" { | ||
| return nil, xerrors.Errorf("domain %q is in allowlist but has no provider mapping", domain) |
Contributor
There was a problem hiding this comment.
I wonder if this will be enough for operators to go on. We might need a related section in the docs for troubleshooting this problem.
Contributor
Author
There was a problem hiding this comment.
Agree, I think we should make this clean in the documentation 👍
Contributor
There was a problem hiding this comment.
Can you please raise an issue, or add to coder/internal#1188 so we don't forget?
Contributor
Author
There was a problem hiding this comment.
Good idea, added a comment to the issue: coder/internal#1188 (comment)
dannykopping
approved these changes
Jan 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds startup validation to ensure all allowlisted domains have corresponding AI Bridge provider mappings. This prevents a misconfiguration where a domain could be MITM'd (decrypted) but have no route to aibridge.
Previously, if a domain was in the allowlist but had no provider mapping, requests would be decrypted and forwarded to the original destination, a potential privacy concern. Now the server fails to start if this misconfiguration is detected.