// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.
//
// Builds a syntactically-valid (but not functionally real) credentials
// object for the discovered primary auth scheme, so tests can seed
// AuthManager.setCredentials() directly — without a live token endpoint or
// a real upstream API, and without ever touching the real OS keychain.

import { generateKeyPairSync } from 'node:crypto';

import type { Credentials } from '../../src/auth/auth-strategy.js';

export function buildDummyCredentials(): Credentials {
{%- if auth_method_keys.0 == "basic" %}
  return { authorizationHeader: `Basic ${Buffer.from('test-user:test-pass').toString('base64')}` };
{%- elif auth_method_keys.0 == "pat" %}
  return { token: 'test-token', authorizationHeader: 'Bearer test-token' };
{%- elif auth_method_keys.0 == "apiKey" %}
  return { apiKey: 'test-api-key' };
{%- elif auth_method_keys.0 == "oauth2" %}
  return { accessToken: 'test-token', authorizationHeader: 'Bearer test-token' };
{%- elif auth_method_keys.0 == "oauth1" %}
  const { privateKey } = generateKeyPairSync('rsa', { modulusLength: 2048 });
  return {
    consumerKey: 'test-consumer',
    privateKey: privateKey.export({ type: 'pkcs1', format: 'pem' }).toString(),
  };
{%- else %}
  return {};
{%- endif %}
}
