mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
a0e5e03903
* feat: Add async spam check integration and decoy booking response - Integrate SpamCheckService with handleNewBooking workflow - Implement parallel spam check execution for minimal performance impact - Add decoy booking response with localStorage-based success page - Extract organization ID from event type for org-specific blocking - Add comprehensive test coverage for spam detection scenarios - Create reusable components for booking success cards - Implement fail-open behavior to never block legitimate bookings This builds on the spam blocker DI infrastructure from PR #24040 by adding the actual integration into the booking flow and implementing the decoy response mechanism to avoid revealing spam detection to malicious actors. Related: #24040 Co-Authored-By: [email protected] <[email protected]> * Do checks in paralle * Fix leaking host name in title * Reduce expoiry time localstorage --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
37 lines
1.6 KiB
TypeScript
37 lines
1.6 KiB
TypeScript
import { createModule } from "@evyweb/ioctopus";
|
|
|
|
import { DI_TOKENS } from "@calcom/features/di/tokens";
|
|
import { GlobalWatchlistRepository } from "@calcom/features/watchlist/lib/repository/GlobalWatchlistRepository";
|
|
import { OrganizationWatchlistRepository } from "@calcom/features/watchlist/lib/repository/OrganizationWatchlistRepository";
|
|
import { PrismaWatchlistAuditRepository } from "@calcom/features/watchlist/lib/repository/PrismaWatchlistAuditRepository";
|
|
|
|
import { WATCHLIST_DI_TOKENS } from "../Watchlist.tokens";
|
|
import { GlobalBlockingService } from "@calcom/features/watchlist/lib/service/GlobalBlockingService";
|
|
import { OrganizationBlockingService } from "@calcom/features/watchlist/lib/service/OrganizationBlockingService";
|
|
|
|
export const watchlistModule = createModule();
|
|
|
|
watchlistModule.bind(WATCHLIST_DI_TOKENS.GLOBAL_BLOCKING_SERVICE).toClass(GlobalBlockingService, {
|
|
globalRepo: DI_TOKENS.GLOBAL_WATCHLIST_REPOSITORY,
|
|
});
|
|
|
|
watchlistModule.bind(WATCHLIST_DI_TOKENS.ORGANIZATION_BLOCKING_SERVICE).toClass(OrganizationBlockingService,{
|
|
orgRepo: DI_TOKENS.ORGANIZATION_WATCHLIST_REPOSITORY,
|
|
});
|
|
|
|
// Bind specialized repositories
|
|
watchlistModule
|
|
.bind(WATCHLIST_DI_TOKENS.GLOBAL_WATCHLIST_REPOSITORY)
|
|
.toClass(GlobalWatchlistRepository, [DI_TOKENS.PRISMA_CLIENT]);
|
|
|
|
watchlistModule
|
|
.bind(WATCHLIST_DI_TOKENS.ORGANIZATION_WATCHLIST_REPOSITORY)
|
|
.toClass(OrganizationWatchlistRepository, [DI_TOKENS.PRISMA_CLIENT]);
|
|
|
|
// Bind remaining repositories
|
|
watchlistModule
|
|
.bind(WATCHLIST_DI_TOKENS.AUDIT_REPOSITORY)
|
|
.toClass(PrismaWatchlistAuditRepository, [DI_TOKENS.PRISMA_CLIENT]);
|
|
|
|
// Services are created in the facade to handle Deps pattern properly
|