@tinycloud/sdk-core 2.11.0-beta.9 → 3.0.0-beta.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/{capability-BA49Uboq.d.cts → capability-BjzXwtNw.d.cts} +1 -1
- package/dist/{capability-BA49Uboq.d.ts → capability-BjzXwtNw.d.ts} +1 -1
- package/dist/credential-admission-C_cO1QqB.d.cts +781 -0
- package/dist/credential-admission-cvHe-HUC.d.ts +781 -0
- package/dist/delegations/index.cjs +620 -221
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +32 -32
- package/dist/delegations/index.d.ts +32 -32
- package/dist/delegations/index.js +622 -223
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +3162 -1255
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +348 -18
- package/dist/index.d.ts +348 -18
- package/dist/index.js +3959 -2050
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +1273 -175
- package/dist/policy/index.cjs.map +1 -1
- package/dist/policy/index.d.cts +5 -4
- package/dist/policy/index.d.ts +5 -4
- package/dist/policy/index.js +1274 -176
- package/dist/policy/index.js.map +1 -1
- package/dist/{recipient-types.schema-D5pDlIqn.d.cts → recipient-types.schema-G8NEKRoo.d.cts} +240 -183
- package/dist/{recipient-types.schema-D5pDlIqn.d.ts → recipient-types.schema-G8NEKRoo.d.ts} +240 -183
- package/dist/requester/index.cjs.map +1 -1
- package/dist/requester/index.d.cts +1 -1
- package/dist/requester/index.d.ts +1 -1
- package/dist/requester/index.js +1 -1
- package/dist/requester/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/signed-object-B3dMzh8O.d.ts +0 -149
- package/dist/signed-object-DwPZl6kV.d.cts +0 -149
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { b7 as CredentialHolderBinding, b8 as CredentialFlowDescriptor, b9 as CredentialRequirement, ba as StoredCredentialRecord, bb as VerifiedCredential, bc as CredentialStorageReceipt, bd as IssuedCredentialEnvelope, be as CredentialIssuerMetadata } from './credential-admission-C_cO1QqB.cjs';
|
|
3
|
+
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, B as BuildPolicyCredentialPresentationV3Input, C as CONTENT_SOURCE_V1_DOMAIN, bf as CREDENTIAL_ACQUISITION_PROTOCOL, bg as CREDENTIAL_CONTRACT_VERSION, bh as CREDENTIAL_FORMAT, bf as CREDENTIAL_PROTOCOL, bi as CREDENTIAL_STEP_REGISTRY_VERSION, d as CompactUcanAuthorizationV1, bj as CredentialClaimDescriptor, bk as CredentialEndpointId, bl as CredentialInputDescriptor, bm as CredentialProgressEvent, bn as CredentialStepDescriptor, bo as CredentialStepType, bp as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, e as EIP191_JCS_SIGNATURE_SUITE, bq as HOLDER_BINDING_DOMAIN, br as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, f as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, g as POLICY_CAPABILITY_V1_DOMAIN, h as POLICY_CAPABILITY_V1_SCHEMA, i as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, j as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, k as POLICY_ENGINE_RECORD_SCHEMA, l as POLICY_PRESENTATION_V3_DOMAIN, m as POLICY_PRESENTATION_V3_SCHEMA, n as POLICY_SCHEMA, o as POLICY_SESSION_UCAN_V1_PROFILE, p as POLICY_STATUS_SCHEMA, q as POLICY_V1_DOMAIN, r as POLICY_V1_SCHEMA, s as POLICY_V2_DOMAIN, t as POLICY_V2_SCHEMA, a as Policy, v as PolicyCredentialAdmissionV3, w as PolicyCredentialPresentationV3, x as PolicyCredentialRequirementV1, P as PolicyEngineRecord, y as PolicyRootStatusV3, z as PolicySessionUcanV1, D as PolicyStatus, R as ROOT_REVOCATION_V1_DOMAIN, F as ROOT_REVOCATION_V1_SCHEMA, G as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, H as ROOT_STATUS_RENEWAL_V1_DOMAIN, I as ROOT_STATUS_V1_DOMAIN, K as SignCompactUcanAuthorizationInput, O as SignCompactUcanRootAuthorizationInput, Q as SignatureMaterialError, T as SignatureSuite, V as SignatureVerificationError, W as SignedObjectCanonicalizationError, X as SignedObjectDigestError, Y as SignedObjectErrorCode, Z as SignedObjectIdError, _ as SignedObjectKind, $ as SignedObjectMaterial, a0 as SignedObjectProfileError, a1 as SignedObjectSchemaError, a2 as SignedObjectSignature, S as SignedObjectSigner, a3 as SignedObjectVerificationResult, a4 as SignedPolicyObject, a5 as SigningKeyBindingError, a6 as UnifiedContentSource, a7 as UnifiedEncryptionCapability, a8 as UnifiedKvCapability, a9 as UnifiedNativeCapability, aa as UnifiedPolicyCapability, ab as UnifiedPolicyV1, ac as UnifiedPolicyV2, ad as UnifiedResourceSelector, ae as UnsignedPolicy, U as UnsignedPolicyEngineRecord, af as UnsignedPolicyObject, ag as UnsignedPolicyStatus, ah as UnsignedUnifiedPolicyV2, ai as UnsupportedSignatureSuiteError, aj as admitPolicyCredentialV3, ak as buildPolicyCredentialPresentationV3, al as canonicalizeSignedObjectUnsigned, am as canonicalizeUnifiedPolicyCapability, an as compactAttenuationContains, ao as contentSourceDigestHex, ap as createAndSignPolicy, aq as createAndSignPolicyEngineRecord, ar as createAndSignPolicyStatus, as as createAndSignSignedObject, av as deriveSignedObjectMaterial, aw as getPolicyRootStatusV3, ay as normalizeUnifiedPolicyCapability, az as parseCompactUcanAuthorization, aA as parsePolicySessionUcan, aB as policyCidFromCanonicalBytes, aC as policyDigestHex, aD as policyIdForDigestHex, aE as policyV2DigestHex, aF as projectUnifiedPolicyCapabilities, aG as projectUnifiedPolicyCapability, aH as renewPolicyRootStatusV3, aJ as revokePolicyRootV3, aK as signCompactUcanAuthorization, aL as signCompactUcanRootAuthorization, aM as signedObjectIdFor, aN as toSignedObjectError, aO as unifiedNativeProjectionHashHex, aP as unifiedPolicyCapabilityContains, aQ as unifiedPolicyCapabilityDigestHex, aR as unifiedPolicyCapabilityFromNative, aS as validatePolicyCredentialRequirementV1, aT as validatePolicyEngineRecordSigned, aU as validatePolicyEngineRecordSignedShape, aV as validatePolicyEngineRecordUnsigned, aW as validatePolicySigned, aX as validatePolicySignedShape, aY as validatePolicyStatusSigned, aZ as validatePolicyStatusSignedShape, a_ as validatePolicyStatusUnsigned, a$ as validatePolicyUnsigned, b0 as validateUnifiedPolicyV2, b1 as verifyPolicy, b2 as verifyPolicyEngineRecord, b3 as verifyPolicyRootRevocationV3, b4 as verifyPolicyRootStatusCheckpointV3, b5 as verifyPolicyStatus, b6 as verifySignedObject } from './credential-admission-C_cO1QqB.cjs';
|
|
2
4
|
import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, ISecretsService, ServiceSession, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
|
|
3
5
|
export { BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, clearTinyCloudDebugLogs, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isNetworkId, networkDiscoveryKey, ok, openWrappedKey, parseNetworkId, resolveSecretListPrefix, resolveSecretPath, serviceError, tinyCloudDebugLogger, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
4
6
|
export { HOLDER_KEY_BINDING_PRESENTATION_SCHEMA, HolderKeyBindingPresentation, LISTEN_SQL_STATEMENT_CATALOG, ListenSqlStatementName, POLICY_ENGINE_CHALLENGE_REQUEST_SCHEMA, POLICY_ENGINE_CHALLENGE_RESPONSE_SCHEMA, POLICY_ENGINE_DENIAL_SCHEMA, POLICY_ENGINE_GRANT_PRESENTATION_DENIAL_CODES, POLICY_ENGINE_RESOLVE_REQUEST_SCHEMA, PORTABLE_DELEGATION_SCHEMA, PolicyEngineGrantPresentationDenialCode, PortableDelegation, REQUESTER_ENGINE_RETRY_ATTEMPTS, REQUESTER_ENGINE_RETRY_MAX_DELAY_MS, REQUESTER_NEAR_EXPIRY_SECONDS, RequesterEndpointResolution, RequesterHttpRequest, RequesterHttpResponse, RequesterInvocationCapability, RequesterSigningCapability, RequesterTransport, TranscriptRequester, TranscriptRequesterError, TranscriptRequesterErrorCode, TranscriptRequesterErrorState, TranscriptRequesterOptions, TranscriptRequesterReadKvResult, TranscriptRequesterReadSqlResult, createTranscriptRequester, deriveDelegationCid, parseNodeNativePortableDelegation } from './requester/index.cjs';
|
|
5
|
-
import { m as Delegation, e as CreateDelegationParams, G as GenerateShareParams,
|
|
6
|
-
export { c as AccountDelegationRecord, d as AccountDelegationResource, C as CapabilityEntry,
|
|
7
|
-
export { ACCOUNT_INDEX_SCHEMA, BOOTSTRAP_ALLOWLIST, BOOTSTRAP_DEFAULT_SPACE, BOOTSTRAP_ENCRYPTION_NETWORK_NAME, BOOTSTRAP_ENCRYPTION_NETWORK_RESOURCE_TEMPLATE, BOOTSTRAP_MANIFEST, BOOTSTRAP_PERSISTED_APPLICATION_MANIFESTS, BOOTSTRAP_PUBLIC_SPACE, BOOTSTRAP_SESSION_REQUESTS, BOOTSTRAP_SPACE_MANIFESTS, BOOTSTRAP_SPACE_NAMES, BootstrapAllowlistEntry, BootstrapAllowlistKind, BootstrapEncryptionNetworkStep, BootstrapManifest, BootstrapRawAbilityAllowlistEntry, BootstrapSchemaStep, BootstrapSeedApplicationsStep, BootstrapSeedSpacesStep, BootstrapSpaceDescriptor, BootstrapSpaceName, BootstrapSpaceStep, BootstrapStep, BootstrapStepKind, CAPABILITIES, CAPABILITY_REGISTRY, CapabilityRegistryEntry, CapabilityStatus, DUCKDB, ENCRYPTION, HOOKS, KV, SECRET_RECORDS_SCHEMA, SPACE, SQL, TINYCLOUD_ACCOUNT_SPACE_MANIFEST, TINYCLOUD_APPLICATIONS_SPACE_MANIFEST, TINYCLOUD_DEFAULT_SPACE_MANIFEST, TINYCLOUD_PUBLIC_SPACE_MANIFEST, TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST, bootstrapEncryptionNetworkId, bootstrapSpaceId, bootstrapSteps, composeBootstrapSpaceManifest } from '@tinycloud/bootstrap';
|
|
8
|
-
export {
|
|
9
|
-
export { b as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-BA49Uboq.cjs';
|
|
7
|
+
import { m as Delegation, e as CreateDelegationParams, G as GenerateShareParams, aC as ShareLink, bc as SpaceInfo, I as ICapabilityKeyRegistry, y as ISharingService, D as DelegationManager, b as AccountDelegationQueryOptions, A as AccountDelegationPage, w as DelegationRevocationReceipt } from './recipient-types.schema-G8NEKRoo.cjs';
|
|
8
|
+
export { c as AccountDelegationRecord, d as AccountDelegationResource, C as CapabilityEntry, bP as CapabilityKeyRegistry, bQ as CapabilityKeyRegistryErrorCode, bR as CapabilityKeyRegistryErrorCodes, f as CreateDelegationWasmParams, g as CreateDelegationWasmResult, h as CreateOwnerDelegationParams, i as DelegateReceivedShareParams, j as DelegatedResource, k as DelegatedShareAccess, l as DelegatedShareKey, n as DelegationApiResponse, o as DelegationChain, p as DelegationChainV2, q as DelegationDirection, a as DelegationError, r as DelegationErrorCode, s as DelegationErrorCodes, t as DelegationFilters, u as DelegationManagerConfig, v as DelegationRecord, R as DelegationResult, x as DelegationStatus, E as EncodedShareData, z as IngestOptions, J as JWK, K as KeyInfo, B as KeyProvider, F as KeyType, M as MAX_CONTENT_BYTES, H as MAX_SEALED_SHARE_CONTENT_BYTES, L as MAX_SHARE_ARTIFACT_BYTES, N as MAX_SHARE_CONTENT_BYTES, O as MemorySenderShareKeyStorage, P as MemorySenderShareRecordStorage, Q as MemoryShareCache, S as OwnerDelegationPermission, T as OwnerDelegationReceipt, U as OwnerShareAction, V as OwnerShareDecryption, W as OwnerShareMatcher, X as OwnerSharePolicyRegistration, Y as OwnerSharePolicyRegistrationReceipt, Z as OwnerSharePolicyV2, _ as PortableDelegationImportReceipt, $ as ReceiveOptions, a0 as RegisterOwnerSharePolicyParams, a1 as SHARE_DELIVERY_AUTHORIZATION_DOMAIN, a2 as SenderShareKeyStorage, a3 as SenderShareRecord, a4 as SenderShareRecordStorage, a5 as SenderShareRevocationScope, a6 as SenderShareStore, a7 as ShareAccess, a8 as ShareAccessError, a9 as ShareAccessV2, aa as ShareAction, ac as ShareAddressedDelegationEnvelopeV2, ad as ShareAddressedDelegationEnvelopeV2Schema, ae as ShareAddressedDelegationRequestV2, af as ShareAddressedDelegationRequestV2Schema, ag as ShareAddressedDelegationResponseV2, ah as ShareAddressedDelegationResponseV2Schema, ai as ShareAddressedRecipientMatcher, aj as ShareArtifactInput, ak as ShareArtifactResult, al as ShareArtifactV2, am as ShareCache, an as ShareCacheEntry, ao as ShareCacheKey, ap as ShareCacheMetadata, aq as ShareCapabilityLike, ar as ShareConflict, as as ShareContentMetadata, at as ShareContentSource, au as ShareDeliveryAuthorization, av as ShareDeliveryAuthorizationReceipt, aw as ShareDeliveryAuthorizationRequest, ax as ShareDetachedProof, ay as ShareEnvelopeError, az as ShareEnvelopeV2, aA as ShareExpiryBounds, aB as ShareKvContentSource, aD as ShareLinkData, aE as ShareLinkLocation, aF as ShareListEntry, aG as ShareListResult, aH as ShareNativeAction, aI as ShareNativeInvokeEnvelopeV1, aJ as ShareNativeInvokeErrorResult, aK as ShareNativeInvokeInput, aL as ShareNativeInvokeResult, aM as ShareNativeInvokeSuccessResult, aN as ShareNativeResponse, aO as ShareNativeResponseSchema, aP as SharePolicy, aQ as SharePolicyBinding, aR as SharePolicySession, aS as SharePolicySessionV1, aT as SharePolicySessionWireV1, aU as SharePortableDelegation, aV as ShareReadInvocationV1, aW as ShareReadResult, aX as ShareRecipientClient, aY as ShareRecipientClientOptions, a_ as ShareRecipientPolicy, b0 as ShareRecipientResult, b1 as ShareRecipientTarget, b3 as ShareResource, b5 as ShareSaveOptions, b6 as ShareSchema, b7 as ShareSqlContentSource, b8 as ShareWireAction, b9 as SharingService, ba as SharingServiceConfig, bb as SignedDelegation, bd as SpaceOwnership, bS as StoredDelegationChain, be as ValidateShareDeliveryAuthorizationExpected, bf as VerifyShareEnvelopeOptions, bg as canonicalOwnerSharePolicy, bh as computeOwnerShareRegistrationCid, bi as computeShareCid, bT as createCapabilityKeyRegistry, bj as createDelegatedShareKey, bk as createPolicyEnforcementDelegation, bl as createShareArtifact, bm as createShareArtifactAsync, bn as createSharePolicy, bo as createSharingService, bp as decryptShareBytesAsync, bq as delegatePortablePolicySession, br as encodeInlineShareUrl, bs as encodeShareArtifact, bt as encodeShareUrl, bu as encryptShareBytes, bv as encryptShareBytesAsync, bw as importPortableDelegation, bx as intersectShareCapabilities, by as isV2ShareLink, bz as normalizeShareActions, bA as normalizeShareRecipientTarget, bB as normalizeShareResource, bC as parsePortableDelegation, bD as parseShareArtifact, bE as parseShareUrl, bF as restoreDelegatedShareKey, bG as serializePortableDelegation, bH as shareCapabilityAllows, bI as shareDeliveryTrustedKid, bJ as signShareEnvelope, bK as validateOwnerSharePolicyRegistration, bL as validateOwnerSharePolicyRegistrationBytes, bM as validateShareDeliveryAuthorizationBytes, bN as verifyShareCid, bO as verifyShareEnvelope } from './recipient-types.schema-G8NEKRoo.cjs';
|
|
9
|
+
export { ACCOUNT_INDEX_SCHEMA, ACCOUNT_MANIFEST_PERMISSIONS, BOOTSTRAP_ALLOWLIST, BOOTSTRAP_DEFAULT_ONLY_SESSION_REQUEST, BOOTSTRAP_DEFAULT_SPACE, BOOTSTRAP_ENCRYPTION_NETWORK_NAME, BOOTSTRAP_ENCRYPTION_NETWORK_RESOURCE_TEMPLATE, BOOTSTRAP_MANIFEST, BOOTSTRAP_PERSISTED_APPLICATION_MANIFESTS, BOOTSTRAP_PUBLIC_SPACE, BOOTSTRAP_SESSION_REQUESTS, BOOTSTRAP_SPACE_MANIFESTS, BOOTSTRAP_SPACE_NAMES, BootstrapAllowlistEntry, BootstrapAllowlistKind, BootstrapEncryptionNetworkStep, BootstrapManifest, BootstrapRawAbilityAllowlistEntry, BootstrapSchemaStep, BootstrapSeedApplicationsStep, BootstrapSeedSpacesStep, BootstrapSpaceDescriptor, BootstrapSpaceName, BootstrapSpaceStep, BootstrapStep, BootstrapStepKind, CAPABILITIES, CAPABILITY_REGISTRY, CapabilityRegistryEntry, CapabilityStatus, DUCKDB, ENCRYPTION, HOOKS, KV, SECRET_RECORDS_SCHEMA, SPACE, SQL, TINYCLOUD_ACCOUNT_SPACE_MANIFEST, TINYCLOUD_APPLICATIONS_SPACE_MANIFEST, TINYCLOUD_DEFAULT_SPACE_MANIFEST, TINYCLOUD_PUBLIC_SPACE_MANIFEST, TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST, bootstrapEncryptionNetworkId, bootstrapSpaceId, bootstrapSteps, composeBootstrapSpaceManifest } from '@tinycloud/bootstrap';
|
|
10
|
+
export { a as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-BjzXwtNw.cjs';
|
|
10
11
|
export { SiweMessage } from 'siwe';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -185,6 +186,74 @@ interface IENSResolver {
|
|
|
185
186
|
resolveAvatar?(ensName: string): Promise<string | null>;
|
|
186
187
|
}
|
|
187
188
|
|
|
189
|
+
declare function createHolderBinding(input: Omit<CredentialHolderBinding, "type" | "protocol">): CredentialHolderBinding;
|
|
190
|
+
/** Rejects unknown binding fields before any active-session signing operation. */
|
|
191
|
+
declare function validateCredentialHolderBinding(value: unknown): CredentialHolderBinding;
|
|
192
|
+
declare function holderBindingCanonicalBytes(binding: CredentialHolderBinding): Uint8Array;
|
|
193
|
+
declare function holderBindingSigningBytes(binding: CredentialHolderBinding): Uint8Array;
|
|
194
|
+
|
|
195
|
+
/** Strictly validates and preserves the Rust-owned canonical descriptor bytes. */
|
|
196
|
+
declare function validateCredentialFlowDescriptor(value: unknown): CredentialFlowDescriptor;
|
|
197
|
+
declare function credentialEndpointPath(id: "request" | "state" | "challenge" | "proof" | "holder_binding" | "holder_signature" | "issue" | "result" | "issuer_metadata", requestId?: string): string;
|
|
198
|
+
|
|
199
|
+
declare function encodeBase64Url(bytes: Uint8Array): string;
|
|
200
|
+
declare function decodeBase64Url(value: string): Uint8Array;
|
|
201
|
+
declare function sha256Base64Url(value: string | Uint8Array): Promise<string>;
|
|
202
|
+
declare function canonicalDigest(value: unknown): Promise<string>;
|
|
203
|
+
declare function isDigest(value: unknown): value is string;
|
|
204
|
+
|
|
205
|
+
declare const CREDENTIAL_ERROR_CODES: readonly ["ACTIVE_SESSION_REQUIRED", "CANCELED", "DESCRIPTOR_INVALID", "HOLDER_MISMATCH", "ISSUER_UNREADY", "OFFLINE", "POPUP_BLOCKED", "REQUEST_EXPIRED", "REQUEST_SUBSTITUTED", "SIGNATURE_REJECTED", "UNSUPPORTED_PROFILE", "UNSUPPORTED_VERSION", "VERIFICATION_FAILED", "VERIFIED_NOT_SAVED"];
|
|
206
|
+
type CredentialErrorCode = (typeof CREDENTIAL_ERROR_CODES)[number];
|
|
207
|
+
/** Stable, redaction-safe error returned by the credential acquisition module. */
|
|
208
|
+
declare class CredentialError extends Error {
|
|
209
|
+
readonly code: CredentialErrorCode;
|
|
210
|
+
readonly details: {
|
|
211
|
+
readonly retryAfterMs?: number;
|
|
212
|
+
readonly state?: string;
|
|
213
|
+
readonly correlationId?: string;
|
|
214
|
+
readonly cause?: unknown;
|
|
215
|
+
};
|
|
216
|
+
readonly name = "CredentialError";
|
|
217
|
+
readonly recoverable: boolean;
|
|
218
|
+
constructor(code: CredentialErrorCode, message: string, details?: {
|
|
219
|
+
readonly retryAfterMs?: number;
|
|
220
|
+
readonly state?: string;
|
|
221
|
+
readonly correlationId?: string;
|
|
222
|
+
readonly cause?: unknown;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
declare function credentialError(value: unknown, fallbackCode?: CredentialErrorCode): CredentialError;
|
|
226
|
+
|
|
227
|
+
declare function validateCredentialRequirement(value: unknown): CredentialRequirement;
|
|
228
|
+
declare function credentialRequirementDigest(requirement: CredentialRequirement): Promise<string>;
|
|
229
|
+
declare function descriptorSatisfiesRequirement(descriptor: CredentialFlowDescriptor, requirement: CredentialRequirement): boolean;
|
|
230
|
+
declare function credentialMatchesRequirement(requirement: CredentialRequirement, candidate: Pick<StoredCredentialRecord | VerifiedCredential, "profile" | "credentialType" | "claims" | "holderDid" | "expiresAt" | "issuedAt">, holderDid: string, now?: Date): boolean;
|
|
231
|
+
|
|
232
|
+
declare function credentialRecordKey(recordId: string): string;
|
|
233
|
+
declare function credentialIndexKey(requirementDigest: string, recordId: string): string;
|
|
234
|
+
declare function createStoredCredentialRecord(input: {
|
|
235
|
+
readonly verified: VerifiedCredential;
|
|
236
|
+
readonly ownerDid: string;
|
|
237
|
+
readonly requirement: CredentialRequirement;
|
|
238
|
+
readonly requirementDigest: string;
|
|
239
|
+
readonly storedAt?: string;
|
|
240
|
+
}): Promise<StoredCredentialRecord>;
|
|
241
|
+
declare function createStorageReceipt(record: StoredCredentialRecord, etag?: string): Promise<CredentialStorageReceipt>;
|
|
242
|
+
declare function verifyStorageReceipt(record: StoredCredentialRecord, receipt: CredentialStorageReceipt, activeOwnerDid: string, activeHolderDid: string): Promise<boolean>;
|
|
243
|
+
|
|
244
|
+
/** Independently verifies the Rust-owned SD-JWT profile contract before storage. */
|
|
245
|
+
declare function verifyIssuedCredential(input: {
|
|
246
|
+
readonly envelope: IssuedCredentialEnvelope;
|
|
247
|
+
readonly descriptor: CredentialFlowDescriptor;
|
|
248
|
+
readonly descriptorDigest: string;
|
|
249
|
+
readonly requirement: CredentialRequirement;
|
|
250
|
+
readonly holderDid: string;
|
|
251
|
+
readonly issuerMetadata: CredentialIssuerMetadata;
|
|
252
|
+
readonly now?: Date;
|
|
253
|
+
readonly checkStatus: (status: IssuedCredentialEnvelope["status"], signal?: AbortSignal) => Promise<boolean>;
|
|
254
|
+
readonly signal?: AbortSignal;
|
|
255
|
+
}): Promise<VerifiedCredential>;
|
|
256
|
+
|
|
188
257
|
/**
|
|
189
258
|
* TinyCloud App Manifest
|
|
190
259
|
*
|
|
@@ -934,6 +1003,8 @@ declare class IdentityParseError extends Error {
|
|
|
934
1003
|
}
|
|
935
1004
|
declare function isEvmAddress(input: string): boolean;
|
|
936
1005
|
declare function canonicalizeAddress(address: string): CanonicalAddress;
|
|
1006
|
+
/** Verify EIP-191 evidence over the exact UTF-8 message and recover its signer. */
|
|
1007
|
+
declare function verifyEip191MessageSignature(message: string, signature: string, expectedAddress: string): Promise<boolean>;
|
|
937
1008
|
declare function addressStorageKey(address: string): CanonicalAddress;
|
|
938
1009
|
declare function pkhDid(address: string, chainId?: number): string;
|
|
939
1010
|
declare function parsePkhDid(did: string): PkhDidParts | null;
|
|
@@ -991,18 +1062,18 @@ declare const PersistedTinyCloudSessionSchema: z.ZodObject<{
|
|
|
991
1062
|
verificationMethod: z.ZodString;
|
|
992
1063
|
}, "strip", z.ZodTypeAny, {
|
|
993
1064
|
spaceId: string;
|
|
994
|
-
delegationCid: string;
|
|
995
1065
|
delegationHeader: {
|
|
996
1066
|
Authorization: string;
|
|
997
1067
|
};
|
|
1068
|
+
delegationCid: string;
|
|
998
1069
|
verificationMethod: string;
|
|
999
1070
|
spaces?: Record<string, string> | undefined;
|
|
1000
1071
|
}, {
|
|
1001
1072
|
spaceId: string;
|
|
1002
|
-
delegationCid: string;
|
|
1003
1073
|
delegationHeader: {
|
|
1004
1074
|
Authorization: string;
|
|
1005
1075
|
};
|
|
1076
|
+
delegationCid: string;
|
|
1006
1077
|
verificationMethod: string;
|
|
1007
1078
|
spaces?: Record<string, string> | undefined;
|
|
1008
1079
|
}>;
|
|
@@ -1043,18 +1114,18 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
1043
1114
|
verificationMethod: z.ZodString;
|
|
1044
1115
|
}, "strip", z.ZodTypeAny, {
|
|
1045
1116
|
spaceId: string;
|
|
1046
|
-
delegationCid: string;
|
|
1047
1117
|
delegationHeader: {
|
|
1048
1118
|
Authorization: string;
|
|
1049
1119
|
};
|
|
1120
|
+
delegationCid: string;
|
|
1050
1121
|
verificationMethod: string;
|
|
1051
1122
|
spaces?: Record<string, string> | undefined;
|
|
1052
1123
|
}, {
|
|
1053
1124
|
spaceId: string;
|
|
1054
|
-
delegationCid: string;
|
|
1055
1125
|
delegationHeader: {
|
|
1056
1126
|
Authorization: string;
|
|
1057
1127
|
};
|
|
1128
|
+
delegationCid: string;
|
|
1058
1129
|
verificationMethod: string;
|
|
1059
1130
|
spaces?: Record<string, string> | undefined;
|
|
1060
1131
|
}>>;
|
|
@@ -1091,19 +1162,19 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
1091
1162
|
sessionKey: string;
|
|
1092
1163
|
siwe: string;
|
|
1093
1164
|
signature: string;
|
|
1094
|
-
createdAt: string;
|
|
1095
1165
|
expiresAt: string;
|
|
1096
1166
|
version: string;
|
|
1167
|
+
createdAt: string;
|
|
1097
1168
|
ens?: {
|
|
1098
1169
|
domain?: string | null | undefined;
|
|
1099
1170
|
avatarUrl?: string | null | undefined;
|
|
1100
1171
|
} | undefined;
|
|
1101
1172
|
tinycloudSession?: {
|
|
1102
1173
|
spaceId: string;
|
|
1103
|
-
delegationCid: string;
|
|
1104
1174
|
delegationHeader: {
|
|
1105
1175
|
Authorization: string;
|
|
1106
1176
|
};
|
|
1177
|
+
delegationCid: string;
|
|
1107
1178
|
verificationMethod: string;
|
|
1108
1179
|
spaces?: Record<string, string> | undefined;
|
|
1109
1180
|
} | undefined;
|
|
@@ -1114,19 +1185,19 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
1114
1185
|
sessionKey: string;
|
|
1115
1186
|
siwe: string;
|
|
1116
1187
|
signature: string;
|
|
1117
|
-
createdAt: string;
|
|
1118
1188
|
expiresAt: string;
|
|
1119
1189
|
version: string;
|
|
1190
|
+
createdAt: string;
|
|
1120
1191
|
ens?: {
|
|
1121
1192
|
domain?: string | null | undefined;
|
|
1122
1193
|
avatarUrl?: string | null | undefined;
|
|
1123
1194
|
} | undefined;
|
|
1124
1195
|
tinycloudSession?: {
|
|
1125
1196
|
spaceId: string;
|
|
1126
|
-
delegationCid: string;
|
|
1127
1197
|
delegationHeader: {
|
|
1128
1198
|
Authorization: string;
|
|
1129
1199
|
};
|
|
1200
|
+
delegationCid: string;
|
|
1130
1201
|
verificationMethod: string;
|
|
1131
1202
|
spaces?: Record<string, string> | undefined;
|
|
1132
1203
|
} | undefined;
|
|
@@ -1173,14 +1244,14 @@ declare const TinyCloudSessionSchema: z.ZodObject<{
|
|
|
1173
1244
|
sessionKey: string;
|
|
1174
1245
|
siwe: string;
|
|
1175
1246
|
signature: string;
|
|
1176
|
-
spaceId: string;
|
|
1177
1247
|
jwk: {} & {
|
|
1178
1248
|
[k: string]: unknown;
|
|
1179
1249
|
};
|
|
1180
|
-
|
|
1250
|
+
spaceId: string;
|
|
1181
1251
|
delegationHeader: {
|
|
1182
1252
|
Authorization: string;
|
|
1183
1253
|
};
|
|
1254
|
+
delegationCid: string;
|
|
1184
1255
|
verificationMethod: string;
|
|
1185
1256
|
spaces?: Record<string, string> | undefined;
|
|
1186
1257
|
}, {
|
|
@@ -1189,14 +1260,14 @@ declare const TinyCloudSessionSchema: z.ZodObject<{
|
|
|
1189
1260
|
sessionKey: string;
|
|
1190
1261
|
siwe: string;
|
|
1191
1262
|
signature: string;
|
|
1192
|
-
spaceId: string;
|
|
1193
1263
|
jwk: {} & {
|
|
1194
1264
|
[k: string]: unknown;
|
|
1195
1265
|
};
|
|
1196
|
-
|
|
1266
|
+
spaceId: string;
|
|
1197
1267
|
delegationHeader: {
|
|
1198
1268
|
Authorization: string;
|
|
1199
1269
|
};
|
|
1270
|
+
delegationCid: string;
|
|
1200
1271
|
verificationMethod: string;
|
|
1201
1272
|
spaces?: Record<string, string> | undefined;
|
|
1202
1273
|
}>;
|
|
@@ -1315,6 +1386,8 @@ interface SignResponse {
|
|
|
1315
1386
|
signature?: string;
|
|
1316
1387
|
/** Reason for rejection if not approved */
|
|
1317
1388
|
reason?: string;
|
|
1389
|
+
/** The policy declined automatic signing and requires normal user consent. */
|
|
1390
|
+
needsApproval?: boolean;
|
|
1318
1391
|
}
|
|
1319
1392
|
/**
|
|
1320
1393
|
* Callback handler type for sign requests.
|
|
@@ -1345,6 +1418,8 @@ interface OpenKeySigningStrategyOptions {
|
|
|
1345
1418
|
fetch?: typeof fetch;
|
|
1346
1419
|
/** Request credentials mode for browser integrations. */
|
|
1347
1420
|
credentials?: "include" | "omit" | "same-origin";
|
|
1421
|
+
/** Normal user-visible approval for a request that is outside Auto-Sign policy. */
|
|
1422
|
+
requestApproval?: SignCallback;
|
|
1348
1423
|
}
|
|
1349
1424
|
interface OpenKeySigningRequestBody extends SignRequest {
|
|
1350
1425
|
keyId?: string;
|
|
@@ -1360,6 +1435,8 @@ interface OpenKeySigningResponseBody {
|
|
|
1360
1435
|
interface OpenKeyCallbackStrategy extends CallbackStrategy {
|
|
1361
1436
|
/** Marker used by SDK runtimes to choose the bootstrap-safe initial SIWE. */
|
|
1362
1437
|
openKeyAutoSign: true;
|
|
1438
|
+
/** Separate interactive approval path; never treated as an Auto-Sign grant. */
|
|
1439
|
+
openKeyRequestApproval?: SignCallback;
|
|
1363
1440
|
}
|
|
1364
1441
|
/**
|
|
1365
1442
|
* Create a callback signing strategy that delegates message signing to OpenKey.
|
|
@@ -1562,6 +1639,259 @@ declare class AutoApproveSpaceCreationHandler implements ISpaceCreationHandler {
|
|
|
1562
1639
|
*/
|
|
1563
1640
|
declare const defaultSpaceCreationHandler: ISpaceCreationHandler;
|
|
1564
1641
|
|
|
1642
|
+
interface TinyCloudAuthorizationRequestV1 {
|
|
1643
|
+
protocolVersion: 1;
|
|
1644
|
+
/** The suggested SIWE. OpenKey may narrow this before signing. */
|
|
1645
|
+
siwe: string;
|
|
1646
|
+
/** Which OpenKey keyId to sign with. Optional; user may pick. */
|
|
1647
|
+
keyId?: string;
|
|
1648
|
+
/** Optional presentation envelope for the review page. */
|
|
1649
|
+
presentation?: CapabilityPresentationEnvelopeV1;
|
|
1650
|
+
}
|
|
1651
|
+
interface TinyCloudAuthorizationResultV1 {
|
|
1652
|
+
protocolVersion: 1;
|
|
1653
|
+
/** EIP-55 encoded signer address. */
|
|
1654
|
+
address: string;
|
|
1655
|
+
/** Signature over `signedMessage`, hex-encoded (0x…). */
|
|
1656
|
+
signature: string;
|
|
1657
|
+
/**
|
|
1658
|
+
* The EXACT bytes the signature verifies against. When the user narrows
|
|
1659
|
+
* capabilities in the review, this is the regenerated SIWE — not the
|
|
1660
|
+
* caller's original request.
|
|
1661
|
+
*/
|
|
1662
|
+
signedMessage: string;
|
|
1663
|
+
/** Action IDs the user selected (or default consent). Opaque strings. */
|
|
1664
|
+
selectedActionKeys: string[];
|
|
1665
|
+
/** Effective grant set after narrowing. */
|
|
1666
|
+
permissions: Array<TinyCloudEffectiveGrantV1>;
|
|
1667
|
+
}
|
|
1668
|
+
interface TinyCloudEffectiveGrantV1 {
|
|
1669
|
+
service: string;
|
|
1670
|
+
space: string;
|
|
1671
|
+
path: string;
|
|
1672
|
+
actions: string[];
|
|
1673
|
+
}
|
|
1674
|
+
interface CapabilityPresentationEnvelopeV1 {
|
|
1675
|
+
protocolVersion: 1;
|
|
1676
|
+
displayName?: string;
|
|
1677
|
+
/**
|
|
1678
|
+
* Reason string the caller supplied for the delegation. Rendered as
|
|
1679
|
+
* caller-supplied context — NEVER treated as verified metadata unless
|
|
1680
|
+
* the receiving side origin-binds a manifest that carries the same
|
|
1681
|
+
* text. The OpenKey widget marks this as "reason provided by caller".
|
|
1682
|
+
*/
|
|
1683
|
+
reason?: string;
|
|
1684
|
+
manifestId?: string;
|
|
1685
|
+
manifestDigest?: string;
|
|
1686
|
+
/**
|
|
1687
|
+
* Full manifest payload(s) the SDK forwards so the OpenKey review UI
|
|
1688
|
+
* can render honest provenance labels. Display-only:
|
|
1689
|
+
* - The envelope MUST NEVER expand authority; the ReCap payload is
|
|
1690
|
+
* the sole gate for what the user can approve.
|
|
1691
|
+
* - The widget transport size-bounds and validates the envelope
|
|
1692
|
+
* before use; oversized/malformed envelopes are dropped.
|
|
1693
|
+
* - The OpenKey server's /authorize-sign-prepare route decides trust
|
|
1694
|
+
* — even a well-formed envelope stays `unsigned` unless the
|
|
1695
|
+
* browser origin is verifiable and its well-known manifest
|
|
1696
|
+
* content-digest matches `manifestDigest`.
|
|
1697
|
+
*/
|
|
1698
|
+
manifests?: Array<{
|
|
1699
|
+
name?: string;
|
|
1700
|
+
appId?: string;
|
|
1701
|
+
payload?: Record<string, unknown>;
|
|
1702
|
+
}>;
|
|
1703
|
+
}
|
|
1704
|
+
/**
|
|
1705
|
+
* Runtime validator for a TinyCloudAuthorizationResultV1. Returns null when
|
|
1706
|
+
* the payload matches the expected shape; returns an error message string
|
|
1707
|
+
* otherwise. Designed for use at the js-sdk trust boundary (browser-auth,
|
|
1708
|
+
* NodeUserAuthorization) so a compromised OpenKey response cannot inject
|
|
1709
|
+
* unexpected fields into a session.
|
|
1710
|
+
*/
|
|
1711
|
+
declare function validateAuthorizationResultV1(value: unknown): {
|
|
1712
|
+
ok: true;
|
|
1713
|
+
value: TinyCloudAuthorizationResultV1;
|
|
1714
|
+
} | {
|
|
1715
|
+
ok: false;
|
|
1716
|
+
error: string;
|
|
1717
|
+
};
|
|
1718
|
+
/**
|
|
1719
|
+
* Selected action ID rules. The OpenKey side builds these with the exact
|
|
1720
|
+
* separator convention below (mirror of `packages/capability-review/src/ids`).
|
|
1721
|
+
* Consumers should treat them as opaque; only equality comparisons and set
|
|
1722
|
+
* membership are guaranteed to be stable.
|
|
1723
|
+
*/
|
|
1724
|
+
declare const OPENKEY_ACTION_ID_SEPARATOR = "\0";
|
|
1725
|
+
declare function isPlausibleOpenKeyActionId(id: unknown): id is string;
|
|
1726
|
+
/**
|
|
1727
|
+
* Canonical decomposition of a ReCap `att` resource URI into `{ space, path }`
|
|
1728
|
+
* matching the SEMANTIC the WASM `parseRecapFromSiwe` emitter uses.
|
|
1729
|
+
*
|
|
1730
|
+
* Sol final continuation contract requirement 1: every producer AND consumer
|
|
1731
|
+
* of canonical four-part action IDs must parse resources the same way. The
|
|
1732
|
+
* on-wire structure of a TinyCloud ReCap resource is:
|
|
1733
|
+
*
|
|
1734
|
+
* `<space>/<short-service>[/<sub-path>]`
|
|
1735
|
+
*
|
|
1736
|
+
* where `<space>` is a `tinycloud:pkh:...` URN and `<short-service>` is the
|
|
1737
|
+
* unqualified service name (`kv`, `sql`, `capabilities`, …). WASM's
|
|
1738
|
+
* `parseRecapFromSiwe` returns `{ service: <short>, space: <space>, path: <sub-path OR "">}`
|
|
1739
|
+
* — the service segment is NEVER part of the `path`. Prior consumer parsing
|
|
1740
|
+
* left the service segment INSIDE `path`, which produced a four-part ID
|
|
1741
|
+
* different from what OpenKey emits (which uses WASM's `entry.path`
|
|
1742
|
+
* directly). That divergence caused every real production round-trip to
|
|
1743
|
+
* fail the `grantedFourPartIndex.get(rawKey)` lookup silently — Sol
|
|
1744
|
+
* explicitly cited this as blocking approval.
|
|
1745
|
+
*
|
|
1746
|
+
* Behaviour:
|
|
1747
|
+
* - Non-`tinycloud:` URIs are returned unchanged as `{ space: uri, path: "" }`.
|
|
1748
|
+
* - `tinycloud:<...>` without any `/` → `{ space: uri, path: "" }`.
|
|
1749
|
+
* - `tinycloud:<...>/short` → `{ space, path: "" }` (service segment stripped).
|
|
1750
|
+
* - `tinycloud:<...>/short/rest...` → `{ space, path: "rest..." }`.
|
|
1751
|
+
*
|
|
1752
|
+
* This makes the consumer's canonical `path` byte-for-byte equal to WASM's
|
|
1753
|
+
* `entry.path`, and therefore byte-for-byte equal to the `path` OpenKey's
|
|
1754
|
+
* `computeActionKey` uses when emitting four-part IDs.
|
|
1755
|
+
*/
|
|
1756
|
+
declare function parseCanonicalRecapResource(resource: string): {
|
|
1757
|
+
space: string;
|
|
1758
|
+
path: string;
|
|
1759
|
+
};
|
|
1760
|
+
/**
|
|
1761
|
+
* Immutable SIWE header fields the OpenKey widget is NOT allowed to alter.
|
|
1762
|
+
* The user may narrow capabilities (which changes the ReCap `urn:recap:`
|
|
1763
|
+
* resource AND — because the WASM statement is a human-readable rendering of
|
|
1764
|
+
* the ReCap — the statement text along with it). But domain/address/URI/
|
|
1765
|
+
* version/chainId/nonce/issuedAt bind the message to a specific relying party
|
|
1766
|
+
* plus a specific session-key request and MUST come back identical byte-for-byte.
|
|
1767
|
+
*
|
|
1768
|
+
* `statement` is intentionally NOT part of the immutable set: it derives from
|
|
1769
|
+
* the ReCap and MUST be allowed to change when the ReCap changes. The
|
|
1770
|
+
* capability-subset check (via `unauthorizedRecapCapabilities`) is the
|
|
1771
|
+
* authoritative gate for what the widget was allowed to change.
|
|
1772
|
+
*/
|
|
1773
|
+
interface ImmutableSiweFields {
|
|
1774
|
+
domain?: string;
|
|
1775
|
+
address?: string;
|
|
1776
|
+
uri?: string;
|
|
1777
|
+
version?: string;
|
|
1778
|
+
chainId?: string;
|
|
1779
|
+
nonce?: string;
|
|
1780
|
+
issuedAt?: string;
|
|
1781
|
+
expirationTime?: string;
|
|
1782
|
+
notBefore?: string;
|
|
1783
|
+
requestId?: string;
|
|
1784
|
+
statement?: string;
|
|
1785
|
+
nonRecapResources?: string;
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* Extract the header fields that must be preserved byte-for-byte between the
|
|
1789
|
+
* caller's original prepared SIWE and the bytes OpenKey actually signed. Uses
|
|
1790
|
+
* line-based parsing tolerant of the specific format the WASM emitter uses:
|
|
1791
|
+
*
|
|
1792
|
+
* <domain> wants you to sign in with your Ethereum account:
|
|
1793
|
+
* <address>
|
|
1794
|
+
*
|
|
1795
|
+
* <statement>
|
|
1796
|
+
*
|
|
1797
|
+
* URI: <uri>
|
|
1798
|
+
* Version: <n>
|
|
1799
|
+
* Chain ID: <n>
|
|
1800
|
+
* Nonce: <hex>
|
|
1801
|
+
* Issued At: <iso8601>
|
|
1802
|
+
* Resources:
|
|
1803
|
+
* - <resource1>
|
|
1804
|
+
* ...
|
|
1805
|
+
*
|
|
1806
|
+
* Returns fields it was able to identify; downstream comparison is field-by-field
|
|
1807
|
+
* so a missing field on both sides is treated as equal.
|
|
1808
|
+
*/
|
|
1809
|
+
declare function extractImmutableSiweFields(siwe: string): ImmutableSiweFields;
|
|
1810
|
+
/**
|
|
1811
|
+
* Diff two SIWE header field sets. Returns the field names that differ. An
|
|
1812
|
+
* empty array means the caller's prepared header and the signed header agree
|
|
1813
|
+
* on every immutable field.
|
|
1814
|
+
*
|
|
1815
|
+
* Sol final continuation contract requirement 2: `statement` is
|
|
1816
|
+
* ReCap-DERIVED whenever the SIWE carries a `urn:recap:` resource — the
|
|
1817
|
+
* WASM `prepareSession` emitter renders "I further authorize the stated URI
|
|
1818
|
+
* to perform the following actions..." from the ReCap contents and DROPS
|
|
1819
|
+
* any caller-supplied `statement`. Narrowing the ReCap therefore ALWAYS
|
|
1820
|
+
* changes the statement, and treating statement as byte-immutable made
|
|
1821
|
+
* every legitimate narrowing fail immediate rejection — the exact
|
|
1822
|
+
* production round-trip failure Sol cited as blocking approval.
|
|
1823
|
+
*
|
|
1824
|
+
* Correct semantics:
|
|
1825
|
+
* - For ReCap-bearing SIWEs, statement is validated indirectly via the
|
|
1826
|
+
* `unauthorizedRecapCapabilities` subset check (the ReCap the
|
|
1827
|
+
* statement renders is the true authoritative narrowing check).
|
|
1828
|
+
* - For plain (no-ReCap) SIWEs, statement IS caller-authored and MUST
|
|
1829
|
+
* remain byte-for-byte identical.
|
|
1830
|
+
*
|
|
1831
|
+
* Callers signal which regime applies via `options.originalHasRecap`.
|
|
1832
|
+
* When omitted (legacy callers), statement is included in the diff — the
|
|
1833
|
+
* safer default for non-ReCap flows.
|
|
1834
|
+
*/
|
|
1835
|
+
declare function diffImmutableSiweFields(original: ImmutableSiweFields, signed: ImmutableSiweFields, options?: {
|
|
1836
|
+
originalHasRecap?: boolean;
|
|
1837
|
+
}): string[];
|
|
1838
|
+
/**
|
|
1839
|
+
* Parsed ReCap attenuation payload. Keyed by resource URI ("space/service/path"),
|
|
1840
|
+
* each value is a map of action -> list of caveat objects. Consumers care about
|
|
1841
|
+
* subset comparisons on (resource, action) pairs; caveats are compared shallowly
|
|
1842
|
+
* (any narrowing of caveats is treated as still a subset when the parent grants
|
|
1843
|
+
* the same action).
|
|
1844
|
+
*/
|
|
1845
|
+
interface RecapAttenuation {
|
|
1846
|
+
[resource: string]: {
|
|
1847
|
+
[action: string]: unknown[];
|
|
1848
|
+
};
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Extract the union of `att` maps from every `urn:recap:` resource in a SIWE
|
|
1852
|
+
* message. Returns an empty object if the SIWE contains no ReCap resources
|
|
1853
|
+
* (which is legal — a plain SIWE grants nothing beyond the message itself).
|
|
1854
|
+
*
|
|
1855
|
+
* Throws if a `urn:recap:` payload is present but cannot be decoded as
|
|
1856
|
+
* base64url JSON with an `att` object. Silent tolerance would let a compromised
|
|
1857
|
+
* OpenKey response bypass the subset check by returning garbage.
|
|
1858
|
+
*/
|
|
1859
|
+
declare function extractRecapAttenuations(siwe: string): RecapAttenuation;
|
|
1860
|
+
/**
|
|
1861
|
+
* Prove that `child` grants are a subset of `parent` grants. Returns a list of
|
|
1862
|
+
* unauthorized (resource, action) pairs — empty means every capability in
|
|
1863
|
+
* `child` was authorized by `parent`.
|
|
1864
|
+
*
|
|
1865
|
+
* "Subset" here means:
|
|
1866
|
+
* 1. Every (resource, action) pair the child grants must appear in the parent.
|
|
1867
|
+
* 2. Every caveat object in the child's caveat list for a given (resource,
|
|
1868
|
+
* action) must be present (by deep-equality with sorted-key canonicalization)
|
|
1869
|
+
* in the parent's caveat list for the same pair. That is: child caveats ⊆
|
|
1870
|
+
* parent caveats as sets of caveat objects.
|
|
1871
|
+
*
|
|
1872
|
+
* ReCap caveat semantics: a caveat list is a DISJUNCTION of alternatives — the
|
|
1873
|
+
* caller may exercise the ability under ANY listed caveat. Broadening a list
|
|
1874
|
+
* (adding a new alternative not in parent) is a violation. Removing an
|
|
1875
|
+
* alternative is fine (narrowing). Replacing a restrictive alternative with a
|
|
1876
|
+
* less-restrictive one is a violation (the replacement is a different object).
|
|
1877
|
+
*
|
|
1878
|
+
* The conservative safe rule: reject if child has ANY caveat not present in the
|
|
1879
|
+
* parent's caveat set. This catches:
|
|
1880
|
+
* - Removed caveats (parent had 1+, child has 0): the empty list is "no
|
|
1881
|
+
* restriction" which is broader than any restriction — reject.
|
|
1882
|
+
* - Broadened caveats (parent had caveat X, child has caveat Y not equal to
|
|
1883
|
+
* X): Y is a new alternative — reject.
|
|
1884
|
+
* - Incompatible duplicate caveats (child adds a new caveat alongside a
|
|
1885
|
+
* parent one): the new caveat is unauthorized — reject.
|
|
1886
|
+
*
|
|
1887
|
+
* Special case: when both parent and child have empty caveat lists, that means
|
|
1888
|
+
* neither imposes restrictions, and the child is a subset.
|
|
1889
|
+
*/
|
|
1890
|
+
declare function unauthorizedRecapCapabilities(child: RecapAttenuation, parent: RecapAttenuation): Array<{
|
|
1891
|
+
resource: string;
|
|
1892
|
+
action: string;
|
|
1893
|
+
}>;
|
|
1894
|
+
|
|
1565
1895
|
/**
|
|
1566
1896
|
* Interface for an extension to TCW.
|
|
1567
1897
|
* This is the platform-agnostic subset — browser-coupled extensions
|
|
@@ -3016,4 +3346,4 @@ declare const EXPIRY: {
|
|
|
3016
3346
|
declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
|
|
3017
3347
|
type ExpiryTier = keyof typeof EXPIRY;
|
|
3018
3348
|
|
|
3019
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountApplicationRegisterOptions, type AccountDelegation, type AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, type AccountDelegationRevokeOptions, type AccountIndexEnsureResult, type AccountIndexRebuildResult, type AccountIndexStatus, type AccountIndexedReadOptions, AccountService, type AccountServiceConfig, type AccountSpace, type AccountSpaceListOptions, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, CaveatedDelegationUnsupportedError, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, CreateDelegationParams, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_LOCAL_NODE_PIN_STORAGE_KEY, DEFAULT_LOCAL_NODE_URL, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, Delegation, DelegationManager, DelegationRevocationReceipt, type DidCacheKeyOptions, type DidEqualsOptions, type DiscoverLocalTinyCloudNodeOptions, type DiscoveredLocalTinyCloudNode, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, GenerateShareParams, ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, LOCAL_LINK_HOST_SUFFIX, LOCAL_LINK_PROBE_TIMEOUT_MS, LOCAL_LOOPBACK_PROBE_TIMEOUT_MS, type LocalNodeIdentityStore, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type OpenKeyCallbackStrategy, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type RegisterBatchSuccess, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SECRETS_SPACE, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, ShareLink, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, SpaceInfo, SpaceService, type SpaceServiceConfig, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VersionCheckError, type WasmRecapEntry, type WebStorageLike, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, composeManifestRequest, createInMemoryLocalNodeIdentityStore, createLocalStorageLocalNodeIdentityStore, createOpenKeyCallbackSigningStrategy, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, discoverLocalTinyCloudNode, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, recapCaveatsEqual, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
|
|
3349
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountApplicationRegisterOptions, type AccountDelegation, type AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, type AccountDelegationRevokeOptions, type AccountIndexEnsureResult, type AccountIndexRebuildResult, type AccountIndexStatus, type AccountIndexedReadOptions, AccountService, type AccountServiceConfig, type AccountSpace, type AccountSpaceListOptions, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, CREDENTIAL_ERROR_CODES, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityPresentationEnvelopeV1, CaveatedDelegationUnsupportedError, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, CreateDelegationParams, CredentialError, type CredentialErrorCode, CredentialFlowDescriptor, CredentialHolderBinding, CredentialIssuerMetadata, CredentialRequirement, CredentialStorageReceipt, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_LOCAL_NODE_PIN_STORAGE_KEY, DEFAULT_LOCAL_NODE_URL, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, Delegation, DelegationManager, DelegationRevocationReceipt, type DidCacheKeyOptions, type DidEqualsOptions, type DiscoverLocalTinyCloudNodeOptions, type DiscoveredLocalTinyCloudNode, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, GenerateShareParams, ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type ImmutableSiweFields, IssuedCredentialEnvelope, LOCAL_LINK_HOST_SUFFIX, LOCAL_LINK_PROBE_TIMEOUT_MS, LOCAL_LOOPBACK_PROBE_TIMEOUT_MS, type LocalNodeIdentityStore, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, OPENKEY_ACTION_ID_SEPARATOR, type OpenKeyCallbackStrategy, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type RecapAttenuation, type RegisterBatchSuccess, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SECRETS_SPACE, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, ShareLink, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, SpaceInfo, SpaceService, type SpaceServiceConfig, StoredCredentialRecord, type SubsetCheckResult, TinyCloud, type TinyCloudAuthorizationRequestV1, type TinyCloudAuthorizationResultV1, type TinyCloudConfig, type TinyCloudEffectiveGrantV1, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VerifiedCredential, VersionCheckError, type WasmRecapEntry, type WebStorageLike, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalDigest, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, composeManifestRequest, createHolderBinding, createInMemoryLocalNodeIdentityStore, createLocalStorageLocalNodeIdentityStore, createOpenKeyCallbackSigningStrategy, createSpaceService, createStorageReceipt, createStoredCredentialRecord, credentialEndpointPath, credentialError, credentialIndexKey, credentialMatchesRequirement, credentialRecordKey, credentialRequirementDigest, decodeBase64Url, defaultSignStrategy, defaultSpaceCreationHandler, descriptorSatisfiesRequirement, didCacheKey, didEquals, diffImmutableSiweFields, discoverLocalTinyCloudNode, encodeBase64Url, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, extractImmutableSiweFields, extractRecapAttenuations, fetchLocationRecord, fetchPeerId, holderBindingCanonicalBytes, holderBindingSigningBytes, httpUrlToMultiaddr, isCapabilitySubset, isDigest, isEvmAddress, isPlausibleOpenKeyActionId, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseCanonicalRecapResource, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, recapCaveatsEqual, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, sha256Base64Url, signLocationRecord, submitHostDelegation, unauthorizedRecapCapabilities, validateAuthorizationResultV1, validateClientSession, validateCredentialFlowDescriptor, validateCredentialHolderBinding, validateCredentialRequirement, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyEip191MessageSignature, verifyIssuedCredential, verifyLocationRecord, verifyStorageReceipt };
|