/**
* Layer 2: Backend Auth Factory
*
* This module provides backend authentication for upstream API access.
* Backend auth is INDEPENDENT of identity - you can authenticate users
* via Google but call Rocket.net with user-stored credentials.
*
* Patterns:
* A. User OAuth (same provider) - Single OAuth flow
* B. User OAuth (cross-provider) - Different identity and API providers
* C. User Credentials - User provides API key/password
* D. Server OAuth - Admin connects shared account
* E. Server API Key - Single credential for all users
* F. None - No backend auth needed
*
* Usage:
* import { type BackendCredentials, type StoredCredential } from './backend';
*/
// Re-export types
export * from './types';
// Future: Factory function
// export function createBackendAuth(
// config: BackendAuthConfig,
// env: Record<string, unknown>,
// db?: D1Database,
// kv?: KVNamespace
// ): BackendAuth {
// switch (config.type) {
// case 'user-oauth-same':
// return new UserOAuthSameAuth(env);
// case 'user-credentials':
// return new UserCredentialsAuth(env, db);
// case 'server-oauth':
// return new ServerOAuthAuth(env, kv);
// case 'server-key':
// return new ServerKeyAuth(env);
// case 'none':
// return new NoAuth();
// default:
// return new NoAuth();
// }
// }