feat(auth): bind binders accept (realtime, realtimeRegistry) params
Extend bindProductionAuth and bindDevSeedAuth to 7-arg signatures. Fix RecordingRealtimeBroadcaster scope type to structurally match ChannelScope. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import "reflect-metadata";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import { NoopTracer, NoopLogger } from "@repo/core-shared/instrumentation";
|
||||
import { RecordingEventBus, RecordingJobQueue } from "@repo/core-testing/instrumentation";
|
||||
import { RecordingEventBus, RecordingJobQueue, RecordingRealtimeBroadcaster } from "@repo/core-testing/instrumentation";
|
||||
import { RealtimeHandlerRegistry } from "@repo/core-realtime";
|
||||
import { bindDevSeedAuth } from "@/di/bind-dev-seed";
|
||||
import { authContainer } from "@/di/container";
|
||||
import { AUTH_SYMBOLS } from "@/di/symbols";
|
||||
@@ -32,7 +33,7 @@ describe("bindDevSeedAuth", () => {
|
||||
});
|
||||
|
||||
it("populates the repository with the dev users", async () => {
|
||||
await bindDevSeedAuth(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue());
|
||||
await bindDevSeedAuth(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue(), new RecordingRealtimeBroadcaster(), new RealtimeHandlerRegistry());
|
||||
|
||||
const repo = authContainer.get<IUsersRepository>(
|
||||
AUTH_SYMBOLS.IUsersRepository,
|
||||
@@ -45,7 +46,7 @@ describe("bindDevSeedAuth", () => {
|
||||
});
|
||||
|
||||
it("seeds alice reachable by username", async () => {
|
||||
await bindDevSeedAuth(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue());
|
||||
await bindDevSeedAuth(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue(), new RecordingRealtimeBroadcaster(), new RealtimeHandlerRegistry());
|
||||
|
||||
const repo = authContainer.get<IUsersRepository>(
|
||||
AUTH_SYMBOLS.IUsersRepository,
|
||||
@@ -58,13 +59,13 @@ describe("bindDevSeedAuth", () => {
|
||||
});
|
||||
|
||||
it("is idempotent — calling twice rebuilds a fresh populated repo", async () => {
|
||||
await bindDevSeedAuth(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue());
|
||||
await bindDevSeedAuth(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue(), new RecordingRealtimeBroadcaster(), new RealtimeHandlerRegistry());
|
||||
const before = authContainer.get<IUsersRepository>(
|
||||
AUTH_SYMBOLS.IUsersRepository,
|
||||
);
|
||||
const beforeAlice = await before.getUserByUsername("alice");
|
||||
|
||||
await bindDevSeedAuth(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue());
|
||||
await bindDevSeedAuth(noop.tracer, noop.logger, new RecordingEventBus(), new RecordingJobQueue(), new RecordingRealtimeBroadcaster(), new RealtimeHandlerRegistry());
|
||||
const after = authContainer.get<IUsersRepository>(
|
||||
AUTH_SYMBOLS.IUsersRepository,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user