Send lowercase Cloud Connector HTTP headers
What does this MR do and why?
HTTP/2 requires headers to be lowercase (source), and gRPC fails with an error if that is not the case. This was breaking Duo Workflow unless the client code downcased these headers manually.
I also addressed several cases of strong coupling to Cloud Connector where tests were stubbing out code that operated several layers below in abstraction. This should decouple these tests from future changes made to CC internals, such as which HTTP headers we inject.
References
- Draft: Fix: use standard cloud connector header... (!184833 - closed)
- Use standard CloudConnector header fields in Wo... (#501411)
Screenshots or screen recordings
Verified that the ai-gateway still interprets these header fields correctly:
{"url": "http://ai-gateway:5000/v2/chat/agent", "path": "/v2/chat/agent", "status_code": 200, "method": "POST", "correlation_id": "01JPQ11KVD6G0MCDVCZV37NVP9", "http_version": "1.1", "client_ip": "172.18.0.7", "client_port": 51364, "duration_s": 5.3262842029998865, "duration_request": 0.008043527603149414, "request_arrived_at": "2025-03-19T11:02:01.064748+00:00", "response_start_duration_s": 0.06720473799941828, "first_chunk_duration_s": 3.8240186869988975, "cpu_s": 0.21993872699999972, "content_type": "application/x-ndjson; charset=utf-8", "user_agent": "Ruby", "gitlab_language_server_version": null, "gitlab_instance_id": "a6e81ef0-35df-4d57-97f7-e37c6b79df7f", "gitlab_global_user_id": "q+vFyrImQ4gTk1smZ5dyZAsEU2epA2nD2qjEORIQYcs=", "gitlab_host_name": "gitlab.local", "gitlab_version": "17.10.0", "gitlab_saas_duo_pro_namespace_ids": null, "gitlab_feature_enabled_by_namespace_ids": "", "gitlab_feature_enablement_type": "add_on", "gitlab_realm": "self-managed", "gitlab_duo_seat_count": "100", "auth_duration_s": 0.00078536000000895, "token_issuer": "http://gitlab.local:3000", "enabled_feature_flags": "expanded_ai_logging", "meta.feature_category": "duo_chat", "duo_chat.agent_available_tools": ["build_reader", "epic_reader", "issue_reader", "merge_request_reader", "commit_reader", "gitlab_documentation"], "logger": "api.access", "level": "info", "type": "mlops", "stage": "main", "timestamp": "2025-03-19T11:02:06.391117Z", "message": "172.18.0.7:51364 - \"POST /v2/chat/agent HTTP/1.1\" 200"}
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #501411
Edited by Matthias Käppler