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 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
- return Object.values(grants).some(
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-book",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Run your own Edge Book agent and connect it to the hosted reader.",
5
5
  "license": "MIT",
6
6
  "type": "module",