@endora-commerce/mod-mfa 0.100.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/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/admin/index.d.ts +37 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +12 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/pages/AdminSecuritySettings.d.ts +3 -0
- package/dist/admin/pages/AdminSecuritySettings.d.ts.map +1 -0
- package/dist/admin/pages/AdminSecuritySettings.js +71 -0
- package/dist/admin/pages/AdminSecuritySettings.js.map +1 -0
- package/dist/backend/entities/mfa-enrolment.entity.d.ts +33 -0
- package/dist/backend/entities/mfa-enrolment.entity.d.ts.map +1 -0
- package/dist/backend/entities/mfa-enrolment.entity.js +95 -0
- package/dist/backend/entities/mfa-enrolment.entity.js.map +1 -0
- package/dist/backend/entities/mfa-organization-policy.entity.d.ts +19 -0
- package/dist/backend/entities/mfa-organization-policy.entity.d.ts.map +1 -0
- package/dist/backend/entities/mfa-organization-policy.entity.js +60 -0
- package/dist/backend/entities/mfa-organization-policy.entity.js.map +1 -0
- package/dist/backend/entities/mfa-recovery-code.entity.d.ts +17 -0
- package/dist/backend/entities/mfa-recovery-code.entity.d.ts.map +1 -0
- package/dist/backend/entities/mfa-recovery-code.entity.js +54 -0
- package/dist/backend/entities/mfa-recovery-code.entity.js.map +1 -0
- package/dist/backend/entities/mfa-social-identity.entity.d.ts +24 -0
- package/dist/backend/entities/mfa-social-identity.entity.d.ts.map +1 -0
- package/dist/backend/entities/mfa-social-identity.entity.js +73 -0
- package/dist/backend/entities/mfa-social-identity.entity.js.map +1 -0
- package/dist/backend/index.d.ts +131 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +173 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/plugin.d.ts +99 -0
- package/dist/backend/plugin.d.ts.map +1 -0
- package/dist/backend/plugin.js +111 -0
- package/dist/backend/plugin.js.map +1 -0
- package/dist/backend/routes.admin.d.ts +23 -0
- package/dist/backend/routes.admin.d.ts.map +1 -0
- package/dist/backend/routes.admin.js +93 -0
- package/dist/backend/routes.admin.js.map +1 -0
- package/dist/backend/routes.oauth.d.ts +26 -0
- package/dist/backend/routes.oauth.d.ts.map +1 -0
- package/dist/backend/routes.oauth.js +155 -0
- package/dist/backend/routes.oauth.js.map +1 -0
- package/dist/backend/routes.org.d.ts +21 -0
- package/dist/backend/routes.org.d.ts.map +1 -0
- package/dist/backend/routes.org.js +17 -0
- package/dist/backend/routes.org.js.map +1 -0
- package/dist/backend/routes.public.d.ts +21 -0
- package/dist/backend/routes.public.d.ts.map +1 -0
- package/dist/backend/routes.public.js +118 -0
- package/dist/backend/routes.public.js.map +1 -0
- package/dist/backend/routes.self-service.d.ts +34 -0
- package/dist/backend/routes.self-service.d.ts.map +1 -0
- package/dist/backend/routes.self-service.js +113 -0
- package/dist/backend/routes.self-service.js.map +1 -0
- package/dist/backend/services/account-identity.d.ts +71 -0
- package/dist/backend/services/account-identity.d.ts.map +1 -0
- package/dist/backend/services/account-identity.js +87 -0
- package/dist/backend/services/account-identity.js.map +1 -0
- package/dist/backend/services/challenge-store.d.ts +40 -0
- package/dist/backend/services/challenge-store.d.ts.map +1 -0
- package/dist/backend/services/challenge-store.js +90 -0
- package/dist/backend/services/challenge-store.js.map +1 -0
- package/dist/backend/services/mfa-enrolment-count.service.d.ts +26 -0
- package/dist/backend/services/mfa-enrolment-count.service.d.ts.map +1 -0
- package/dist/backend/services/mfa-enrolment-count.service.js +34 -0
- package/dist/backend/services/mfa-enrolment-count.service.js.map +1 -0
- package/dist/backend/services/mfa-enrolment-service.d.ts +54 -0
- package/dist/backend/services/mfa-enrolment-service.d.ts.map +1 -0
- package/dist/backend/services/mfa-enrolment-service.js +217 -0
- package/dist/backend/services/mfa-enrolment-service.js.map +1 -0
- package/dist/backend/services/mfa-enrolment-state.service.d.ts +27 -0
- package/dist/backend/services/mfa-enrolment-state.service.d.ts.map +1 -0
- package/dist/backend/services/mfa-enrolment-state.service.js +33 -0
- package/dist/backend/services/mfa-enrolment-state.service.js.map +1 -0
- package/dist/backend/services/mfa-login-service.d.ts +56 -0
- package/dist/backend/services/mfa-login-service.d.ts.map +1 -0
- package/dist/backend/services/mfa-login-service.js +89 -0
- package/dist/backend/services/mfa-login-service.js.map +1 -0
- package/dist/backend/services/mfa-org-policy-service.d.ts +16 -0
- package/dist/backend/services/mfa-org-policy-service.d.ts.map +1 -0
- package/dist/backend/services/mfa-org-policy-service.js +43 -0
- package/dist/backend/services/mfa-org-policy-service.js.map +1 -0
- package/dist/backend/services/mfa-policy-resolver.d.ts +47 -0
- package/dist/backend/services/mfa-policy-resolver.d.ts.map +1 -0
- package/dist/backend/services/mfa-policy-resolver.js +82 -0
- package/dist/backend/services/mfa-policy-resolver.js.map +1 -0
- package/dist/backend/services/oauth-provider-service.d.ts +65 -0
- package/dist/backend/services/oauth-provider-service.d.ts.map +1 -0
- package/dist/backend/services/oauth-provider-service.js +80 -0
- package/dist/backend/services/oauth-provider-service.js.map +1 -0
- package/dist/backend/services/recovery-codes.d.ts +10 -0
- package/dist/backend/services/recovery-codes.d.ts.map +1 -0
- package/dist/backend/services/recovery-codes.js +18 -0
- package/dist/backend/services/recovery-codes.js.map +1 -0
- package/dist/backend/services/secret-cipher.d.ts +16 -0
- package/dist/backend/services/secret-cipher.d.ts.map +1 -0
- package/dist/backend/services/secret-cipher.js +52 -0
- package/dist/backend/services/secret-cipher.js.map +1 -0
- package/dist/backend/services/social-identity-service.d.ts +40 -0
- package/dist/backend/services/social-identity-service.d.ts.map +1 -0
- package/dist/backend/services/social-identity-service.js +69 -0
- package/dist/backend/services/social-identity-service.js.map +1 -0
- package/dist/backend/services/social-link-service.d.ts +63 -0
- package/dist/backend/services/social-link-service.d.ts.map +1 -0
- package/dist/backend/services/social-link-service.js +121 -0
- package/dist/backend/services/social-link-service.js.map +1 -0
- package/dist/backend/services/totp.d.ts +11 -0
- package/dist/backend/services/totp.d.ts.map +1 -0
- package/dist/backend/services/totp.js +46 -0
- package/dist/backend/services/totp.js.map +1 -0
- package/dist/manifest.d.ts +184 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +264 -0
- package/dist/manifest.js.map +1 -0
- package/dist/migrations/20260611T140409_mfa_init.d.ts +22 -0
- package/dist/migrations/20260611T140409_mfa_init.d.ts.map +1 -0
- package/dist/migrations/20260611T140409_mfa_init.js +94 -0
- package/dist/migrations/20260611T140409_mfa_init.js.map +1 -0
- package/dist/migrations/index.d.ts +27 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +29 -0
- package/dist/migrations/index.js.map +1 -0
- package/i18n/en.json +14 -0
- package/i18n/pl.json +14 -0
- package/package.json +102 -0
- package/tailwind.css +14 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
/**
|
|
3
|
+
* MFA module init (feature 042).
|
|
4
|
+
*
|
|
5
|
+
* Creates the four MFA-owned tables:
|
|
6
|
+
* - mfa_enrolments — per-account TOTP enrolment (encrypted secret)
|
|
7
|
+
* - mfa_recovery_codes — single-use backup codes (hashed)
|
|
8
|
+
* - mfa_social_identities — Google/Microsoft account links
|
|
9
|
+
* - mfa_organization_policies — per-organization enforcement flag
|
|
10
|
+
*
|
|
11
|
+
* The legacy scaffolding columns (`customer_accounts.two_factor_secret`,
|
|
12
|
+
* `admin_users.two_factor_secret`, …) are SUPERSEDED by `mfa_enrolments` and
|
|
13
|
+
* left dormant (research §R8). No encrypted backfill is performed in SQL: the
|
|
14
|
+
* secret cipher runs in application code, and the legacy columns hold no
|
|
15
|
+
* live, confirmed enrolments (the earlier 2FA path was never wired). Any
|
|
16
|
+
* pre-existing user simply re-enrols from the security screen.
|
|
17
|
+
*/
|
|
18
|
+
export declare class Migration20260611T140409MfaInit extends Migration {
|
|
19
|
+
up(): Promise<void>;
|
|
20
|
+
down(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=20260611T140409_mfa_init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20260611T140409_mfa_init.d.ts","sourceRoot":"","sources":["../../src/migrations/20260611T140409_mfa_init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,+BAAgC,SAAQ,SAAS;IAC7C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAwFnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAMrC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
/**
|
|
3
|
+
* MFA module init (feature 042).
|
|
4
|
+
*
|
|
5
|
+
* Creates the four MFA-owned tables:
|
|
6
|
+
* - mfa_enrolments — per-account TOTP enrolment (encrypted secret)
|
|
7
|
+
* - mfa_recovery_codes — single-use backup codes (hashed)
|
|
8
|
+
* - mfa_social_identities — Google/Microsoft account links
|
|
9
|
+
* - mfa_organization_policies — per-organization enforcement flag
|
|
10
|
+
*
|
|
11
|
+
* The legacy scaffolding columns (`customer_accounts.two_factor_secret`,
|
|
12
|
+
* `admin_users.two_factor_secret`, …) are SUPERSEDED by `mfa_enrolments` and
|
|
13
|
+
* left dormant (research §R8). No encrypted backfill is performed in SQL: the
|
|
14
|
+
* secret cipher runs in application code, and the legacy columns hold no
|
|
15
|
+
* live, confirmed enrolments (the earlier 2FA path was never wired). Any
|
|
16
|
+
* pre-existing user simply re-enrols from the security screen.
|
|
17
|
+
*/
|
|
18
|
+
export class Migration20260611T140409MfaInit extends Migration {
|
|
19
|
+
async up() {
|
|
20
|
+
// --- mfa_enrolments -----------------------------------------------------
|
|
21
|
+
this.addSql(`
|
|
22
|
+
create table "mfa_enrolments" (
|
|
23
|
+
"id" uuid not null,
|
|
24
|
+
"subject_type" varchar(16) not null,
|
|
25
|
+
"subject_id" uuid not null,
|
|
26
|
+
"status" varchar(16) not null default 'pending',
|
|
27
|
+
"secret_ciphertext" bytea not null,
|
|
28
|
+
"secret_iv" bytea not null,
|
|
29
|
+
"secret_auth_tag" bytea not null,
|
|
30
|
+
"last_accepted_step" bigint null,
|
|
31
|
+
"confirmed_at" timestamptz null,
|
|
32
|
+
"created_at" timestamptz not null,
|
|
33
|
+
"updated_at" timestamptz not null,
|
|
34
|
+
constraint "mfa_enrolments_pkey" primary key ("id")
|
|
35
|
+
);
|
|
36
|
+
`);
|
|
37
|
+
this.addSql(`create index "mfa_enrolments_subject_type_index" on "mfa_enrolments" ("subject_type");`);
|
|
38
|
+
this.addSql(`create index "mfa_enrolments_subject_id_index" on "mfa_enrolments" ("subject_id");`);
|
|
39
|
+
// At most one active enrolment per subject.
|
|
40
|
+
this.addSql(`create unique index "mfa_enrolments_active_subject_unique" on "mfa_enrolments" ("subject_type", "subject_id") where "status" = 'active';`);
|
|
41
|
+
// --- mfa_recovery_codes -------------------------------------------------
|
|
42
|
+
this.addSql(`
|
|
43
|
+
create table "mfa_recovery_codes" (
|
|
44
|
+
"id" uuid not null,
|
|
45
|
+
"enrolment_id" uuid not null,
|
|
46
|
+
"code_hash" varchar(128) not null,
|
|
47
|
+
"used_at" timestamptz null,
|
|
48
|
+
"created_at" timestamptz not null,
|
|
49
|
+
constraint "mfa_recovery_codes_pkey" primary key ("id"),
|
|
50
|
+
constraint "mfa_recovery_codes_enrolment_fk" foreign key ("enrolment_id")
|
|
51
|
+
references "mfa_enrolments" ("id") on delete cascade
|
|
52
|
+
);
|
|
53
|
+
`);
|
|
54
|
+
this.addSql(`create index "mfa_recovery_codes_enrolment_id_index" on "mfa_recovery_codes" ("enrolment_id");`);
|
|
55
|
+
this.addSql(`create unique index "mfa_recovery_codes_enrolment_hash_unique" on "mfa_recovery_codes" ("enrolment_id", "code_hash");`);
|
|
56
|
+
// --- mfa_social_identities ----------------------------------------------
|
|
57
|
+
this.addSql(`
|
|
58
|
+
create table "mfa_social_identities" (
|
|
59
|
+
"id" uuid not null,
|
|
60
|
+
"subject_type" varchar(16) not null,
|
|
61
|
+
"subject_id" uuid not null,
|
|
62
|
+
"provider" varchar(16) not null,
|
|
63
|
+
"provider_subject" varchar(255) not null,
|
|
64
|
+
"email" varchar(320) not null,
|
|
65
|
+
"linked_at" timestamptz not null,
|
|
66
|
+
"last_used_at" timestamptz null,
|
|
67
|
+
constraint "mfa_social_identities_pkey" primary key ("id")
|
|
68
|
+
);
|
|
69
|
+
`);
|
|
70
|
+
this.addSql(`create unique index "mfa_social_identities_provider_subject_unique" on "mfa_social_identities" ("provider", "provider_subject");`);
|
|
71
|
+
this.addSql(`create unique index "mfa_social_identities_subject_provider_unique" on "mfa_social_identities" ("subject_type", "subject_id", "provider");`);
|
|
72
|
+
this.addSql(`create index "mfa_social_identities_provider_email_index" on "mfa_social_identities" ("provider", "email");`);
|
|
73
|
+
// --- mfa_organization_policies ------------------------------------------
|
|
74
|
+
this.addSql(`
|
|
75
|
+
create table "mfa_organization_policies" (
|
|
76
|
+
"id" uuid not null,
|
|
77
|
+
"organization_id" uuid not null,
|
|
78
|
+
"enforce_totp" boolean not null default false,
|
|
79
|
+
"updated_by_actor" varchar(64) null,
|
|
80
|
+
"created_at" timestamptz not null,
|
|
81
|
+
"updated_at" timestamptz not null,
|
|
82
|
+
constraint "mfa_organization_policies_pkey" primary key ("id"),
|
|
83
|
+
constraint "mfa_organization_policies_org_unique" unique ("organization_id")
|
|
84
|
+
);
|
|
85
|
+
`);
|
|
86
|
+
}
|
|
87
|
+
async down() {
|
|
88
|
+
this.addSql(`drop table if exists "mfa_organization_policies";`);
|
|
89
|
+
this.addSql(`drop table if exists "mfa_social_identities";`);
|
|
90
|
+
this.addSql(`drop table if exists "mfa_recovery_codes";`);
|
|
91
|
+
this.addSql(`drop table if exists "mfa_enrolments";`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=20260611T140409_mfa_init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20260611T140409_mfa_init.js","sourceRoot":"","sources":["../../src/migrations/20260611T140409_mfa_init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,+BAAgC,SAAQ,SAAS;IACnD,KAAK,CAAC,EAAE;QACf,2EAA2E;QAC3E,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;KAeX,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CACT,wFAAwF,CACzF,CAAC;QACF,IAAI,CAAC,MAAM,CACT,oFAAoF,CACrF,CAAC;QACF,4CAA4C;QAC5C,IAAI,CAAC,MAAM,CACT,0IAA0I,CAC3I,CAAC;QAEF,2EAA2E;QAC3E,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;KAWX,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CACT,gGAAgG,CACjG,CAAC;QACF,IAAI,CAAC,MAAM,CACT,uHAAuH,CACxH,CAAC;QAEF,2EAA2E;QAC3E,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;KAYX,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CACT,kIAAkI,CACnI,CAAC;QACF,IAAI,CAAC,MAAM,CACT,4IAA4I,CAC7I,CAAC;QACF,IAAI,CAAC,MAAM,CACT,6GAA6G,CAC9G,CAAC;QAEF,2EAA2E;QAC3E,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;KAWX,CAAC,CAAC;IACL,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,mDAAmD,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,+CAA+C,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,CAAC,4CAA4C,CAAC,CAAC;QAC1D,IAAI,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `./migrations` subpath — every migration class this module owns, as one
|
|
3
|
+
* ordered `migrations` array.
|
|
4
|
+
*
|
|
5
|
+
* The array is what the platform reads when this module is **installed**:
|
|
6
|
+
* `src/packages/package-runtime.ts` takes `exported['migrations']` and refuses
|
|
7
|
+
* the package outright when it is absent (D-168).
|
|
8
|
+
*
|
|
9
|
+
* Listed in ascending timestamp, which is the order of this module's own
|
|
10
|
+
* migrations and of nothing else (feature 081): a manifest `dependencies` array
|
|
11
|
+
* is the only thing ordering this block against another module's.
|
|
12
|
+
*
|
|
13
|
+
* The **named** exports stay beside the array, and the asymmetry with
|
|
14
|
+
* `./backend` — which publishes an array and no named class (D-168) — is
|
|
15
|
+
* deliberate. `db/migrations-registry.generated.ts` imports each class by name
|
|
16
|
+
* from this specifier, and a migration class name is contract in a way an entity
|
|
17
|
+
* class name is not: `mikro_orm_migrations` persists it, so it is a string every
|
|
18
|
+
* already-migrated database holds.
|
|
19
|
+
*
|
|
20
|
+
* A class that is in neither the array nor the barrel is a migration that does
|
|
21
|
+
* not run: `migration:pending` reports nothing pending and the first symptom is
|
|
22
|
+
* a query against a table nobody created.
|
|
23
|
+
*/
|
|
24
|
+
import { Migration20260611T140409MfaInit } from './20260611T140409_mfa_init.js';
|
|
25
|
+
export declare const migrations: (typeof Migration20260611T140409MfaInit)[];
|
|
26
|
+
export { Migration20260611T140409MfaInit, };
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,eAAO,MAAM,UAAU,4CAEtB,CAAC;AAEF,OAAO,EACL,+BAA+B,GAChC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `./migrations` subpath — every migration class this module owns, as one
|
|
3
|
+
* ordered `migrations` array.
|
|
4
|
+
*
|
|
5
|
+
* The array is what the platform reads when this module is **installed**:
|
|
6
|
+
* `src/packages/package-runtime.ts` takes `exported['migrations']` and refuses
|
|
7
|
+
* the package outright when it is absent (D-168).
|
|
8
|
+
*
|
|
9
|
+
* Listed in ascending timestamp, which is the order of this module's own
|
|
10
|
+
* migrations and of nothing else (feature 081): a manifest `dependencies` array
|
|
11
|
+
* is the only thing ordering this block against another module's.
|
|
12
|
+
*
|
|
13
|
+
* The **named** exports stay beside the array, and the asymmetry with
|
|
14
|
+
* `./backend` — which publishes an array and no named class (D-168) — is
|
|
15
|
+
* deliberate. `db/migrations-registry.generated.ts` imports each class by name
|
|
16
|
+
* from this specifier, and a migration class name is contract in a way an entity
|
|
17
|
+
* class name is not: `mikro_orm_migrations` persists it, so it is a string every
|
|
18
|
+
* already-migrated database holds.
|
|
19
|
+
*
|
|
20
|
+
* A class that is in neither the array nor the barrel is a migration that does
|
|
21
|
+
* not run: `migration:pending` reports nothing pending and the first symptom is
|
|
22
|
+
* a query against a table nobody created.
|
|
23
|
+
*/
|
|
24
|
+
import { Migration20260611T140409MfaInit } from './20260611T140409_mfa_init.js';
|
|
25
|
+
export const migrations = [
|
|
26
|
+
Migration20260611T140409MfaInit,
|
|
27
|
+
];
|
|
28
|
+
export { Migration20260611T140409MfaInit, };
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,+BAA+B;CAChC,CAAC;AAEF,OAAO,EACL,+BAA+B,GAChC,CAAC"}
|
package/i18n/en.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"adminRoles.permission.mfa:reset": "Reset a user's 2FA",
|
|
3
|
+
"adminRoles.permission.mfa:manage": "Manage 2FA policies and organization enforcement",
|
|
4
|
+
"errors.MFA_SOCIAL_LAST_CREDENTIAL": "This is the last sign-in identity linked to the account, and the account has no password on record — removing it could lock its holder out for good. Set a password for the account first, then this link can be removed.",
|
|
5
|
+
"errors.MFA_ALREADY_ENROLLED": "Two-factor authentication is already set up on this account, so there is nothing left to configure. To move it to a different authenticator app, switch it off first and then set it up again.",
|
|
6
|
+
"errors.MFA_INVALID_CHALLENGE": "This sign-in step is no longer valid — it has expired, or it was already finished. Sign in again to start a new one.",
|
|
7
|
+
"errors.MFA_INVALID_CODE": "That code was not accepted. A code from your authenticator app is only valid for about half a minute, so wait for the next one and enter it without spaces; a recovery code can be used only once.",
|
|
8
|
+
"errors.MFA_NOT_ENABLED": "Two-factor authentication is not available here, so it cannot be switched on for this account. Your administrator decides where it can be used — ask them to enable it.",
|
|
9
|
+
"errors.MFA_NO_ACTIVE_ENROLMENT": "Two-factor authentication is not switched on for this account, so there are no recovery codes to reissue. Set it up first — the codes are handed to you at the end of setup.",
|
|
10
|
+
"errors.MFA_NO_PENDING_ENROLMENT": "There is no setup waiting to be confirmed — it was either finished already, or started again somewhere else. Begin the setup again and scan the new QR code before entering a code.",
|
|
11
|
+
"errors.MFA_REAUTH_REQUIRED": "Switching two-factor authentication off has to be confirmed by you. Enter a current code from your authenticator app, or the password for this account.",
|
|
12
|
+
"errors.MFA_TOO_MANY_ATTEMPTS": "Too many incorrect codes were entered, so this sign-in attempt was stopped. Sign in again and use the next code straight from your authenticator app, or one of your recovery codes.",
|
|
13
|
+
"errors.MFA_WRONG_SURFACE": "This sign-in was started somewhere else, so the code cannot be confirmed here. Go back to the page you were signing in on and enter it there."
|
|
14
|
+
}
|
package/i18n/pl.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"adminRoles.permission.mfa:reset": "Resetowanie 2FA użytkownika",
|
|
3
|
+
"adminRoles.permission.mfa:manage": "Zarządzanie politykami 2FA i wymuszaniem w Organizacji",
|
|
4
|
+
"errors.MFA_SOCIAL_LAST_CREDENTIAL": "To ostatnia tożsamość logowania powiązana z kontem, a konto nie ma zapisanego hasła — usunięcie jej mogłoby trwale odciąć dostęp do konta. Najpierw ustaw hasło do konta, a potem to powiązanie będzie można usunąć.",
|
|
5
|
+
"errors.MFA_ALREADY_ENROLLED": "Uwierzytelnianie dwuskładnikowe jest już skonfigurowane na tym koncie i nie ma nic więcej do ustawienia. Aby przenieść je do innej aplikacji uwierzytelniającej, najpierw je wyłącz, a potem skonfiguruj od nowa.",
|
|
6
|
+
"errors.MFA_INVALID_CHALLENGE": "Ten krok logowania nie jest już ważny — wygasł albo został już zakończony. Zaloguj się ponownie, aby rozpocząć nowy.",
|
|
7
|
+
"errors.MFA_INVALID_CODE": "Ten kod nie został przyjęty. Kod z aplikacji uwierzytelniającej jest ważny tylko przez około pół minuty, więc poczekaj na kolejny i wpisz go bez spacji; kodu odzyskiwania można użyć tylko raz.",
|
|
8
|
+
"errors.MFA_NOT_ENABLED": "Uwierzytelnianie dwuskładnikowe nie jest tu dostępne, więc nie można go włączyć na tym koncie. O tym, gdzie można z niego korzystać, decyduje administrator — poproś go o włączenie tej opcji.",
|
|
9
|
+
"errors.MFA_NO_ACTIVE_ENROLMENT": "Uwierzytelnianie dwuskładnikowe nie jest włączone na tym koncie, więc nie ma kodów odzyskiwania do wygenerowania na nowo. Najpierw je skonfiguruj — kody otrzymasz na końcu konfiguracji.",
|
|
10
|
+
"errors.MFA_NO_PENDING_ENROLMENT": "Nie ma konfiguracji czekającej na potwierdzenie — została już zakończona albo rozpoczęta na nowo w innym miejscu. Rozpocznij konfigurację jeszcze raz i zeskanuj nowy kod QR, zanim wpiszesz kod.",
|
|
11
|
+
"errors.MFA_REAUTH_REQUIRED": "Wyłączenie uwierzytelniania dwuskładnikowego musi zostać przez Ciebie potwierdzone. Podaj aktualny kod z aplikacji uwierzytelniającej albo hasło do tego konta.",
|
|
12
|
+
"errors.MFA_TOO_MANY_ATTEMPTS": "Wpisano zbyt wiele błędnych kodów, więc ta próba logowania została przerwana. Zaloguj się ponownie i użyj kolejnego kodu prosto z aplikacji uwierzytelniającej albo jednego z kodów odzyskiwania.",
|
|
13
|
+
"errors.MFA_WRONG_SURFACE": "To logowanie zostało rozpoczęte w innym miejscu, więc tego kodu nie można tu potwierdzić. Wróć na stronę, na której rozpoczęło się logowanie, i wpisz kod tam."
|
|
14
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@endora-commerce/mod-mfa",
|
|
3
|
+
"version": "0.100.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"description": "Two-factor authentication (TOTP + recovery codes) and Google/Microsoft sign-in, with per-scope enablement/enforcement and admin reset.",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"endora": {
|
|
9
|
+
"type": "module",
|
|
10
|
+
"id": "mfa"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/endora-commerce/endora-commerce.git",
|
|
15
|
+
"directory": "packages/modules/mfa"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/manifest.d.ts",
|
|
23
|
+
"default": "./dist/manifest.js"
|
|
24
|
+
},
|
|
25
|
+
"./backend": {
|
|
26
|
+
"types": "./dist/backend/index.d.ts",
|
|
27
|
+
"default": "./dist/backend/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./migrations": {
|
|
30
|
+
"types": "./dist/migrations/index.d.ts",
|
|
31
|
+
"default": "./dist/migrations/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./admin": {
|
|
34
|
+
"types": "./dist/admin/index.d.ts",
|
|
35
|
+
"default": "./dist/admin/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./tailwind.css": "./tailwind.css",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"i18n",
|
|
43
|
+
"tailwind.css"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=22.18.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@fastify/cookie": "^11",
|
|
50
|
+
"@mikro-orm/core": "^6",
|
|
51
|
+
"@mikro-orm/migrations": "^6",
|
|
52
|
+
"@mikro-orm/postgresql": "^6",
|
|
53
|
+
"fastify": "^5",
|
|
54
|
+
"ioredis": "^5",
|
|
55
|
+
"lucide-react": "^1",
|
|
56
|
+
"openid-client": "^6",
|
|
57
|
+
"otpauth": "^9",
|
|
58
|
+
"react": "^19",
|
|
59
|
+
"zod": "^4",
|
|
60
|
+
"@endora-commerce/admin-kit": "0.100.0",
|
|
61
|
+
"@endora-commerce/contracts": "0.100.0",
|
|
62
|
+
"@endora-commerce/platform": "0.100.0"
|
|
63
|
+
},
|
|
64
|
+
"peerDependenciesMeta": {
|
|
65
|
+
"@endora-commerce/admin-kit": {
|
|
66
|
+
"optional": true
|
|
67
|
+
},
|
|
68
|
+
"lucide-react": {
|
|
69
|
+
"optional": true
|
|
70
|
+
},
|
|
71
|
+
"react": {
|
|
72
|
+
"optional": true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@fastify/cookie": "^11.0.2",
|
|
77
|
+
"@fastify/type-provider-zod": "^1.0.0",
|
|
78
|
+
"@mikro-orm/core": "^6.6.13",
|
|
79
|
+
"@mikro-orm/migrations": "^6.6.13",
|
|
80
|
+
"@mikro-orm/postgresql": "^6.6.13",
|
|
81
|
+
"@types/node": "^22.9.0",
|
|
82
|
+
"@types/react": "^19.2.14",
|
|
83
|
+
"fastify": "^5.12.5",
|
|
84
|
+
"ioredis": "^5.10.1",
|
|
85
|
+
"lucide-react": "^1.11.0",
|
|
86
|
+
"openid-client": "^6.8.4",
|
|
87
|
+
"otpauth": "^9.5.0",
|
|
88
|
+
"react": "^19.2.5",
|
|
89
|
+
"typescript": "^5.9.3",
|
|
90
|
+
"vitest": "^4.1.11",
|
|
91
|
+
"zod": "^4.2.0",
|
|
92
|
+
"@endora-commerce/admin-kit": "0.100.0",
|
|
93
|
+
"@endora-commerce/platform": "0.100.0",
|
|
94
|
+
"@endora-commerce/contracts": "0.100.0"
|
|
95
|
+
},
|
|
96
|
+
"scripts": {
|
|
97
|
+
"build": "tsc -p tsconfig.build.json && tsc -p tsconfig.ui.json",
|
|
98
|
+
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.ui.json --noEmit",
|
|
99
|
+
"lint": "eslint src",
|
|
100
|
+
"test": "vitest run"
|
|
101
|
+
}
|
|
102
|
+
}
|
package/tailwind.css
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* @endora-commerce/mod-mfa — AUTO-GENERATED by `pnpm --filter backend run manifests:generate`.
|
|
2
|
+
*
|
|
3
|
+
* The `@source` directives this package asks its host to scan
|
|
4
|
+
* (`specs/110-instance-repository/contracts/admin-stylesheet-composition.md` R1).
|
|
5
|
+
* They resolve relative to **this file**, so they hold wherever the package is
|
|
6
|
+
* installed — a workspace link here, `node_modules` in a client's instance.
|
|
7
|
+
*
|
|
8
|
+
* The `dist` line is what a published tarball ships and is what an instance
|
|
9
|
+
* scans; the `src` line is inert there and is what keeps `pnpm --filter admin
|
|
10
|
+
* run dev` reading source in this repository. Do not edit: run
|
|
11
|
+
* `pnpm --filter backend run manifests:generate`.
|
|
12
|
+
*/
|
|
13
|
+
@source "./dist/admin";
|
|
14
|
+
@source "./src/admin";
|