Support a custom API-key auth header in connections
The API-key connection always presented the key as Authorization: Bearer. Some providers, notably Anthropic, require the key in a custom header such as x-api-key and reject Bearer auth, returning 400 when both headers are present. Add an optional Header field on APIKeyConnection (empty preserves the Bearer default for every existing provider) served by a small transport that omits Authorization, plus a registry-declared APIKeyHeader so the create-connector resolver wires the right scheme per provider. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -40,7 +40,10 @@ func (r *mutationResolver) CreateAPIKeyConnector(ctx context.Context, input type
|
||||
OrganizationID: input.OrganizationID,
|
||||
Provider: input.Provider,
|
||||
Protocol: coredata.ConnectorProtocolAPIKey,
|
||||
Connection: &connector.APIKeyConnection{APIKey: input.APIKey},
|
||||
Connection: &connector.APIKeyConnection{
|
||||
APIKey: input.APIKey,
|
||||
Header: r.providerRegistry.APIKeyHeader(input.Provider),
|
||||
},
|
||||
}
|
||||
|
||||
raw, err := apiKeyConnectorSettings(input)
|
||||
|
||||
Reference in New Issue
Block a user