mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-27 23:09:08 +01:00
[management,proxy] Add agentgateway integration (#7274)
* [management] Add agentgateway provider catalog entry Allow Agent Network providers to target an operator-supplied agentgateway proxy while stamping trusted NetBird identity headers. Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> * [proxy] Allow trusted Agent Network identity headers Permit only the built-in identity injector to replace the two reserved agentgateway attribution headers while keeping them blocked for every other middleware. Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> * [management,proxy] Add multi-vendor gateway routing Let one Agent Network route declare multiple parser surfaces while preserving the existing singular vendor wire field. Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> * [management] Update router test for model policies Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> * [proxy] Cover reserved header policy Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> * [management] Add agentgateway model discovery Use agentgateway's OpenAI-compatible models endpoint and omit wildcard patterns until NetBird can authorize and price them consistently. Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> --------- Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io>
This commit is contained in:
@@ -352,6 +352,7 @@ type routerConfig struct {
|
||||
type routerProviderRoute struct {
|
||||
ID string `json:"id"`
|
||||
Vendor string `json:"vendor,omitempty"`
|
||||
Vendors []string `json:"vendors,omitempty"`
|
||||
Models []string `json:"models"`
|
||||
UpstreamScheme string `json:"upstream_scheme"`
|
||||
UpstreamHost string `json:"upstream_host"`
|
||||
@@ -461,6 +462,7 @@ func buildRouterConfigJSON(providers []*types.Provider, groupIndex map[string][]
|
||||
cfg.Providers = append(cfg.Providers, routerProviderRoute{
|
||||
ID: p.ID,
|
||||
Vendor: providerVendor(p),
|
||||
Vendors: providerVendors(p),
|
||||
Models: providerModelIDs(p),
|
||||
UpstreamScheme: scheme,
|
||||
UpstreamHost: host,
|
||||
@@ -525,6 +527,17 @@ func providerVendor(p *types.Provider) string {
|
||||
return entry.ParserID
|
||||
}
|
||||
|
||||
// providerVendors returns the parser surfaces a multi-surface gateway route
|
||||
// accepts. Single-surface providers keep using the singular vendor field so
|
||||
// existing proxy versions and configurations retain their wire shape.
|
||||
func providerVendors(p *types.Provider) []string {
|
||||
entry, ok := catalog.Lookup(p.ProviderID)
|
||||
if !ok || len(entry.RouterVendors) == 0 {
|
||||
return nil
|
||||
}
|
||||
return append([]string(nil), entry.RouterVendors...)
|
||||
}
|
||||
|
||||
// providerModelIDs returns the model identifiers exposed by the
|
||||
// provider, deduplicated and in the operator's declared order. Empty
|
||||
// slice when no models are configured — the router treats that as
|
||||
|
||||
Reference in New Issue
Block a user