aibridge

package
v2.31.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package aibridge provides utilities for the AI Bridge feature.

Index

Constants

View Source
const HeaderCoderAuth = "X-Coder-Token"

HeaderCoderAuth is an internal header used to pass the Coder token from AI Proxy to AI Bridge for authentication. This header is stripped by AI Bridge before forwarding requests to upstream providers.

Variables

This section is empty.

Functions

func ExtractAuthToken

func ExtractAuthToken(header http.Header) string

ExtractAuthToken extracts an authorization token from HTTP headers. It checks X-Coder-Token first (set by AI Proxy), then falls back to Authorization header (Bearer token) and X-Api-Key header, which represent the different ways clients authenticate against AI providers. If none are present, an empty string is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL