refactor: rename the encryption key to what it actually protects
CALENDAR_ENCRYPTION_KEY was named after the calendar module because that module needed encryption first, in Phase 5. Every feature since has shared the same key -- SMTP, the DKV and tender mailboxes, and as of today the LDAP bind password -- so the name has been describing one of five users rather than the thing itself, and each new feature inherited the confusion. TESSERA_ENCRYPTION_KEY is the name now. The old one is still read, because renaming outright would stop every existing installation at the next start: their .env carries the old name, and compose was just made to fail hard on a missing key. When only the old name is present the API logs a deprecation warning naming both, and when both are set the new one wins -- otherwise a half-migrated .env would encrypt with one key and decrypt with the other. CalendarCryptoService becomes CryptoService in its own global CryptoModule. Four modules used to import CalendarModule purely to reach the provider, which read as a dependency on calendars where there was none; that import is gone. Compose keeps the hard failure: without either name the stack refuses to start. Verified in both files for all three cases -- neither name set (abort), only the old name (starts), only the new name (starts). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Logger, Module, OnModuleInit } from '@nestjs/common';
|
||||
import { CalendarModule } from '../calendar/calendar.module';
|
||||
import { InboxModule } from '../inbox/inbox.module';
|
||||
import { ModuleRegistryModule } from '../module-registry/module-registry.module';
|
||||
import { ModuleRegistryService } from '../module-registry/module-registry.service';
|
||||
@@ -112,8 +111,9 @@ import { TendersController } from './tenders.controller';
|
||||
* Phase 14, Plan 03 (INGEST-05): adds `EmailAlertAdapter` (registered
|
||||
* alongside the existing adapters — `email-alert` is not denylisted) and
|
||||
* `TenderEmailConfigService` (per-tenant admin CRUD for the alert mailbox
|
||||
* config, D-06/D-07). `CalendarModule`/`InboxModule` are imported so the
|
||||
* adapter/service can inject `CalendarCryptoService` (credential encryption)
|
||||
* config, D-06/D-07). `InboxModule` is imported so the
|
||||
* adapter/service can reach the mailbox providers (credential encryption comes
|
||||
* from the global CryptoModule)
|
||||
* and `ImapProvider`/`ExchangeInboxProvider` (shared connection mechanics,
|
||||
* D-01) — the same imports DkvModule already uses for its own, separate
|
||||
* mailbox config (D-03). Unlike `rss`, the `email-alert`
|
||||
@@ -123,7 +123,7 @@ import { TendersController } from './tenders.controller';
|
||||
* safe default mailbox to seed (unlike RSS's service.bund.de default).
|
||||
*/
|
||||
@Module({
|
||||
imports: [ModuleRegistryModule, SettingsModule, CalendarModule, InboxModule],
|
||||
imports: [ModuleRegistryModule, SettingsModule, InboxModule],
|
||||
controllers: [TendersController],
|
||||
providers: [
|
||||
DoeOpenDataAdapter,
|
||||
|
||||
Reference in New Issue
Block a user