import type { Provider } from '@nestjs/common';
import { JWT_SIGNER } from '../../domain/ports';
import { JwtSignerAdapter } from '../strategies/local-provider/jwt-signer.adapter';

/**
 * Port-to-adapter binding for the JWT signer (intra-module DI, NOT a cross-BC bridge).
 *
 * `JWT_SIGNER` is the token consumers `@Inject(...)` to obtain an `IJwtSigner` implementation.
 * Today the only implementation is `JwtSignerAdapter` (RS256, file-based key pair). To swap
 * implementations (e.g. KMS-backed signer in Phase 3), provide an alternative class implementing
 * `IJwtSigner` and replace the `useExisting` target.
 */
export const jwtSignerProvider: Provider = {
  provide: JWT_SIGNER,
  useExisting: JwtSignerAdapter,
};
