Skip to content

feat: validate aiproxy allowlisted domains have aibridge provider mappings at startup#21577

Merged
ssncferreira merged 1 commit intomainfrom
ssncferreira/validate-aiproxy-provider-mapping
Jan 20, 2026
Merged

feat: validate aiproxy allowlisted domains have aibridge provider mappings at startup#21577
ssncferreira merged 1 commit intomainfrom
ssncferreira/validate-aiproxy-provider-mapping

Conversation

@ssncferreira
Copy link
Contributor

@ssncferreira ssncferreira commented Jan 19, 2026

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.

@ssncferreira ssncferreira force-pushed the ssncferreira/validate-aiproxy-provider-mapping branch from e13c853 to 519b70f Compare January 19, 2026 17:49
@ssncferreira ssncferreira force-pushed the ssncferreira/validate-aiproxy-provider-mapping branch from 519b70f to ca096f7 Compare January 19, 2026 17:56
@ssncferreira ssncferreira marked this pull request as ready for review January 19, 2026 18:06
// 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)
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, I think we should make this clean in the documentation 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please raise an issue, or add to coder/internal#1188 so we don't forget?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, added a comment to the issue: coder/internal#1188 (comment)

@ssncferreira ssncferreira merged commit 09f5004 into main Jan 20, 2026
34 checks passed
@ssncferreira ssncferreira deleted the ssncferreira/validate-aiproxy-provider-mapping branch January 20, 2026 17:13
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 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