// {{ 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 PatAuthStrategy implements AuthStrategy {
  async authenticate(config: AuthConfig): Promise<Credentials> {
    const { token } = config;
    if (!token) {
      throw new MissingCredentialsError(['token']);
    }
    return { token, authorizationHeader: `Bearer ${token}` };
  }

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