@fonderie/admin 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -42,6 +42,23 @@ interface IAdminOptions {
42
42
  host?: string | string[];
43
43
  store?: IStoreAdapter;
44
44
  env?: string[];
45
+ /**
46
+ * Operator accounts: people sign in to the console with email, password and
47
+ * an authenticator app (backup codes as the fallback) instead of pasting a
48
+ * token. On by default whenever a `store` is given; `false` turns the sign-in
49
+ * routes off. There is no registration: the first operator is claimed once
50
+ * with the root adminToken, every other one is invited by an operator.
51
+ * adminToken stays the machine credential (CLI, CI) and the break-glass.
52
+ */
53
+ operators?: boolean;
54
+ /**
55
+ * OPTIONAL hardening. 64 hex chars (`openssl rand -hex 32`) that encrypt
56
+ * operators' authenticator secrets at rest (AES-256-GCM), so a database leak
57
+ * alone does not yield them. Unset ⇒ stored as-is — a supported setup: a
58
+ * leaked secret still needs the operator's password. Adding it later is safe;
59
+ * changing it once set invalidates every enrolled authenticator.
60
+ */
61
+ operatorKey?: string;
45
62
  }
46
63
  interface IAdminModuleEntry {
47
64
  name: string;
@@ -270,6 +287,9 @@ declare function issueToken(store: IStoreAdapter, input: {
270
287
  record: IAdminTokenRecord;
271
288
  }>;
272
289
  declare function revokeToken(store: IStoreAdapter, id: string): Promise<boolean>;
273
- declare function requireAdminScope(bootstrap: string, store: IStoreAdapter | undefined, needed: AdminScope | 'root'): Middleware;
290
+ declare function requireAdminScope(bootstrap: string, store: IStoreAdapter | undefined, needed: AdminScope | 'root', opts?: {
291
+ stepUp?: boolean;
292
+ operators?: boolean;
293
+ }): Middleware;
274
294
 
275
295
  export { ADMIN_VERSION, AdminModule, type AdminRouteGuard, type AdminScope, DEFAULT_ACTOR, DEFAULT_ADMIN_PATH, DEFAULT_CHECK_TIMEOUT_MS, type IAdminAttention, type IAdminAttentionItem, type IAdminCheckResult, type IAdminDoctorReport, type IAdminEnvEntry, type IAdminEnvironmentReport, type IAdminLogEntry, type IAdminLogPage, type IAdminManifest, type IAdminMigrationModule, type IAdminMigrationsReport, type IAdminModuleEntry, type IAdminOptions, type IAdminPendingMigration, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminTokenEntry, type IAdminTokenRecord, type IAdminTokensReport, type IMigrationSet, MAX_PAGE, SCOPES, adminLog, applyMigrationsSchema, applyModuleMigrations, attention, buildManifest, collectChecks, environmentReport, grants, hashToken, issueToken, listTokens, migrationsReport, readAdminLog, requireAdminScope, revokeToken, routesReport, runDoctor, scopeFor, tokensReport };