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:
@@ -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),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user