edge-book 0.7.0 → 0.7.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/dist/edge-book.js +5 -1
- package/package.json +1 -1
package/dist/edge-book.js
CHANGED
|
@@ -966,9 +966,13 @@ var EdgeBookStore = class {
|
|
|
966
966
|
const object = await this.getObject(objectId);
|
|
967
967
|
if (object && object.from_agent === subjectAgentId) return true;
|
|
968
968
|
const grants = await this.grants();
|
|
969
|
-
|
|
969
|
+
const candidates = Object.values(grants).filter(
|
|
970
970
|
(grant) => grant.object_id === objectId && grant.subject_agent_id === subjectAgentId && grant.scopes.includes("object.read") && grant.status === "active" && (!grant.expires_at || Date.parse(grant.expires_at) > at)
|
|
971
971
|
);
|
|
972
|
+
for (const grant of candidates) {
|
|
973
|
+
if (await this.verifyGrantSignature(grant)) return true;
|
|
974
|
+
}
|
|
975
|
+
return false;
|
|
972
976
|
}
|
|
973
977
|
// Audited read. Returns the object iff canReadObject; else fails closed.
|
|
974
978
|
async readObject(objectId, subjectAgentId) {
|