// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

import type { AuthConfig, AuthStrategy, Credentials } from '../auth-strategy.js';
import { MissingCredentialsError } from '../errors.js';

export class ApiKeyStrategy implements AuthStrategy {
  async authenticate(config: AuthConfig): Promise<Credentials> {
    const { apiKey } = config;
    if (!apiKey) {
      throw new MissingCredentialsError(['apiKey']);
    }
    return { apiKey };
  }

  validateCredentials(credentials: Credentials): boolean {
    return typeof credentials.apiKey === 'string' && credentials.apiKey.length > 0;
  }
}
