@ory/argus 1.0.1 → 1.2.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.
@@ -50,7 +50,6 @@ exports.collectStatusReport = collectStatusReport;
50
50
  */
51
51
  const config_js_1 = require("./config.js");
52
52
  const permission_mode_js_1 = require("./permission-mode.js");
53
- const permissions_js_1 = require("./permissions.js");
54
53
  const auth_store_js_1 = require("./auth-store.js");
55
54
  const agent_auth_js_1 = require("./agent-auth.js");
56
55
  const subject_js_1 = require("./subject.js");
@@ -69,14 +68,13 @@ function resolveNamespace() {
69
68
  }
70
69
  /**
71
70
  * Probe the harness's built-in tool catalog against Ory, returning how many
72
- * tools the resolved user subject is allowed / denied / errored on, plus the
71
+ * tools the resolved user subject is allowed / blocked / errored on, plus the
73
72
  * live permission mode and the subject that was checked. Returns undefined when
74
73
  * a probe can't run (no project URL, empty catalog, no user identity). Never
75
74
  * throws.
76
75
  *
77
- * Checks route through {@link resolveCheckRelation}, i.e. the `access` permit
78
- * the same relation the runtime gate evaluates so a tool carrying an explicit
79
- * block is reported as denied here too, exactly as a tool call would be.
76
+ * Checks use the same default-allow `use` permit as the runtime gate. A false
77
+ * result therefore means an explicit block, not missing grant coverage.
80
78
  */
81
79
  async function probePermissionsCoverage(harness) {
82
80
  const resolved = (0, config_js_1.resolveConfig)();
@@ -106,10 +104,11 @@ async function probePermissionsCoverage(harness) {
106
104
  additionalSubjects: agentSubject ? [{ scope: "agent", subject: agentSubject }] : [],
107
105
  });
108
106
  const namespace = resolveNamespace();
109
- const relation = (0, permissions_js_1.resolveCheckRelation)("users");
107
+ const relation = opl_js_1.PERMIT_USE;
110
108
  const result = {
111
109
  total: catalog.length,
112
110
  allowed: 0,
111
+ blocked: 0,
113
112
  denied: 0,
114
113
  errored: 0,
115
114
  mode: live.mode,
@@ -124,8 +123,10 @@ async function probePermissionsCoverage(harness) {
124
123
  });
125
124
  if (probe.allowed)
126
125
  result.allowed++;
127
- else
126
+ else {
127
+ result.blocked++;
128
128
  result.denied++;
129
+ }
129
130
  }
130
131
  catch (err) {
131
132
  const ory = err;
@@ -274,14 +275,14 @@ async function collectPermissions(harness) {
274
275
  return { ...base, coverageStatus: "no_user" };
275
276
  // The probe read the mode live; prefer it over the cached config value.
276
277
  const withMode = { ...base, mode: coverage.mode, modeSource: coverage.modeSource };
277
- if (coverage.errored > 0 && coverage.allowed === 0 && coverage.denied === 0) {
278
+ if (coverage.errored > 0 && coverage.allowed === 0 && coverage.blocked === 0) {
278
279
  return { ...withMode, coverageStatus: "probe_failed", coverage };
279
280
  }
280
281
  const status = coverage.allowed === coverage.total
281
- ? "fully_granted"
282
+ ? "fully_allowed"
282
283
  : coverage.allowed === 0
283
- ? "no_grants"
284
- : "partial";
284
+ ? "fully_blocked"
285
+ : "partially_blocked";
285
286
  return { ...withMode, coverageStatus: status, coverage };
286
287
  }
287
288
  function isUserTokenUsable() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/argus",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "Ory Argus: the core API for building authentication, authorization, and audit into AI agent harness plugins, extensions, and custom integrations",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://ory.com",