Support HTTP Basic auth in API-key connections

Cursor's Admin API authenticates with the admin key as the HTTP
Basic auth username (empty password) and rejects Bearer tokens.
The API-key connection previously supported only Bearer and a
custom header (Anthropic's x-api-key); add a Basic-auth mode
selected by Registration.APIKeyBasicAuth, and reject providers
that set both it and APIKeyHeader.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
Aurélien Sibiril
2026-05-28 23:44:28 +02:00
parent 72c35a9967
commit 0149ca4f55
6 changed files with 179 additions and 2 deletions

View File

@@ -41,8 +41,9 @@ func (r *mutationResolver) CreateAPIKeyConnector(ctx context.Context, input type
Provider: input.Provider,
Protocol: coredata.ConnectorProtocolAPIKey,
Connection: &connector.APIKeyConnection{
APIKey: input.APIKey,
Header: r.providerRegistry.APIKeyHeader(input.Provider),
APIKey: input.APIKey,
Header: r.providerRegistry.APIKeyHeader(input.Provider),
BasicAuth: r.providerRegistry.APIKeyUsesBasicAuth(input.Provider),
},
}