praesidias 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/dist/cli.js +16 -5
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -207,6 +207,8 @@ var SENTENCES = {
207
207
  DENY_POLICY_AUTHORITY_SCOPE_REQUIREMENTS_UNMET: "This agent's access does not cover what the rule requires.",
208
208
  DENY_POLICY_AUTHORITY_PATH_REQUIREMENTS_UNMET: "This agent's access was not given the way the rule requires.",
209
209
  DENY_POLICY_CHANGED_DURING_DECISION: "The rules changed while this was being decided. Ask again.",
210
+ DENY_GROUPS_CHANGED_DURING_DECISION: "This agent's groups changed while this was being decided. Ask again.",
211
+ ALLOW_POLICY_REPORT_ONLY: "A rule allows this.",
210
212
  DENY_PRINCIPAL_NOT_BOUND: "This key may not act as that agent.",
211
213
  DENY_WORKLOAD_NOT_VERIFIED: "This agent must run from its own workload, and this request did not prove that.",
212
214
  DENY_DOMAIN_NO_MATCH: "This action is outside every area, so it is blocked.",
@@ -226,6 +228,10 @@ var isWaitingCode = (code) => WAITING.has(code);
226
228
  function sentenceFor(code) {
227
229
  return SENTENCES[code] ?? (code.startsWith("DENY_") ? "Praesidias blocked this action." : code);
228
230
  }
231
+ function messageOf(reasons, code) {
232
+ const own = reasons?.caseMessage;
233
+ return typeof own === "string" && own.trim() ? own.slice(0, 500) : sentenceFor(code);
234
+ }
229
235
  var ACTION_NAME = /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$/;
230
236
  var FIELD_NAME = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$/;
231
237
  var TYPES = /* @__PURE__ */ new Set(["string", "number", "boolean", "array", "object"]);
@@ -474,7 +480,7 @@ var Praesidias = class {
474
480
  return {
475
481
  decisionId: body.decisionId,
476
482
  allowed: result === "ALLOW",
477
- reason: { code, message: sentenceFor(code) },
483
+ reason: { code, message: messageOf(body.reasons, code) },
478
484
  context,
479
485
  caseId: typeof caseId === "string" ? caseId : null,
480
486
  boundPaths: Array.isArray(paths) ? paths.map(String) : [],
@@ -2520,7 +2526,7 @@ import { join as join5 } from "path";
2520
2526
  import { fileURLToPath } from "url";
2521
2527
 
2522
2528
  // src/version.ts
2523
- var VERSION = true ? "0.1.0" : "0.0.0-dev";
2529
+ var VERSION = true ? "0.1.1" : "0.0.0-dev";
2524
2530
  var SINGLE_FILE = true ? false : false;
2525
2531
 
2526
2532
  // src/install.ts
@@ -3466,9 +3472,14 @@ async function connect(flags, e) {
3466
3472
  }
3467
3473
  const { deviceCode, userCode, verificationUrl } = started.body;
3468
3474
  let interval = Math.max(1, Number(started.body.interval) || 2) * 1e3;
3469
- if (flags["no-browser"] !== "true") e.openBrowser(verificationUrl);
3470
- e.print(` Opened your browser to link this terminal. Code: ${bold(userCode)}`);
3471
- e.print(dim(` If it did not open: ${verificationUrl}`));
3475
+ if (flags["no-browser"] !== "true") {
3476
+ e.openBrowser(verificationUrl);
3477
+ e.print(` Opened your browser to link this terminal. Code: ${bold(userCode)}`);
3478
+ e.print(dim(` If it did not open: ${verificationUrl}`));
3479
+ } else {
3480
+ e.print(` Open this link to link this terminal. Code: ${bold(userCode)}`);
3481
+ e.print(` ${verificationUrl}`);
3482
+ }
3472
3483
  const deadline = Date.now() + (Number(started.body.expiresIn) || 600) * 1e3;
3473
3484
  let linked = null;
3474
3485
  while (Date.now() < deadline) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "praesidias",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Set up and test a Praesidias connection: npx praesidias init, npx praesidias test.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Praesidias",
@@ -32,8 +32,8 @@
32
32
  "node": ">=18.17"
33
33
  },
34
34
  "dependencies": {
35
- "@praesidias/mcp-gateway": "0.1.0",
36
- "@praesidias/sdk": "0.1.0"
35
+ "@praesidias/mcp-gateway": "0.1.1",
36
+ "@praesidias/sdk": "0.1.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^22.10.0",