@fungi.computer/oyster 0.27.0 → 0.28.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.
package/dist/host.js CHANGED
@@ -764,6 +764,11 @@ export function oysterRouteTable(host) {
764
764
  current.release.artifact.artifactDigest !== parsed.data.artifactDigest)
765
765
  return refusal(409, "stale_authority");
766
766
  const release = await releaseOf(current.release);
767
+ // The owner approved what the page displayed: a host snapshot that
768
+ // changed since (not the stored one) needs a reload and a fresh review.
769
+ const snapshot = await deriveDeclaredOperations(current.release, release.declaration ?? emptyAppDeclaration, operationDescriptors);
770
+ if (snapshot.digest !== parsed.data.declaredOperationsDigest)
771
+ return refusal(409, "stale_authority");
767
772
  const update = await reduceInstallation(current, parsed.data.command, release, principal, current);
768
773
  if (Result.isFailure(update))
769
774
  return refusal(409, update.failure.code);
@@ -1008,10 +1013,8 @@ export function oysterRouteTable(host) {
1008
1013
  !method.requires.every((capability) => release.declaration?.capabilities.includes(capability)))
1009
1014
  return refusal(403, "Gill source is not admitted");
1010
1015
  const current = await gateFacts(installation, release, principal);
1011
- if (current.declaredOperations.digest !==
1012
- installation.authority.declaredOperationsDigest ||
1013
- current.declaredOperations.artifactDigest !==
1014
- installation.release.artifact.artifactDigest)
1016
+ if (current.declaredOperations.artifactDigest !==
1017
+ installation.release.artifact.artifactDigest)
1015
1018
  return refusal(403, "stale_authority");
1016
1019
  if (method.requires.some((capability) => grantsFor({
1017
1020
  status: installation.status,
@@ -85,6 +85,7 @@ export function createShellAppAccess(directory) {
85
85
  storeGeneration: view.storeGeneration,
86
86
  authorityVersion: permissions.authority.authorityVersion,
87
87
  artifactDigest: view.artifactDigest,
88
+ declaredOperationsDigest: permissions.declaredOperations.digest,
88
89
  command: decision.command,
89
90
  }),
90
91
  });
@@ -238,6 +238,7 @@ function PermissionEditor({ port, appKey, onAccepted, onStateChange, }) {
238
238
  storeGeneration: view.storeGeneration,
239
239
  authorityVersion: view.permissions.authority.authorityVersion,
240
240
  artifactDigest: view.artifactDigest,
241
+ declaredOperationsDigest: view.permissions.declaredOperations.digest,
241
242
  }, planGrantChange(view.permissions.authority, nextDraft));
242
243
  if (!isMounted())
243
244
  return;