@metalabel/dfos-web-relay 0.12.0 → 0.13.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.js +1 -24
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1062,27 +1062,6 @@ var hasPublicStandingAuth = async (contentId, action, store) => {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
return false;
|
|
1064
1064
|
};
|
|
1065
|
-
var derivePublicGrants = async (contentId, creatorDID, store) => {
|
|
1066
|
-
const resource = `chain:${contentId}`;
|
|
1067
|
-
const publicCreds = await store.getPublicCredentials(resource);
|
|
1068
|
-
if (publicCreds.length === 0) return [];
|
|
1069
|
-
const resolveIdentity = createHistoricalIdentityResolver(store);
|
|
1070
|
-
const isRevoked = async (issuerDID, credentialCID) => store.isCredentialRevoked(issuerDID, credentialCID);
|
|
1071
|
-
const grants = [];
|
|
1072
|
-
for (const credJws of publicCreds) {
|
|
1073
|
-
try {
|
|
1074
|
-
const cred = await verifyDFOSCredential2(credJws, { resolveIdentity });
|
|
1075
|
-
if (await isRevoked(cred.iss, cred.credentialCID)) continue;
|
|
1076
|
-
if (!await matchesResource(cred.att, resource, "read")) continue;
|
|
1077
|
-
await verifyDelegationChain(cred, { resolveIdentity, rootDID: creatorDID, isRevoked });
|
|
1078
|
-
grants.push(credJws);
|
|
1079
|
-
} catch {
|
|
1080
|
-
continue;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
grants.sort();
|
|
1084
|
-
return grants;
|
|
1085
|
-
};
|
|
1086
1065
|
var verifyContentAccess = async (options) => {
|
|
1087
1066
|
const { credentialJWS, requestedResource, action, store, creatorDID, requesterDID } = options;
|
|
1088
1067
|
if (requesterDID && requesterDID === creatorDID) {
|
|
@@ -1265,7 +1244,6 @@ var createRelay = async (options) => {
|
|
|
1265
1244
|
proof: true,
|
|
1266
1245
|
write: writeEnabled,
|
|
1267
1246
|
content: contentEnabled,
|
|
1268
|
-
documents: contentEnabled,
|
|
1269
1247
|
log: logEnabled
|
|
1270
1248
|
},
|
|
1271
1249
|
profile: profileArtifactJws
|
|
@@ -1427,8 +1405,7 @@ var createRelay = async (options) => {
|
|
|
1427
1405
|
contentId: chain.contentId,
|
|
1428
1406
|
genesisCID: chain.genesisCID,
|
|
1429
1407
|
headCID: chain.state.headCID,
|
|
1430
|
-
state: chain.state
|
|
1431
|
-
publicGrants: await derivePublicGrants(contentId, chain.state.creatorDID, store)
|
|
1408
|
+
state: chain.state
|
|
1432
1409
|
});
|
|
1433
1410
|
});
|
|
1434
1411
|
app.get(`${PROOF_BASE_PATH}/countersignatures/:cid`, async (c) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metalabel/dfos-web-relay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DFOS Web Relay — verifying HTTP relay for identity chains, content chains, and content blobs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"zod": "^4.4.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@metalabel/dfos-protocol": "^0.
|
|
48
|
+
"@metalabel/dfos-protocol": "^0.13.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^24.10.4",
|
|
52
52
|
"tsup": "^8.5.1",
|
|
53
53
|
"tsx": "^4.22.4",
|
|
54
54
|
"vitest": "^4.1.8",
|
|
55
|
-
"@metalabel/dfos-protocol": "0.
|
|
55
|
+
"@metalabel/dfos-protocol": "0.13.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsup",
|