@fonderie/admin 1.0.3 → 1.2.0

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,21 @@ 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
+ * 64 hex chars (`openssl rand -hex 32`). Encrypts operators' authenticator
56
+ * secrets at rest (AES-256-GCM). Unset ⇒ they are stored as-is and readiness
57
+ * warns. Keep it stable: changing it invalidates every enrolled authenticator.
58
+ */
59
+ operatorKey?: string;
45
60
  }
46
61
  interface IAdminModuleEntry {
47
62
  name: string;
@@ -270,6 +285,9 @@ declare function issueToken(store: IStoreAdapter, input: {
270
285
  record: IAdminTokenRecord;
271
286
  }>;
272
287
  declare function revokeToken(store: IStoreAdapter, id: string): Promise<boolean>;
273
- declare function requireAdminScope(bootstrap: string, store: IStoreAdapter | undefined, needed: AdminScope | 'root'): Middleware;
288
+ declare function requireAdminScope(bootstrap: string, store: IStoreAdapter | undefined, needed: AdminScope | 'root', opts?: {
289
+ stepUp?: boolean;
290
+ operators?: boolean;
291
+ }): Middleware;
274
292
 
275
293
  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 };