Skip to content

Commit a2413e0

Browse files
committed
refactor(plugin-auth): move the buildPluginList body into auth-manager-plugin-list.ts
The body of AuthManager.buildPluginList() moves unedited into the module function buildPluginList, re-indented one level: the reset of the degraded-feature record and the JWT signing verdict, the enabled table with its env and config precedence and the SCIM coherence re-check, and every plugin in the same order (bearer, the organization factory's arrow, twoFactor, breached-password rejection, admin, phoneNumber, magicLink, the generic OAuth providers, the OIDC provider with its jwt plugin, sso, scim, device authorization and the custom session). The method keeps its place, docblock, signature and return type; it now builds one host of the 22 AuthManager members the body reads (18 methods as late-bound closures, config and degradedFeatures as getters, jwtSigningFailureReported and orgRolesMap as get/set pairs because the body writes them) and returns buildPluginList.call(host). The async moved from the method to the function. The organization factory's arrow, which cut 15 left in the body, moves with it and builds its host from this host, so it reaches the same members and the same field as before. readBooleanEnv and consentOrganizationOf, the two top-level declarations of auth-manager.ts the body reads that the file did not export, are exported in place and imported by value with the five that already were; src/index.ts names its auth-manager.ts exports one by one, so nothing new is published. Nine imported names leave auth-manager.ts with the body. Readers that follow it: the two plugin-factory scans read the module, and the population comments in auth-email-locale.test.ts name it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LSXBc2GCBwiAL7vV4kWkyr
1 parent 10b8250 commit a2413e0

5 files changed

Lines changed: 961 additions & 813 deletions

File tree

‎packages/plugins/plugin-auth/src/auth-email-locale.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,8 @@ describe("#14641 — an invitation reads the INVITEE's own sys_user.locale", ()
860860
* implied: the auth mail surface is the five `sendTemplate` call sites in
861861
* `auth-manager.ts`, `auth-manager-auth-instance.ts` (the body of
862862
* `createAuthInstance`), `auth-manager-organization-plugin.ts` (the body of
863-
* the organization plugin's factory) and `auth-manager-email-sms-delivery.ts`
863+
* the organization plugin's factory), `auth-manager-plugin-list.ts` (the body
864+
* of `buildPluginList`) and `auth-manager-email-sms-delivery.ts`
864865
* (the body of the change-email notice) — `IEmailService` declares exactly two delivering
865866
* members (`send`, `sendTemplate`), plugin-auth's only `.send(` calls are the
866867
* SMS service's, and no other file under `plugin-auth/src` calls either.
@@ -1125,8 +1126,9 @@ describe('#15106 — the CLASS claim: all five auth sends read the recipient col
11251126

11261127
it('every one of the five sends is written in the stored language of its own recipient', async () => {
11271128
// ⚠️ POPULATION: the five `sendTemplate` sites in `auth-manager.ts`,
1128-
// `auth-manager-auth-instance.ts`, `auth-manager-organization-plugin.ts` and
1129-
// `auth-manager-email-sms-delivery.ts` — the same five `driveAllFive` drives and `TEMPLATES` names, and the whole of
1129+
// `auth-manager-auth-instance.ts`, `auth-manager-organization-plugin.ts`,
1130+
// `auth-manager-plugin-list.ts` and `auth-manager-email-sms-delivery.ts` — the
1131+
// same five `driveAllFive` drives and `TEMPLATES` names, and the whole of
11301132
// plugin-auth's mail surface (see this section's header). This is the pin
11311133
// that closes the class; the per-send pins above only cover one member.
11321134
//

0 commit comments

Comments
 (0)