-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add core AI MITM proxy daemon #21296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
f095630 to
a6abd82
Compare
| Value: &c.AI.ProxyConfig.KeyFile, | ||
| Default: "", | ||
| Group: &deploymentGroupAIProxy, | ||
| YAML: "key_file", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, do we need to set this as a secret? Something like: Annotations: serpent.Annotations{}.Mark(annotationSecretKey, "true"),
This is the file path, so the content is the actual secret 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think since it's a file path it's not sensitive itself.
dannykopping
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👍
Needs some basic test coverage please, and the renaming that we discussed offline.
| return certFile, keyFile | ||
| } | ||
|
|
||
| func TestNew(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is good but it's not validating the actual behaviour.
Can you add a test which exercises the proxy? i.e. that it actually tunnels to some mock handler?
It can be simple since we'll be doing a lot more upstack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to add more detailed tests on the following upstack PRs, but that is a good callout.
Addressed in feca199
cbbdad6 to
637bf69
Compare
637bf69 to
c90790f
Compare
dannykopping
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| Value: &c.AI.ProxyConfig.KeyFile, | ||
| Default: "", | ||
| Group: &deploymentGroupAIProxy, | ||
| YAML: "key_file", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think since it's a file path it's not sensitive itself.
5a6ab75 to
fdd4a44
Compare
fdd4a44 to
e4d1ca1
Compare
e4d1ca1 to
ca7e3a6
Compare
|
Currently, tests are flaky because of multiple test calls to A possible fix would be to use a shared global CA for all tests so they don't overwrite each other. |

Description
Adds the core AI Bridge MITM proxy daemon. This proxy intercepts HTTPS traffic, decrypts it using a configured CA certificate, and forwards requests to AIBridge for processing.
Changes
aibridgeproxydpackage with the core proxy server implementationCODER_AIBRIDGE_PROXY_ENABLED,CODER_AIBRIDGE_PROXY_LISTEN_ADDR,CODER_AIBRIDGE_PROXY_CERT_FILE,CODER_AIBRIDGE_PROXY_KEY_FILECloses coder/internal#1180