@agimon-ai/po-identity 0.0.2-alpha.90 → 0.0.2-alpha.92
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
let _agimon_ai_po_core = require("@agimon-ai/po-core");
|
|
1
2
|
//#region src/services/identityHome/globalTier.ts
|
|
2
3
|
var GlobalTierRefusal = class extends Error {
|
|
3
4
|
status;
|
|
@@ -28,6 +29,13 @@ function createGlobalTier(database, now, membership) {
|
|
|
28
29
|
}
|
|
29
30
|
async function writeMemberSettings(subject, org, yaml, expectedHash) {
|
|
30
31
|
if (new TextEncoder().encode(yaml).byteLength > 16384) throw new GlobalTierRefusal(413, "Settings too large");
|
|
32
|
+
let rejected;
|
|
33
|
+
try {
|
|
34
|
+
rejected = (0, _agimon_ai_po_core.nonPortableConfigYaml)(yaml);
|
|
35
|
+
} catch {
|
|
36
|
+
throw new GlobalTierRefusal(400, "Invalid settings");
|
|
37
|
+
}
|
|
38
|
+
if (rejected.length > 0) throw new GlobalTierRefusal(400, `Not portable: ${rejected.join(", ")}`);
|
|
31
39
|
const hash = await settingsHash(yaml);
|
|
32
40
|
const empty = await settingsHash("");
|
|
33
41
|
return database.transaction(async (tx) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nonPortableConfigYaml } from "@agimon-ai/po-core";
|
|
1
2
|
//#region src/services/identityHome/globalTier.ts
|
|
2
3
|
var GlobalTierRefusal = class extends Error {
|
|
3
4
|
status;
|
|
@@ -28,6 +29,13 @@ function createGlobalTier(database, now, membership) {
|
|
|
28
29
|
}
|
|
29
30
|
async function writeMemberSettings(subject, org, yaml, expectedHash) {
|
|
30
31
|
if (new TextEncoder().encode(yaml).byteLength > 16384) throw new GlobalTierRefusal(413, "Settings too large");
|
|
32
|
+
let rejected;
|
|
33
|
+
try {
|
|
34
|
+
rejected = nonPortableConfigYaml(yaml);
|
|
35
|
+
} catch {
|
|
36
|
+
throw new GlobalTierRefusal(400, "Invalid settings");
|
|
37
|
+
}
|
|
38
|
+
if (rejected.length > 0) throw new GlobalTierRefusal(400, `Not portable: ${rejected.join(", ")}`);
|
|
31
39
|
const hash = await settingsHash(yaml);
|
|
32
40
|
const empty = await settingsHash("");
|
|
33
41
|
return database.transaction(async (tx) => {
|
|
@@ -1300,6 +1300,7 @@ async function createIdentityHome(config, ports) {
|
|
|
1300
1300
|
database,
|
|
1301
1301
|
...roster,
|
|
1302
1302
|
memberRosterView: globalTier.memberRosterView,
|
|
1303
|
+
readMemberSettings: globalTier.readMemberSettings,
|
|
1303
1304
|
fetch: fetchHandler,
|
|
1304
1305
|
personalOrg,
|
|
1305
1306
|
ensurePersonalOrg,
|
|
@@ -78,6 +78,15 @@ export declare function createIdentityHome(config: IdentityHomeConfig, ports: Id
|
|
|
78
78
|
removalReceiptFromHost: (request: Request) => Promise<FederationEnvelope<"po/hub-removal-receipt/v1">>;
|
|
79
79
|
database: import("@earendil-works/chord/sqlite").SqliteDatabase;
|
|
80
80
|
memberRosterView: (subject: string, org: string, snapshot: import("@agimon-ai/po-web-security").SignedFederationEnvelope<import("@agimon-ai/po-core").FederationRoster, "po/roster/v1">) => Promise<MemberRosterView>;
|
|
81
|
+
readMemberSettings: (subject: string, org: string) => Promise<{
|
|
82
|
+
yaml: string;
|
|
83
|
+
hash: string;
|
|
84
|
+
updatedAt: number;
|
|
85
|
+
} | {
|
|
86
|
+
yaml: string;
|
|
87
|
+
hash: string;
|
|
88
|
+
updatedAt: null;
|
|
89
|
+
}>;
|
|
81
90
|
fetch: (request: Request) => Promise<Response>;
|
|
82
91
|
personalOrg: (subject: string) => Promise<string>;
|
|
83
92
|
ensurePersonalOrg: (subject: string, trigger: PersonalOrgTrigger) => Promise<IdentityWorkspaceAllocation>;
|
|
@@ -1300,6 +1300,7 @@ async function createIdentityHome(config, ports) {
|
|
|
1300
1300
|
database,
|
|
1301
1301
|
...roster,
|
|
1302
1302
|
memberRosterView: globalTier.memberRosterView,
|
|
1303
|
+
readMemberSettings: globalTier.readMemberSettings,
|
|
1303
1304
|
fetch: fetchHandler,
|
|
1304
1305
|
personalOrg,
|
|
1305
1306
|
ensurePersonalOrg,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-identity",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.92",
|
|
4
4
|
"description": "Portable identity home for Po",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
51
|
-
"@agimon-ai/po-web-security": "0.0.0-alpha.
|
|
50
|
+
"@agimon-ai/po-core": "0.0.0-alpha.145",
|
|
51
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.145",
|
|
52
52
|
"@better-auth/expo": "1.7.12",
|
|
53
53
|
"@better-auth/passkey": "1.7.12",
|
|
54
54
|
"@better-auth/sso": "1.7.12",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"jose": "6.2.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@agimon-ai/po-network": "0.0.2-alpha.
|
|
62
|
-
"@agimon-ai/vibe-lint-plugin-po-core": "0.0.0-alpha.
|
|
61
|
+
"@agimon-ai/po-network": "0.0.2-alpha.92",
|
|
62
|
+
"@agimon-ai/vibe-lint-plugin-po-core": "0.0.0-alpha.145",
|
|
63
63
|
"@types/node": "26.4.1",
|
|
64
64
|
"tsdown": "0.23.0",
|
|
65
65
|
"typescript": "7.0.2",
|