Disable code suggestions direct connection for cloud licensed self-hosted AIGW

What does this MR do and why?

Follow-up to: !225296 (comment 3236840850)

Usage billing for code suggestion in cloud licensed self-hosted instances works by sending billing events to the cloud Duo Workflow Service before each code suggestions request. We need to prevent customer from using direct connection (AI Gateway signed JWTs). This MR prevent this behavior from happening.

How to set up and validate locally

  • Make sure that self-hosted billing is enabled
    • Apply a cloud license
    • make sure to set this rails env var SELF_HOSTED_DAP_BILLING_ENABLED to true
  • Perform a code suggestion request
  • Verify that the event has been tracked, and that direct connection cannot be enabled.

In case there's a DNS error locally, export GRPC_DNS_RESOLVER=native may help.

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 #592401

Edited by Patrick Cyiza

Merge request reports

Loading