import { Global, Module } from '@nestjs/common'; import { CryptoService } from './crypto.service'; /** * CryptoModule — the platform's single AES-256-GCM provider for credentials * that have to be replayed against a third party and therefore cannot be * hashed. * * Global on purpose. Before this module existed the provider lived in * CalendarModule, so SettingsModule, DkvModule, TendersModule and LdapModule * each imported CalendarModule just to reach it — an import that suggested a * dependency on calendars where there was none. Making it global removes that * false coupling instead of moving it to a different host module. */ @Global() @Module({ providers: [CryptoService], exports: [CryptoService], }) export class CryptoModule {}