@tinycloud/operations 0.5.2-beta.0 → 0.5.2-beta.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.
@@ -8570,6 +8570,9 @@ function resolvePosture(profile) {
8570
8570
  function isLocalOwnerProfile(profile) {
8571
8571
  return resolvePosture(profile) === "local-owner-key" || profile.authMethod === "local" || typeof profile.privateKey === "string";
8572
8572
  }
8573
+ function ownerSessionLacksProof(session, profile) {
8574
+ return profile !== null && resolvePosture(profile) === "owner-openkey" && (typeof session.siwe !== "string" || typeof session.signature !== "string");
8575
+ }
8573
8576
  function profileNotFound2(profile) {
8574
8577
  return {
8575
8578
  ok: false,
@@ -8706,6 +8709,12 @@ async function createInvocationRuntime(target, requirement = "authenticated") {
8706
8709
  "The selected profile does not have an active session."
8707
8710
  ));
8708
8711
  }
8712
+ } else if (ownerSessionLacksProof(activeSession, profile)) {
8713
+ return failed(summary, operationError(
8714
+ "AUTH_REQUIRED",
8715
+ "The stored OpenKey session has no signed proof. Sign in again.",
8716
+ { retryable: false, details: { recovery: signInRecovery(profileName, summary.posture) } }
8717
+ ));
8709
8718
  } else {
8710
8719
  try {
8711
8720
  await node.restoreSession(activeSession);
@@ -8801,6 +8810,13 @@ async function createRestoredRuntime(target, resolved) {
8801
8810
  { details: { recovery: signInRecovery(profileName, summary.posture) } }
8802
8811
  ));
8803
8812
  }
8813
+ if (ownerSessionLacksProof(activeSession, profile)) {
8814
+ return failed(summary, operationError(
8815
+ "AUTH_REQUIRED",
8816
+ "The stored OpenKey session has no signed proof. Sign in again.",
8817
+ { retryable: false, details: { recovery: signInRecovery(profileName, summary.posture) } }
8818
+ ));
8819
+ }
8804
8820
  if (!await bindingMigrationRecorded(profileName)) {
8805
8821
  const records = await readAdditionalDelegations(profileName);
8806
8822
  if (records.some(