@proconnect-gouv/proconnect.identite.runtime 0.6.0 → 0.6.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/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/src/domains/change-email-domain-verification.test.ts +2 -2
- package/src/franceconnect/connect-franceconnect.test.ts +4 -4
- package/src/franceconnect/disconnect-franceconnect.test.ts +4 -4
- package/src/memberships/add-membership.test.ts +4 -4
- package/src/memberships/remove-membership.test.ts +4 -4
- package/src/memberships/update-membership.test.ts +6 -6
- package/src/moderations/open-moderation.test.ts +2 -2
- package/src/runtime/create-identite-runtime.test.ts +0 -39
- package/src/users/change-password.test.ts +2 -2
- package/src/users/delete-user.test.ts +4 -4
- package/src/users/reset-mfa.test.ts +5 -5
- package/src/users/update-personal-informations.test.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @proconnect-gouv/proconnect.identite.runtime
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`b214548`](https://github.com/proconnect-gouv/proconnect-identite/commit/b214548ebe9fbcf93cff73053502fcb3e2643ab5)]:
|
|
8
|
+
- @proconnect-gouv/proconnect.identite.database@3.0.0
|
|
9
|
+
|
|
3
10
|
## 0.6.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proconnect-gouv/proconnect.identite.runtime",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"homepage": "https://github.com/proconnect-gouv/proconnect-identite/tree/main/packages/runtime#readme",
|
|
5
5
|
"bugs": "https://github.com/proconnect-gouv/proconnect-identite/issues",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@proconnect-gouv/proconnect.identite": "^16.0.0",
|
|
36
|
-
"@proconnect-gouv/proconnect.identite.database": "^
|
|
36
|
+
"@proconnect-gouv/proconnect.identite.database": "^3.0.0",
|
|
37
37
|
"zod": "^4.6.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -23,10 +23,10 @@ async function setup() {
|
|
|
23
23
|
"luther+kept-dirigeant@darkangels.world",
|
|
24
24
|
"leman.russ+kept-other-domain@spacewolves.world",
|
|
25
25
|
].map((email, index) => ({
|
|
26
|
-
created_at: "4444-04-04",
|
|
26
|
+
created_at: new Date("4444-04-04"),
|
|
27
27
|
email,
|
|
28
28
|
id: index + 1,
|
|
29
|
-
updated_at: "4444-04-04",
|
|
29
|
+
updated_at: new Date("4444-04-04"),
|
|
30
30
|
})),
|
|
31
31
|
);
|
|
32
32
|
await db.insert(schema.users_organizations).values(
|
|
@@ -26,20 +26,20 @@ async function setup() {
|
|
|
26
26
|
|
|
27
27
|
await db.insert(schema.users).values([
|
|
28
28
|
{
|
|
29
|
-
created_at: "4444-04-04",
|
|
29
|
+
created_at: new Date("4444-04-04"),
|
|
30
30
|
email: "jean.valjean@republic.fr",
|
|
31
31
|
family_name: "Fauchelevent",
|
|
32
32
|
given_name: "Jeannot",
|
|
33
33
|
id: 1,
|
|
34
|
-
updated_at: "4444-04-04",
|
|
34
|
+
updated_at: new Date("4444-04-04"),
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
created_at: "4444-04-04",
|
|
37
|
+
created_at: new Date("4444-04-04"),
|
|
38
38
|
email: "cosette@republic.fr",
|
|
39
39
|
family_name: "Fauchelevent",
|
|
40
40
|
given_name: "Cosette",
|
|
41
41
|
id: 2,
|
|
42
|
-
updated_at: "4444-04-04",
|
|
42
|
+
updated_at: new Date("4444-04-04"),
|
|
43
43
|
},
|
|
44
44
|
]);
|
|
45
45
|
|
|
@@ -14,16 +14,16 @@ async function setup() {
|
|
|
14
14
|
|
|
15
15
|
await db.insert(schema.users).values([
|
|
16
16
|
{
|
|
17
|
-
created_at: "4444-04-04",
|
|
17
|
+
created_at: new Date("4444-04-04"),
|
|
18
18
|
email: "jean.valjean@republic.fr",
|
|
19
19
|
id: 1,
|
|
20
|
-
updated_at: "4444-04-04",
|
|
20
|
+
updated_at: new Date("4444-04-04"),
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
created_at: "4444-04-04",
|
|
23
|
+
created_at: new Date("4444-04-04"),
|
|
24
24
|
email: "cosette@republic.fr",
|
|
25
25
|
id: 2,
|
|
26
|
-
updated_at: "4444-04-04",
|
|
26
|
+
updated_at: new Date("4444-04-04"),
|
|
27
27
|
},
|
|
28
28
|
]);
|
|
29
29
|
await db.insert(schema.franceconnect_userinfo).values({
|
|
@@ -14,16 +14,16 @@ async function setup() {
|
|
|
14
14
|
await db.insert(schema.organizations).values({ id: 1, siret: "🦁" });
|
|
15
15
|
await db.insert(schema.users).values([
|
|
16
16
|
{
|
|
17
|
-
created_at: "4444-04-04",
|
|
17
|
+
created_at: new Date("4444-04-04"),
|
|
18
18
|
email: "jean.valjean@republic.fr",
|
|
19
19
|
id: 1,
|
|
20
|
-
updated_at: "4444-04-04",
|
|
20
|
+
updated_at: new Date("4444-04-04"),
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
created_at: "4444-04-04",
|
|
23
|
+
created_at: new Date("4444-04-04"),
|
|
24
24
|
email: "cosette@republic.fr",
|
|
25
25
|
id: 2,
|
|
26
|
-
updated_at: "4444-04-04",
|
|
26
|
+
updated_at: new Date("4444-04-04"),
|
|
27
27
|
},
|
|
28
28
|
]);
|
|
29
29
|
await db.insert(schema.users_organizations).values({
|
|
@@ -17,16 +17,16 @@ async function setup() {
|
|
|
17
17
|
]);
|
|
18
18
|
await db.insert(schema.users).values([
|
|
19
19
|
{
|
|
20
|
-
created_at: "4444-04-04",
|
|
20
|
+
created_at: new Date("4444-04-04"),
|
|
21
21
|
email: "lion.eljonson@darkangels.world",
|
|
22
22
|
id: 1,
|
|
23
|
-
updated_at: "4444-04-04",
|
|
23
|
+
updated_at: new Date("4444-04-04"),
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
created_at: "4444-04-04",
|
|
26
|
+
created_at: new Date("4444-04-04"),
|
|
27
27
|
email: "azrael@darkangels.world",
|
|
28
28
|
id: 2,
|
|
29
|
-
updated_at: "4444-04-04",
|
|
29
|
+
updated_at: new Date("4444-04-04"),
|
|
30
30
|
},
|
|
31
31
|
]);
|
|
32
32
|
await db.insert(schema.users_organizations).values([
|
|
@@ -14,22 +14,22 @@ async function setup() {
|
|
|
14
14
|
await db.insert(schema.organizations).values([{ id: 1, siret: "🦁" }]);
|
|
15
15
|
await db.insert(schema.users).values([
|
|
16
16
|
{
|
|
17
|
-
created_at: "4444-04-04",
|
|
17
|
+
created_at: new Date("4444-04-04"),
|
|
18
18
|
email: "lion.eljonson@darkangels.world",
|
|
19
19
|
id: 1,
|
|
20
|
-
updated_at: "4444-04-04",
|
|
20
|
+
updated_at: new Date("4444-04-04"),
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
created_at: "4444-04-04",
|
|
23
|
+
created_at: new Date("4444-04-04"),
|
|
24
24
|
email: "azrael@darkangels.world",
|
|
25
25
|
id: 2,
|
|
26
|
-
updated_at: "4444-04-04",
|
|
26
|
+
updated_at: new Date("4444-04-04"),
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
created_at: "4444-04-04",
|
|
29
|
+
created_at: new Date("4444-04-04"),
|
|
30
30
|
email: "sanguinius@darkangels.world",
|
|
31
31
|
id: 3,
|
|
32
|
-
updated_at: "4444-04-04",
|
|
32
|
+
updated_at: new Date("4444-04-04"),
|
|
33
33
|
},
|
|
34
34
|
]);
|
|
35
35
|
await db.insert(schema.users_organizations).values([
|
|
@@ -12,10 +12,10 @@ async function setup() {
|
|
|
12
12
|
const db = await createTestDatabase();
|
|
13
13
|
|
|
14
14
|
await db.insert(schema.users).values({
|
|
15
|
-
created_at: "4444-04-04",
|
|
15
|
+
created_at: new Date("4444-04-04"),
|
|
16
16
|
email: "jean.valjean@republic.fr",
|
|
17
17
|
id: 1,
|
|
18
|
-
updated_at: "4444-04-04",
|
|
18
|
+
updated_at: new Date("4444-04-04"),
|
|
19
19
|
});
|
|
20
20
|
await db.insert(schema.organizations).values({
|
|
21
21
|
created_at: "4444-04-04",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
|
|
3
3
|
import type { ContextsOf } from "#src/activity";
|
|
4
|
-
import type { IdentiteTransaction } from "#src/database";
|
|
5
4
|
import { createIdentiteRuntime } from "#src/runtime";
|
|
6
5
|
import { createTestDatabase, readActivityLogs } from "#testing";
|
|
7
6
|
import assert from "node:assert/strict";
|
|
@@ -68,42 +67,4 @@ describe("record", () => {
|
|
|
68
67
|
},
|
|
69
68
|
]);
|
|
70
69
|
});
|
|
71
|
-
|
|
72
|
-
it("🚫 does not compile another owner's action, a mismatched context, the bare database or an overlapping owner", async () => {
|
|
73
|
-
const { db } = await setup();
|
|
74
|
-
const { record } = createIdentiteRuntime<HyyypertoolActivityContexts>({
|
|
75
|
-
app: "hyyypertool",
|
|
76
|
-
db,
|
|
77
|
-
}).as({ type: "moderator", sub: "moderator" });
|
|
78
|
-
|
|
79
|
-
void ((tx: IdentiteTransaction) =>
|
|
80
|
-
record(tx, {
|
|
81
|
-
// @ts-expect-error domain.verified belongs to the runtime, only changeEmailDomainVerification writes it
|
|
82
|
-
action: "domain.verified",
|
|
83
|
-
context: darkangels_commented.context,
|
|
84
|
-
}));
|
|
85
|
-
|
|
86
|
-
void ((tx: IdentiteTransaction) =>
|
|
87
|
-
record(tx, {
|
|
88
|
-
action: "moderation.commented",
|
|
89
|
-
// @ts-expect-error the context does not match moderation.commented
|
|
90
|
-
context: { inputs: { comment: "darkangels.world" }, outcome: {} },
|
|
91
|
-
}));
|
|
92
|
-
|
|
93
|
-
void (() =>
|
|
94
|
-
// @ts-expect-error the bare database is not a transaction
|
|
95
|
-
record(db, darkangels_commented));
|
|
96
|
-
|
|
97
|
-
type OverlappingContexts = {
|
|
98
|
-
"domain.verified": HyyypertoolActivityContexts["moderation.commented"];
|
|
99
|
-
};
|
|
100
|
-
// @ts-expect-error domain.verified is already defined by the runtime
|
|
101
|
-
void createIdentiteRuntime<OverlappingContexts>({ app: "hyyypertool", db });
|
|
102
|
-
|
|
103
|
-
void ((tx: IdentiteTransaction) =>
|
|
104
|
-
createIdentiteRuntime({ app: "proconnect-identite", db })
|
|
105
|
-
.as({ type: "app", job: "join.official_contact" })
|
|
106
|
-
// @ts-expect-error proconnect-identite has no app-only action to record
|
|
107
|
-
.record(tx, darkangels_commented));
|
|
108
|
-
});
|
|
109
70
|
});
|
|
@@ -11,11 +11,11 @@ import { describe, it } from "node:test";
|
|
|
11
11
|
async function setup() {
|
|
12
12
|
const db = await createTestDatabase();
|
|
13
13
|
await db.insert(schema.users).values({
|
|
14
|
-
created_at: "4444-04-04",
|
|
14
|
+
created_at: new Date("4444-04-04"),
|
|
15
15
|
email: "jean.valjean@republic.fr",
|
|
16
16
|
id: 1,
|
|
17
17
|
reset_password_token: "token",
|
|
18
|
-
updated_at: "4444-04-04",
|
|
18
|
+
updated_at: new Date("4444-04-04"),
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
return {
|
|
@@ -14,18 +14,18 @@ async function setup() {
|
|
|
14
14
|
|
|
15
15
|
await db.insert(schema.users).values([
|
|
16
16
|
{
|
|
17
|
-
created_at: "4444-04-04",
|
|
17
|
+
created_at: new Date("4444-04-04"),
|
|
18
18
|
email: "jean.valjean@republic.fr",
|
|
19
19
|
family_name: "Valjean",
|
|
20
20
|
given_name: "Jean",
|
|
21
21
|
id: 1,
|
|
22
|
-
updated_at: "4444-04-04",
|
|
22
|
+
updated_at: new Date("4444-04-04"),
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
created_at: "4444-04-04",
|
|
25
|
+
created_at: new Date("4444-04-04"),
|
|
26
26
|
email: "cosette@republic.fr",
|
|
27
27
|
id: 2,
|
|
28
|
-
updated_at: "4444-04-04",
|
|
28
|
+
updated_at: new Date("4444-04-04"),
|
|
29
29
|
},
|
|
30
30
|
]);
|
|
31
31
|
await db.insert(schema.organizations).values([
|
|
@@ -14,21 +14,21 @@ async function setup() {
|
|
|
14
14
|
|
|
15
15
|
await db.insert(schema.users).values([
|
|
16
16
|
{
|
|
17
|
-
created_at: "4444-04-04",
|
|
17
|
+
created_at: new Date("4444-04-04"),
|
|
18
18
|
email: "jean.valjean@republic.fr",
|
|
19
19
|
email_verified: true,
|
|
20
20
|
encrypted_password: "🔑",
|
|
21
21
|
encrypted_totp_key: "🔐",
|
|
22
22
|
force_2fa: true,
|
|
23
23
|
id: 1,
|
|
24
|
-
totp_key_verified_at: "4444-04-04",
|
|
25
|
-
updated_at: "4444-04-04",
|
|
24
|
+
totp_key_verified_at: new Date("4444-04-04"),
|
|
25
|
+
updated_at: new Date("4444-04-04"),
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
created_at: "4444-04-04",
|
|
28
|
+
created_at: new Date("4444-04-04"),
|
|
29
29
|
email: "cosette@republic.fr",
|
|
30
30
|
id: 2,
|
|
31
|
-
updated_at: "4444-04-04",
|
|
31
|
+
updated_at: new Date("4444-04-04"),
|
|
32
32
|
},
|
|
33
33
|
]);
|
|
34
34
|
await db.insert(schema.authenticators).values([
|
|
@@ -11,10 +11,10 @@ import { describe, it } from "node:test";
|
|
|
11
11
|
async function setup() {
|
|
12
12
|
const db = await createTestDatabase();
|
|
13
13
|
await db.insert(schema.users).values({
|
|
14
|
-
created_at: "4444-04-04",
|
|
14
|
+
created_at: new Date("4444-04-04"),
|
|
15
15
|
email: "jean.valjean@republic.fr",
|
|
16
16
|
id: 1,
|
|
17
|
-
updated_at: "4444-04-04",
|
|
17
|
+
updated_at: new Date("4444-04-04"),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
return {
|