@varde-flyt/vfac 0.14.0 → 0.14.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/vfac.mjs +22 -8
  2. package/package.json +1 -1
package/dist/vfac.mjs CHANGED
@@ -18162,21 +18162,32 @@ async function runDoctor(parsed) {
18162
18162
  const mutating = access.projects.filter(
18163
18163
  (project) => project.permissions.some((permission) => !permission.endsWith(".read"))
18164
18164
  );
18165
+ const organizationWide = access.tenantPermissions.includes("project.read");
18166
+ const alsoOrganizationWide = access.tenantPermissions.length > 0 ? `Organization-wide it holds ${access.tenantPermissions.join(", ")}, which reaches no Project. ` : "";
18167
+ const perProject = projects.length === 0 ? "" : `. Granted per Project: ${projects.join(", ")}` + (mutating.length > 0 ? ` \u2014 you can deploy in ${mutating.map((project) => project.projectId).join(", ")}` : " \u2014 read-only there");
18165
18168
  checks.push(
18166
- access.tenantWide ? {
18169
+ organizationWide ? {
18167
18170
  name: "Access",
18168
18171
  ok: true,
18169
- detail: `the whole organization \u2014 ${access.tenantPermissions.join(", ")}`,
18170
- facts: { scope: "organization", grantedProjectIds: null }
18172
+ detail: `the whole organization \u2014 ${access.tenantPermissions.join(", ")}${perProject}`,
18173
+ facts: {
18174
+ scope: "organization",
18175
+ grantedProjectIds: projects.length > 0 ? projects.join(",") : null
18176
+ }
18171
18177
  } : projects.length === 0 ? {
18172
18178
  // A FAILURE, NOT A NOTE. This credential authenticates and can do
18173
18179
  // nothing at all — and the check said so in words while `report`
18174
18180
  // computed the exit code from `ok` alone, so `doctor` printed
18175
18181
  // "nothing else will work" and exited 0. A pipeline reads the code,
18176
18182
  // not the sentence.
18183
+ //
18184
+ // STILL A FAILURE WITH KNOWLEDGE READ AND NO PROJECT. That gate is a
18185
+ // legitimate one — it serves an MCP client — but every `vfac`
18186
+ // command that reads a Project is refused under it, and a pipeline
18187
+ // pointed at it has the wrong credential.
18177
18188
  name: "Access",
18178
18189
  ok: false,
18179
- detail: "none. This credential holds no Project and nothing organization-wide, so every command below it will be refused. Ask an organization administrator for access."
18190
+ detail: access.tenantPermissions.length > 0 ? `no Project. ${alsoOrganizationWide}Every command below that reads a Project will be refused. A gate holding only that serves an MCP client, not vfac; ask an organization administrator for a Project role on the gate vfac uses.` : "none. This credential holds no Project and nothing organization-wide, so every command below it will be refused. Ask an organization administrator for access."
18180
18191
  } : {
18181
18192
  name: "Access",
18182
18193
  ok: true,
@@ -18205,7 +18216,7 @@ async function runDoctor(parsed) {
18205
18216
  // names are the difference.
18206
18217
  grantedProjectIds: projects.join(",")
18207
18218
  },
18208
- detail: `${projects.join(", ")} \u2014 and nothing organization-wide. ` + (mutating.length > 0 ? "You can deploy in those Projects, read their catalogue, and list them. " : "Read-only there: catalogue, manifests, resources and operations. An apply or a lifecycle command is refused, and that is what was granted rather than a fault. ") + "Anything ACROSS the organization \u2014 a Project you hold nothing in, or its members \u2014 is refused."
18219
+ detail: `${projects.join(", ")}` + (access.tenantPermissions.length > 0 ? ". " : " \u2014 and nothing organization-wide. ") + alsoOrganizationWide + (mutating.length > 0 ? "You can deploy in those Projects, read their catalogue, and list them. " : "Read-only there: catalogue, manifests, resources and operations. An apply or a lifecycle command is refused, and that is what was granted rather than a fault. ") + "Anything ACROSS the organization \u2014 a Project you hold nothing in, or its members \u2014 is refused."
18209
18220
  }
18210
18221
  );
18211
18222
  checks.push({
@@ -19216,10 +19227,13 @@ async function runWhoami(parsed) {
19216
19227
  }
19217
19228
  const { principal, access } = result.data;
19218
19229
  const lines = [`${principal.name} ${principal.id} (${principal.type})`];
19219
- if (access.tenantWide) {
19230
+ if (access.tenantPermissions.length > 0) {
19220
19231
  lines.push("", "Granted across the whole organization");
19221
19232
  lines.push(` ${access.tenantPermissions.join(", ")}`);
19222
- } else {
19233
+ }
19234
+ if (access.projects.length > 0 && access.tenantPermissions.length > 0) {
19235
+ lines.push("", "Granted in these Projects");
19236
+ } else if (!access.tenantWide) {
19223
19237
  lines.push("", "Granted in these Projects only \u2014 nothing organization-wide.");
19224
19238
  lines.push(" Listing these works. Reading ACROSS the organization does not.");
19225
19239
  }
@@ -19227,7 +19241,7 @@ async function runWhoami(parsed) {
19227
19241
  lines.push("", ` ${project.projectId}`);
19228
19242
  lines.push(` ${project.permissions.join(", ")}`);
19229
19243
  }
19230
- if (!access.tenantWide && access.projects.length === 0) {
19244
+ if (access.projects.length === 0 && !access.tenantPermissions.includes("project.read")) {
19231
19245
  lines.push("", " No Projects. Ask an organization administrator for access.");
19232
19246
  }
19233
19247
  lines.push(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varde-flyt/vfac",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Deploy and manage Varde Flyt Products from a manifest.",
5
5
  "repository": {
6
6
  "type": "git",