Skip to content

chore: validate unknown unit primitive header

Tan Le requested to merge fix-type-auth-request into main

What does this merge request do and why?

This MR adds validation for unknown unit primitive value. This also ensures the correct enum type is passed into the can method.

How to set up and validate locally

  1. Check out to this merge request's branch.
  2. Run the application.
    poetry run ai_gateway
  3. Send an invalid cURL request to check the response.
    curl --request POST \
      --url http://ai-gateway.gdk.test:5052/v1/proxy/anthropic/ \
      --header 'Content-Type: application/json' \
      --header 'x-gitlab-unit-primitive: odd_unit'
    
    {"detail":"Unknown unit primitive header odd_unit"}

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Tan Le

Merge request reports

Loading