@tinycloud/sdk-core 3.0.0-beta.6 → 3.0.0-beta.8
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/{credential-admission-BVUC6kdw.d.cts → credential-admission-CFjUChF8.d.cts} +56 -1
- package/dist/{credential-admission-BgvwOTIV.d.ts → credential-admission-DIEPgQ0o.d.ts} +56 -1
- package/dist/delegations/index.cjs +32 -60
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +2 -2
- package/dist/delegations/index.d.ts +2 -2
- package/dist/delegations/index.js +32 -60
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +192 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +193 -67
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +159 -7
- package/dist/policy/index.cjs.map +1 -1
- package/dist/policy/index.d.cts +2 -2
- package/dist/policy/index.d.ts +2 -2
- package/dist/policy/index.js +159 -7
- package/dist/policy/index.js.map +1 -1
- package/dist/{recipient-types.schema-BdCeDExl.d.cts → recipient-types.schema-DjmM_yJu.d.cts} +37 -37
- package/dist/{recipient-types.schema-BdCeDExl.d.ts → recipient-types.schema-DjmM_yJu.d.ts} +37 -37
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, B as BuildPolicyCredentialPresentationV3Input,
|
|
2
|
+
import { bo as CredentialHolderBinding, bp as CredentialFlowDescriptor, bq as CredentialRequirement, br as StoredCredentialRecord, bs as VerifiedCredential, bt as CredentialStorageReceipt, bu as IssuedCredentialEnvelope, bv as CredentialIssuerMetadata } from './credential-admission-CFjUChF8.cjs';
|
|
3
|
+
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, d as AttestedEnforcerBindingV2, B as BuildPolicyCredentialPresentationV3Input, e as BuildPolicyCredentialPresentationV4Input, C as CONTENT_SOURCE_V1_DOMAIN, bw as CREDENTIAL_ACQUISITION_PROTOCOL, bx as CREDENTIAL_CONTRACT_VERSION, by as CREDENTIAL_FORMAT, bw as CREDENTIAL_PROTOCOL, bz as CREDENTIAL_STEP_REGISTRY_VERSION, g as CompactUcanAuthorizationV1, bA as CredentialClaimDescriptor, bB as CredentialEndpointId, bC as CredentialInputDescriptor, bD as CredentialProgressEvent, bE as CredentialStepDescriptor, bF as CredentialStepType, bG as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, h as EIP191_JCS_SIGNATURE_SUITE, bH as HOLDER_BINDING_DOMAIN, bI as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, i as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, j as POLICY_CAPABILITY_V1_DOMAIN, k as POLICY_CAPABILITY_V1_SCHEMA, l as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, m as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, n as POLICY_ENGINE_RECORD_SCHEMA, o as POLICY_PRESENTATION_V3_DOMAIN, p as POLICY_PRESENTATION_V3_SCHEMA, q as POLICY_PRESENTATION_V4_DOMAIN, r as POLICY_PRESENTATION_V4_SCHEMA, s as POLICY_SCHEMA, t as POLICY_SESSION_UCAN_V1_PROFILE, u as POLICY_STATUS_SCHEMA, v as POLICY_V1_DOMAIN, w as POLICY_V1_SCHEMA, x as POLICY_V2_DOMAIN, y as POLICY_V2_SCHEMA, a as Policy, D as PolicyCredentialAdmissionV3, F as PolicyCredentialAdmissionV4, G as PolicyCredentialPresentationV3, H as PolicyCredentialPresentationV4, I as PolicyCredentialRequirementV1, P as PolicyEngineRecord, K as PolicyRootStatusV3, O as PolicyRootV3, Q as PolicySessionUcanFactV1, R as PolicySessionUcanV1, T as PolicyStatus, V as ROOT_REVOCATION_V1_DOMAIN, W as ROOT_REVOCATION_V1_SCHEMA, X as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, Y as ROOT_STATUS_RENEWAL_V1_DOMAIN, Z as ROOT_STATUS_V1_DOMAIN, _ as RegisterPolicyV3Input, $ as RegisterPolicyV3Receipt, a0 as SignCompactUcanAuthorizationInput, a1 as SignCompactUcanRootAuthorizationInput, a2 as SignatureMaterialError, a3 as SignatureSuite, a4 as SignatureVerificationError, a5 as SignedObjectCanonicalizationError, a6 as SignedObjectDigestError, a7 as SignedObjectErrorCode, a8 as SignedObjectIdError, a9 as SignedObjectKind, aa as SignedObjectMaterial, ab as SignedObjectProfileError, ac as SignedObjectSchemaError, ad as SignedObjectSignature, S as SignedObjectSigner, ae as SignedObjectVerificationResult, af as SignedPolicyObject, ag as SigningKeyBindingError, ah as UnifiedContentSource, ai as UnifiedEncryptionCapability, aj as UnifiedKvCapability, ak as UnifiedNativeCapability, al as UnifiedPolicyCapability, am as UnifiedPolicyV1, an as UnifiedPolicyV2, ao as UnifiedResourceSelector, ap as UnsignedPolicy, aq as UnsignedPolicyCredentialPresentationV4, U as UnsignedPolicyEngineRecord, ar as UnsignedPolicyObject, as as UnsignedPolicyStatus, at as UnsignedUnifiedPolicyV2, au as UnsupportedSignatureSuiteError, av as admitPolicyCredentialV3, aw as admitPolicyCredentialV4, ax as buildPolicyCredentialPresentationV3, ay as buildPolicyCredentialPresentationV4, az as canonicalizeSignedObjectUnsigned, aA as canonicalizeUnifiedPolicyCapability, aB as compactAttenuationContains, aC as contentSourceDigestHex, aD as createAndSignPolicy, aE as createAndSignPolicyEngineRecord, aF as createAndSignPolicyStatus, aG as createAndSignSignedObject, aJ as deriveSignedObjectMaterial, aK as getPolicyRootStatusV3, aL as issuedCredentialEnvelopeFromVerified, aN as normalizeUnifiedPolicyCapability, aO as parseCompactUcanAuthorization, aP as parsePolicySessionUcan, aQ as policyCidFromCanonicalBytes, aR as policyDigestHex, aS as policyIdForDigestHex, aT as policyV2DigestHex, aU as projectUnifiedPolicyCapabilities, aV as projectUnifiedPolicyCapability, aW as registerPolicyV3, aX as renewPolicyRootStatusV3, aZ as revokePolicyRootV3, a_ as signCompactUcanAuthorization, a$ as signCompactUcanRootAuthorization, b0 as signPolicyCredentialPresentationV4, b1 as signedObjectIdFor, b2 as toSignedObjectError, b3 as unifiedNativeProjectionHashHex, b4 as unifiedPolicyCapabilityContains, b5 as unifiedPolicyCapabilityDigestHex, b6 as unifiedPolicyCapabilityFromNative, b7 as validatePolicyCredentialRequirementV1, b8 as validatePolicyEngineRecordSigned, b9 as validatePolicyEngineRecordSignedShape, ba as validatePolicyEngineRecordUnsigned, bb as validatePolicySigned, bc as validatePolicySignedShape, bd as validatePolicyStatusSigned, be as validatePolicyStatusSignedShape, bf as validatePolicyStatusUnsigned, bg as validatePolicyUnsigned, bh as validateUnifiedPolicyV2, bi as verifyPolicy, bj as verifyPolicyEngineRecord, bk as verifyPolicyRootRevocationV3, bl as verifyPolicyRootStatusCheckpointV3, bm as verifyPolicyStatus, bn as verifySignedObject } from './credential-admission-CFjUChF8.cjs';
|
|
4
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';
|
|
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';
|
|
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, ParsedSecretCatalogKey, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretCatalogEntry, 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, parseSecretCatalogKey, resolveSecretListPrefix, resolveSecretPath, serviceError, tinyCloudDebugLogger, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
6
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';
|
|
7
|
-
import {
|
|
8
|
-
export { c as AccountDelegationRecord, d as AccountDelegationResource, C as CapabilityEntry,
|
|
7
|
+
import { p as Delegation, f as CreateDelegationParams, G as GenerateShareParams, aI as ShareLink, bi as SpaceInfo, I as ICapabilityKeyRegistry, H as ISharingService, D as DelegationManager, b as AccountDelegationQueryOptions, A as AccountDelegationPage, z as DelegationRevocationReceipt } from './recipient-types.schema-DjmM_yJu.cjs';
|
|
8
|
+
export { c as AccountDelegationRecord, d as AccountDelegationResource, C as CREDENTIAL_INVITATION_REQUEST_DOMAIN, e as CapabilityEntry, bW as CapabilityKeyRegistry, bX as CapabilityKeyRegistryErrorCode, bY as CapabilityKeyRegistryErrorCodes, g as CreateDelegationWasmParams, h as CreateDelegationWasmResult, i as CreateOwnerDelegationParams, j as CredentialInvitationRequest, k as DELIVERY_ADMISSION_DOMAIN, l as DelegateReceivedShareParams, m as DelegatedResource, n as DelegatedShareAccess, o as DelegatedShareKey, q as DelegationApiResponse, r as DelegationChain, s as DelegationChainV2, t as DelegationDirection, a as DelegationError, u as DelegationErrorCode, v as DelegationErrorCodes, w as DelegationFilters, x as DelegationManagerConfig, y as DelegationRecord, R as DelegationResult, B as DelegationStatus, E as DeliveryAdmission, F as EncodedShareData, J as IngestOptions, K as JWK, L as KeyInfo, M as KeyProvider, N as KeyType, O as MAX_CONTENT_BYTES, P as MAX_SEALED_SHARE_CONTENT_BYTES, Q as MAX_SHARE_ARTIFACT_BYTES, S as MAX_SHARE_CONTENT_BYTES, T as MemorySenderShareKeyStorage, U as MemorySenderShareRecordStorage, V as MemoryShareCache, W as OwnerDelegationPermission, X as OwnerDelegationReceipt, Y as OwnerShareAction, Z as OwnerShareDecryption, _ as OwnerShareMatcher, $ as OwnerSharePolicyRegistration, a0 as OwnerSharePolicyRegistrationReceipt, a1 as OwnerSharePolicyV2, a2 as PortableDelegationImportReceipt, a3 as ReceiveOptions, a4 as RegisterOwnerSharePolicyParams, a5 as SHARE_DELIVERY_AUTHORIZATION_DOMAIN, a6 as SenderShareKeyStorage, a7 as SenderShareRecord, a8 as SenderShareRecordStorage, a9 as SenderShareRevocationScope, aa as SenderShareStore, ab as ShareAccess, ac as ShareAccessError, ad as ShareAccessV2, ae as ShareAction, ag as ShareAddressedDelegationEnvelopeV2, ah as ShareAddressedDelegationEnvelopeV2Schema, ai as ShareAddressedDelegationRequestV2, aj as ShareAddressedDelegationRequestV2Schema, ak as ShareAddressedDelegationResponseV2, al as ShareAddressedDelegationResponseV2Schema, am as ShareAddressedRecipientMatcher, an as ShareArtifactInput, ao as ShareArtifactResult, ap as ShareArtifactV2, aq as ShareCache, ar as ShareCacheEntry, as as ShareCacheKey, at as ShareCacheMetadata, au as ShareCapabilityLike, av as ShareConflict, aw as ShareContentMetadata, ax as ShareContentSource, ay as ShareDeliveryAuthorization, az as ShareDeliveryAuthorizationReceipt, aA as ShareDeliveryAuthorizationRequest, aB as ShareDeliveryAuthorizationV3Receipt, aC as ShareDeliveryAuthorizationV3Request, aD as ShareDetachedProof, aE as ShareEnvelopeError, aF as ShareEnvelopeV2, aG as ShareExpiryBounds, aH as ShareKvContentSource, aJ as ShareLinkData, aK as ShareLinkLocation, aL as ShareListEntry, aM as ShareListResult, aN as ShareNativeAction, aO as ShareNativeInvokeEnvelopeV1, aP as ShareNativeInvokeErrorResult, aQ as ShareNativeInvokeInput, aR as ShareNativeInvokeResult, aS as ShareNativeInvokeSuccessResult, aT as ShareNativeResponse, aU as ShareNativeResponseSchema, aV as SharePolicy, aW as SharePolicyBinding, aX as SharePolicySession, aY as SharePolicySessionV1, aZ as SharePolicySessionWireV1, a_ as SharePortableDelegation, a$ as ShareReadInvocationV1, b0 as ShareReadResult, b1 as ShareRecipientClient, b2 as ShareRecipientClientOptions, b4 as ShareRecipientPolicy, b6 as ShareRecipientResult, b7 as ShareRecipientTarget, b9 as ShareResource, bb as ShareSaveOptions, bc as ShareSchema, bd as ShareSqlContentSource, be as ShareWireAction, bf as SharingService, bg as SharingServiceConfig, bh as SignedDelegation, bj as SpaceOwnership, bZ as StoredDelegationChain, bk as ValidateShareDeliveryAuthorizationExpected, bl as VerifyShareEnvelopeOptions, bm as canonicalOwnerSharePolicy, bn as computeOwnerShareRegistrationCid, bo as computeShareCid, b_ as createCapabilityKeyRegistry, bp as createDelegatedShareKey, bq as createPolicyEnforcementDelegation, br as createShareArtifact, bs as createShareArtifactAsync, bt as createSharePolicy, bu as createSharingService, bv as decryptShareBytesAsync, bw as delegatePortablePolicySession, bx as encodeInlineShareUrl, by as encodeShareArtifact, bz as encodeShareUrl, bA as encryptShareBytes, bB as encryptShareBytesAsync, bC as importPortableDelegation, bD as intersectShareCapabilities, bE as isV2ShareLink, bF as normalizeShareActions, bG as normalizeShareRecipientTarget, bH as normalizeShareResource, bI as parsePortableDelegation, bJ as parseShareArtifact, bK as parseShareUrl, bL as restoreDelegatedShareKey, bM as serializePortableDelegation, bN as shareCapabilityAllows, bO as shareDeliveryTrustedKid, bP as signShareEnvelope, bQ as validateOwnerSharePolicyRegistration, bR as validateOwnerSharePolicyRegistrationBytes, bS as validateShareDeliveryAuthorizationBytes, bT as validateShareDeliveryAuthorizationV3Bytes, bU as verifyShareCid, bV as verifyShareEnvelope } from './recipient-types.schema-DjmM_yJu.cjs';
|
|
9
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
10
|
export { a as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-BjzXwtNw.cjs';
|
|
11
11
|
export { SiweMessage } from 'siwe';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, B as BuildPolicyCredentialPresentationV3Input,
|
|
2
|
+
import { bo as CredentialHolderBinding, bp as CredentialFlowDescriptor, bq as CredentialRequirement, br as StoredCredentialRecord, bs as VerifiedCredential, bt as CredentialStorageReceipt, bu as IssuedCredentialEnvelope, bv as CredentialIssuerMetadata } from './credential-admission-DIEPgQ0o.js';
|
|
3
|
+
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, d as AttestedEnforcerBindingV2, B as BuildPolicyCredentialPresentationV3Input, e as BuildPolicyCredentialPresentationV4Input, C as CONTENT_SOURCE_V1_DOMAIN, bw as CREDENTIAL_ACQUISITION_PROTOCOL, bx as CREDENTIAL_CONTRACT_VERSION, by as CREDENTIAL_FORMAT, bw as CREDENTIAL_PROTOCOL, bz as CREDENTIAL_STEP_REGISTRY_VERSION, g as CompactUcanAuthorizationV1, bA as CredentialClaimDescriptor, bB as CredentialEndpointId, bC as CredentialInputDescriptor, bD as CredentialProgressEvent, bE as CredentialStepDescriptor, bF as CredentialStepType, bG as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, h as EIP191_JCS_SIGNATURE_SUITE, bH as HOLDER_BINDING_DOMAIN, bI as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, i as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, j as POLICY_CAPABILITY_V1_DOMAIN, k as POLICY_CAPABILITY_V1_SCHEMA, l as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, m as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, n as POLICY_ENGINE_RECORD_SCHEMA, o as POLICY_PRESENTATION_V3_DOMAIN, p as POLICY_PRESENTATION_V3_SCHEMA, q as POLICY_PRESENTATION_V4_DOMAIN, r as POLICY_PRESENTATION_V4_SCHEMA, s as POLICY_SCHEMA, t as POLICY_SESSION_UCAN_V1_PROFILE, u as POLICY_STATUS_SCHEMA, v as POLICY_V1_DOMAIN, w as POLICY_V1_SCHEMA, x as POLICY_V2_DOMAIN, y as POLICY_V2_SCHEMA, a as Policy, D as PolicyCredentialAdmissionV3, F as PolicyCredentialAdmissionV4, G as PolicyCredentialPresentationV3, H as PolicyCredentialPresentationV4, I as PolicyCredentialRequirementV1, P as PolicyEngineRecord, K as PolicyRootStatusV3, O as PolicyRootV3, Q as PolicySessionUcanFactV1, R as PolicySessionUcanV1, T as PolicyStatus, V as ROOT_REVOCATION_V1_DOMAIN, W as ROOT_REVOCATION_V1_SCHEMA, X as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, Y as ROOT_STATUS_RENEWAL_V1_DOMAIN, Z as ROOT_STATUS_V1_DOMAIN, _ as RegisterPolicyV3Input, $ as RegisterPolicyV3Receipt, a0 as SignCompactUcanAuthorizationInput, a1 as SignCompactUcanRootAuthorizationInput, a2 as SignatureMaterialError, a3 as SignatureSuite, a4 as SignatureVerificationError, a5 as SignedObjectCanonicalizationError, a6 as SignedObjectDigestError, a7 as SignedObjectErrorCode, a8 as SignedObjectIdError, a9 as SignedObjectKind, aa as SignedObjectMaterial, ab as SignedObjectProfileError, ac as SignedObjectSchemaError, ad as SignedObjectSignature, S as SignedObjectSigner, ae as SignedObjectVerificationResult, af as SignedPolicyObject, ag as SigningKeyBindingError, ah as UnifiedContentSource, ai as UnifiedEncryptionCapability, aj as UnifiedKvCapability, ak as UnifiedNativeCapability, al as UnifiedPolicyCapability, am as UnifiedPolicyV1, an as UnifiedPolicyV2, ao as UnifiedResourceSelector, ap as UnsignedPolicy, aq as UnsignedPolicyCredentialPresentationV4, U as UnsignedPolicyEngineRecord, ar as UnsignedPolicyObject, as as UnsignedPolicyStatus, at as UnsignedUnifiedPolicyV2, au as UnsupportedSignatureSuiteError, av as admitPolicyCredentialV3, aw as admitPolicyCredentialV4, ax as buildPolicyCredentialPresentationV3, ay as buildPolicyCredentialPresentationV4, az as canonicalizeSignedObjectUnsigned, aA as canonicalizeUnifiedPolicyCapability, aB as compactAttenuationContains, aC as contentSourceDigestHex, aD as createAndSignPolicy, aE as createAndSignPolicyEngineRecord, aF as createAndSignPolicyStatus, aG as createAndSignSignedObject, aJ as deriveSignedObjectMaterial, aK as getPolicyRootStatusV3, aL as issuedCredentialEnvelopeFromVerified, aN as normalizeUnifiedPolicyCapability, aO as parseCompactUcanAuthorization, aP as parsePolicySessionUcan, aQ as policyCidFromCanonicalBytes, aR as policyDigestHex, aS as policyIdForDigestHex, aT as policyV2DigestHex, aU as projectUnifiedPolicyCapabilities, aV as projectUnifiedPolicyCapability, aW as registerPolicyV3, aX as renewPolicyRootStatusV3, aZ as revokePolicyRootV3, a_ as signCompactUcanAuthorization, a$ as signCompactUcanRootAuthorization, b0 as signPolicyCredentialPresentationV4, b1 as signedObjectIdFor, b2 as toSignedObjectError, b3 as unifiedNativeProjectionHashHex, b4 as unifiedPolicyCapabilityContains, b5 as unifiedPolicyCapabilityDigestHex, b6 as unifiedPolicyCapabilityFromNative, b7 as validatePolicyCredentialRequirementV1, b8 as validatePolicyEngineRecordSigned, b9 as validatePolicyEngineRecordSignedShape, ba as validatePolicyEngineRecordUnsigned, bb as validatePolicySigned, bc as validatePolicySignedShape, bd as validatePolicyStatusSigned, be as validatePolicyStatusSignedShape, bf as validatePolicyStatusUnsigned, bg as validatePolicyUnsigned, bh as validateUnifiedPolicyV2, bi as verifyPolicy, bj as verifyPolicyEngineRecord, bk as verifyPolicyRootRevocationV3, bl as verifyPolicyRootStatusCheckpointV3, bm as verifyPolicyStatus, bn as verifySignedObject } from './credential-admission-DIEPgQ0o.js';
|
|
4
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';
|
|
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';
|
|
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, ParsedSecretCatalogKey, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretCatalogEntry, 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, parseSecretCatalogKey, resolveSecretListPrefix, resolveSecretPath, serviceError, tinyCloudDebugLogger, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
6
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.js';
|
|
7
|
-
import {
|
|
8
|
-
export { c as AccountDelegationRecord, d as AccountDelegationResource, C as CapabilityEntry,
|
|
7
|
+
import { p as Delegation, f as CreateDelegationParams, G as GenerateShareParams, aI as ShareLink, bi as SpaceInfo, I as ICapabilityKeyRegistry, H as ISharingService, D as DelegationManager, b as AccountDelegationQueryOptions, A as AccountDelegationPage, z as DelegationRevocationReceipt } from './recipient-types.schema-DjmM_yJu.js';
|
|
8
|
+
export { c as AccountDelegationRecord, d as AccountDelegationResource, C as CREDENTIAL_INVITATION_REQUEST_DOMAIN, e as CapabilityEntry, bW as CapabilityKeyRegistry, bX as CapabilityKeyRegistryErrorCode, bY as CapabilityKeyRegistryErrorCodes, g as CreateDelegationWasmParams, h as CreateDelegationWasmResult, i as CreateOwnerDelegationParams, j as CredentialInvitationRequest, k as DELIVERY_ADMISSION_DOMAIN, l as DelegateReceivedShareParams, m as DelegatedResource, n as DelegatedShareAccess, o as DelegatedShareKey, q as DelegationApiResponse, r as DelegationChain, s as DelegationChainV2, t as DelegationDirection, a as DelegationError, u as DelegationErrorCode, v as DelegationErrorCodes, w as DelegationFilters, x as DelegationManagerConfig, y as DelegationRecord, R as DelegationResult, B as DelegationStatus, E as DeliveryAdmission, F as EncodedShareData, J as IngestOptions, K as JWK, L as KeyInfo, M as KeyProvider, N as KeyType, O as MAX_CONTENT_BYTES, P as MAX_SEALED_SHARE_CONTENT_BYTES, Q as MAX_SHARE_ARTIFACT_BYTES, S as MAX_SHARE_CONTENT_BYTES, T as MemorySenderShareKeyStorage, U as MemorySenderShareRecordStorage, V as MemoryShareCache, W as OwnerDelegationPermission, X as OwnerDelegationReceipt, Y as OwnerShareAction, Z as OwnerShareDecryption, _ as OwnerShareMatcher, $ as OwnerSharePolicyRegistration, a0 as OwnerSharePolicyRegistrationReceipt, a1 as OwnerSharePolicyV2, a2 as PortableDelegationImportReceipt, a3 as ReceiveOptions, a4 as RegisterOwnerSharePolicyParams, a5 as SHARE_DELIVERY_AUTHORIZATION_DOMAIN, a6 as SenderShareKeyStorage, a7 as SenderShareRecord, a8 as SenderShareRecordStorage, a9 as SenderShareRevocationScope, aa as SenderShareStore, ab as ShareAccess, ac as ShareAccessError, ad as ShareAccessV2, ae as ShareAction, ag as ShareAddressedDelegationEnvelopeV2, ah as ShareAddressedDelegationEnvelopeV2Schema, ai as ShareAddressedDelegationRequestV2, aj as ShareAddressedDelegationRequestV2Schema, ak as ShareAddressedDelegationResponseV2, al as ShareAddressedDelegationResponseV2Schema, am as ShareAddressedRecipientMatcher, an as ShareArtifactInput, ao as ShareArtifactResult, ap as ShareArtifactV2, aq as ShareCache, ar as ShareCacheEntry, as as ShareCacheKey, at as ShareCacheMetadata, au as ShareCapabilityLike, av as ShareConflict, aw as ShareContentMetadata, ax as ShareContentSource, ay as ShareDeliveryAuthorization, az as ShareDeliveryAuthorizationReceipt, aA as ShareDeliveryAuthorizationRequest, aB as ShareDeliveryAuthorizationV3Receipt, aC as ShareDeliveryAuthorizationV3Request, aD as ShareDetachedProof, aE as ShareEnvelopeError, aF as ShareEnvelopeV2, aG as ShareExpiryBounds, aH as ShareKvContentSource, aJ as ShareLinkData, aK as ShareLinkLocation, aL as ShareListEntry, aM as ShareListResult, aN as ShareNativeAction, aO as ShareNativeInvokeEnvelopeV1, aP as ShareNativeInvokeErrorResult, aQ as ShareNativeInvokeInput, aR as ShareNativeInvokeResult, aS as ShareNativeInvokeSuccessResult, aT as ShareNativeResponse, aU as ShareNativeResponseSchema, aV as SharePolicy, aW as SharePolicyBinding, aX as SharePolicySession, aY as SharePolicySessionV1, aZ as SharePolicySessionWireV1, a_ as SharePortableDelegation, a$ as ShareReadInvocationV1, b0 as ShareReadResult, b1 as ShareRecipientClient, b2 as ShareRecipientClientOptions, b4 as ShareRecipientPolicy, b6 as ShareRecipientResult, b7 as ShareRecipientTarget, b9 as ShareResource, bb as ShareSaveOptions, bc as ShareSchema, bd as ShareSqlContentSource, be as ShareWireAction, bf as SharingService, bg as SharingServiceConfig, bh as SignedDelegation, bj as SpaceOwnership, bZ as StoredDelegationChain, bk as ValidateShareDeliveryAuthorizationExpected, bl as VerifyShareEnvelopeOptions, bm as canonicalOwnerSharePolicy, bn as computeOwnerShareRegistrationCid, bo as computeShareCid, b_ as createCapabilityKeyRegistry, bp as createDelegatedShareKey, bq as createPolicyEnforcementDelegation, br as createShareArtifact, bs as createShareArtifactAsync, bt as createSharePolicy, bu as createSharingService, bv as decryptShareBytesAsync, bw as delegatePortablePolicySession, bx as encodeInlineShareUrl, by as encodeShareArtifact, bz as encodeShareUrl, bA as encryptShareBytes, bB as encryptShareBytesAsync, bC as importPortableDelegation, bD as intersectShareCapabilities, bE as isV2ShareLink, bF as normalizeShareActions, bG as normalizeShareRecipientTarget, bH as normalizeShareResource, bI as parsePortableDelegation, bJ as parseShareArtifact, bK as parseShareUrl, bL as restoreDelegatedShareKey, bM as serializePortableDelegation, bN as shareCapabilityAllows, bO as shareDeliveryTrustedKid, bP as signShareEnvelope, bQ as validateOwnerSharePolicyRegistration, bR as validateOwnerSharePolicyRegistrationBytes, bS as validateShareDeliveryAuthorizationBytes, bT as validateShareDeliveryAuthorizationV3Bytes, bU as verifyShareCid, bV as verifyShareEnvelope } from './recipient-types.schema-DjmM_yJu.js';
|
|
9
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
10
|
export { a as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-BjzXwtNw.js';
|
|
11
11
|
export { SiweMessage } from 'siwe';
|
package/dist/index.js
CHANGED
|
@@ -3437,7 +3437,8 @@ var MAX_LEGACY_ENVELOPE_EXPIRES_AT = "2026-12-29T00:00:00Z";
|
|
|
3437
3437
|
var LAST_V2_READ_AT = "2027-01-05T00:00:00Z";
|
|
3438
3438
|
async function requestPolicyChallengeV3(input) {
|
|
3439
3439
|
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
3440
|
-
const
|
|
3440
|
+
const policyRuntimePath = policyRuntimeBasePath(input.policyRuntimePath);
|
|
3441
|
+
const response = await fetchFn(new URL(`${policyRuntimePath}/challenges`, input.nodeOrigin), {
|
|
3441
3442
|
method: "POST",
|
|
3442
3443
|
redirect: "error",
|
|
3443
3444
|
signal: input.signal,
|
|
@@ -3450,6 +3451,13 @@ async function requestPolicyChallengeV3(input) {
|
|
|
3450
3451
|
throw new Error("policy challenge binding is invalid");
|
|
3451
3452
|
return value;
|
|
3452
3453
|
}
|
|
3454
|
+
function policyRuntimeBasePath(value) {
|
|
3455
|
+
const path = value ?? "/policy/v3";
|
|
3456
|
+
if (!/^\/policy(?:\/[a-z0-9-]+)*$/.test(path)) {
|
|
3457
|
+
throw new Error("policy runtime path is invalid");
|
|
3458
|
+
}
|
|
3459
|
+
return path;
|
|
3460
|
+
}
|
|
3453
3461
|
function compactAttenuationForPolicyCapabilities(input) {
|
|
3454
3462
|
const attenuation = {};
|
|
3455
3463
|
for (const raw of input) {
|
|
@@ -3495,7 +3503,7 @@ function verifyPolicyRootStatusCheckpointV3(input) {
|
|
|
3495
3503
|
}
|
|
3496
3504
|
async function getPolicyRootStatusV3(input) {
|
|
3497
3505
|
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
3498
|
-
const response = await fetchFn(new URL(`/
|
|
3506
|
+
const response = await fetchFn(new URL(`/policy/v3/status/${encodeURIComponent(input.rootCid)}`, input.nodeOrigin), {
|
|
3499
3507
|
method: "GET",
|
|
3500
3508
|
redirect: "error",
|
|
3501
3509
|
headers: { accept: "application/json" }
|
|
@@ -3554,7 +3562,7 @@ async function renewPolicyRootStatusV3(input) {
|
|
|
3554
3562
|
};
|
|
3555
3563
|
const signature = await input.sign(sha2564(new TextEncoder().encode(ROOT_STATUS_RENEWAL_V1_DOMAIN + jcsCanonicalize(unsigned))));
|
|
3556
3564
|
if (signature.length !== 64) throw new Error("policy root renewal signature must be Ed25519");
|
|
3557
|
-
const response = await fetchFn(new URL("/
|
|
3565
|
+
const response = await fetchFn(new URL("/policy/v3/status", input.nodeOrigin), {
|
|
3558
3566
|
method: "POST",
|
|
3559
3567
|
redirect: "error",
|
|
3560
3568
|
headers: { accept: "application/json", "content-type": "application/json" },
|
|
@@ -3809,6 +3817,133 @@ function contentSourceDigestHex(input) {
|
|
|
3809
3817
|
)
|
|
3810
3818
|
);
|
|
3811
3819
|
}
|
|
3820
|
+
function exactObject(value, keys, label) {
|
|
3821
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
3822
|
+
throw new Error(`${label} is invalid`);
|
|
3823
|
+
}
|
|
3824
|
+
const record2 = value;
|
|
3825
|
+
if (Object.keys(record2).length !== keys.length || keys.some((key) => !Object.prototype.hasOwnProperty.call(record2, key))) {
|
|
3826
|
+
throw new Error(`${label} is invalid`);
|
|
3827
|
+
}
|
|
3828
|
+
return record2;
|
|
3829
|
+
}
|
|
3830
|
+
function didKeyEd25519PublicKey(value) {
|
|
3831
|
+
const principal = value.split("#", 1)[0];
|
|
3832
|
+
if (!principal.startsWith("did:key:")) {
|
|
3833
|
+
throw new Error("policy enforcer binding signer is invalid");
|
|
3834
|
+
}
|
|
3835
|
+
const material = base58btc.decode(principal.slice("did:key:".length));
|
|
3836
|
+
if (material.length !== 34 || material[0] !== 237 || material[1] !== 1) {
|
|
3837
|
+
throw new Error("policy enforcer binding signer is invalid");
|
|
3838
|
+
}
|
|
3839
|
+
return material.slice(2);
|
|
3840
|
+
}
|
|
3841
|
+
async function registerPolicyV3(input) {
|
|
3842
|
+
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
3843
|
+
const rootExpiresAt = new Date(input.rootExpiresAt);
|
|
3844
|
+
const canonicalRootExpiresAt = new Date(
|
|
3845
|
+
Math.floor(rootExpiresAt.getTime() / 1e3) * 1e3
|
|
3846
|
+
).toISOString().replace(/\.000Z$/, "Z");
|
|
3847
|
+
if (!Number.isFinite(rootExpiresAt.getTime()) || canonicalRootExpiresAt !== input.rootExpiresAt || rootExpiresAt.getTime() <= Date.now()) {
|
|
3848
|
+
throw new Error("policy root expiry is invalid");
|
|
3849
|
+
}
|
|
3850
|
+
const bindingResponse = await fetchFn(
|
|
3851
|
+
new URL("/policy/v3/enforcer-bindings", input.nodeOrigin),
|
|
3852
|
+
{
|
|
3853
|
+
method: "POST",
|
|
3854
|
+
redirect: "error",
|
|
3855
|
+
signal: input.signal,
|
|
3856
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
3857
|
+
body: JSON.stringify({
|
|
3858
|
+
rootExpiresAt: input.rootExpiresAt,
|
|
3859
|
+
enforcerDid: input.enforcerDid
|
|
3860
|
+
})
|
|
3861
|
+
}
|
|
3862
|
+
);
|
|
3863
|
+
if (!bindingResponse.ok) {
|
|
3864
|
+
throw new Error(`policy enforcer binding rejected (${bindingResponse.status})`);
|
|
3865
|
+
}
|
|
3866
|
+
const binding = exactObject(
|
|
3867
|
+
await bindingResponse.json(),
|
|
3868
|
+
[
|
|
3869
|
+
"schema",
|
|
3870
|
+
"enforcerDid",
|
|
3871
|
+
"nodeAudience",
|
|
3872
|
+
"attestationBindingDigestHex",
|
|
3873
|
+
"issuedAt",
|
|
3874
|
+
"expiresAt",
|
|
3875
|
+
"signature"
|
|
3876
|
+
],
|
|
3877
|
+
"policy enforcer binding"
|
|
3878
|
+
);
|
|
3879
|
+
const signature = exactObject(
|
|
3880
|
+
binding.signature,
|
|
3881
|
+
["suite", "signerDid", "value"],
|
|
3882
|
+
"policy enforcer binding signature"
|
|
3883
|
+
);
|
|
3884
|
+
const expectedBindingDigestHex = hex(
|
|
3885
|
+
sha2564(
|
|
3886
|
+
new TextEncoder().encode(
|
|
3887
|
+
jcsCanonicalize({
|
|
3888
|
+
enforcerDid: input.enforcerDid,
|
|
3889
|
+
nodeAudience: input.expectedNodeAudience
|
|
3890
|
+
})
|
|
3891
|
+
)
|
|
3892
|
+
)
|
|
3893
|
+
);
|
|
3894
|
+
if (binding.schema !== ATTESTED_ENFORCER_BINDING_V2_SCHEMA || binding.enforcerDid !== input.enforcerDid || binding.nodeAudience !== input.expectedNodeAudience || binding.attestationBindingDigestHex !== expectedBindingDigestHex || binding.expiresAt !== input.rootExpiresAt || typeof binding.issuedAt !== "string" || Date.parse(binding.issuedAt) > Date.now() || signature.suite !== "Ed25519" || signature.signerDid !== input.expectedNodeAudience || typeof signature.value !== "string") {
|
|
3895
|
+
throw new Error("policy enforcer binding is invalid");
|
|
3896
|
+
}
|
|
3897
|
+
const { signature: _signature, ...unsignedBinding } = binding;
|
|
3898
|
+
const signedBinding = sha2564(
|
|
3899
|
+
new TextEncoder().encode(
|
|
3900
|
+
`xyz.tinycloud.policy/AttestedEnforcerBinding/v2\0${jcsCanonicalize(unsignedBinding)}`
|
|
3901
|
+
)
|
|
3902
|
+
);
|
|
3903
|
+
if (!ed255193.verify(
|
|
3904
|
+
decodeBase64Url2(signature.value),
|
|
3905
|
+
signedBinding,
|
|
3906
|
+
didKeyEd25519PublicKey(input.expectedNodeAudience),
|
|
3907
|
+
{ zip215: false }
|
|
3908
|
+
)) {
|
|
3909
|
+
throw new Error("policy enforcer binding signature is invalid");
|
|
3910
|
+
}
|
|
3911
|
+
const response = await fetchFn(
|
|
3912
|
+
new URL("/policy/v3/policies", input.nodeOrigin),
|
|
3913
|
+
{
|
|
3914
|
+
method: "POST",
|
|
3915
|
+
redirect: "error",
|
|
3916
|
+
signal: input.signal,
|
|
3917
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
3918
|
+
body: JSON.stringify({
|
|
3919
|
+
policyCid: input.policyCid,
|
|
3920
|
+
policy: input.policy,
|
|
3921
|
+
policyRoot: input.policyRoot.authorization.replace(/^Bearer\s+/i, ""),
|
|
3922
|
+
enforcementRoot: input.enforcementRoot.authorization.replace(/^Bearer\s+/i, ""),
|
|
3923
|
+
contentSourceDigestHex: input.contentSourceDigestHex,
|
|
3924
|
+
nativeProjectionHashHex: input.nativeProjectionHashHex,
|
|
3925
|
+
attestedEnforcerBinding: binding
|
|
3926
|
+
})
|
|
3927
|
+
}
|
|
3928
|
+
);
|
|
3929
|
+
if (!response.ok) {
|
|
3930
|
+
throw new Error(`policy registration rejected (${response.status})`);
|
|
3931
|
+
}
|
|
3932
|
+
const receipt = exactObject(
|
|
3933
|
+
await response.json(),
|
|
3934
|
+
["policyCid", "policyRootCid", "enforcementRootCid"],
|
|
3935
|
+
"policy registration response"
|
|
3936
|
+
);
|
|
3937
|
+
if (receipt.policyCid !== input.policyCid || receipt.policyRootCid !== input.policyRoot.cid || receipt.enforcementRootCid !== input.enforcementRoot.cid) {
|
|
3938
|
+
throw new Error("policy registration response binding is invalid");
|
|
3939
|
+
}
|
|
3940
|
+
return {
|
|
3941
|
+
policyCid: input.policyCid,
|
|
3942
|
+
policyRootCid: input.policyRoot.cid,
|
|
3943
|
+
enforcementRootCid: input.enforcementRoot.cid,
|
|
3944
|
+
attestedEnforcerBinding: binding
|
|
3945
|
+
};
|
|
3946
|
+
}
|
|
3812
3947
|
function policyDigestHex(policy) {
|
|
3813
3948
|
const canonicalPolicy = {
|
|
3814
3949
|
...policy,
|
|
@@ -4425,6 +4560,7 @@ async function admitPolicyCredentialV3(input) {
|
|
|
4425
4560
|
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
4426
4561
|
const challenge = await requestPolicyChallengeV3({
|
|
4427
4562
|
nodeOrigin,
|
|
4563
|
+
policyRuntimePath: input.policyRuntimePath,
|
|
4428
4564
|
policyCid: input.policyCid,
|
|
4429
4565
|
recipientDid: input.credential.holderDid,
|
|
4430
4566
|
requestedCapabilities: input.requestedCapabilities,
|
|
@@ -4437,7 +4573,7 @@ async function admitPolicyCredentialV3(input) {
|
|
|
4437
4573
|
challenge
|
|
4438
4574
|
});
|
|
4439
4575
|
const response = await fetchFn(
|
|
4440
|
-
new URL(
|
|
4576
|
+
new URL(`${policyRuntimeBasePath2(input.policyRuntimePath)}/delegations`, nodeOrigin),
|
|
4441
4577
|
{
|
|
4442
4578
|
method: "POST",
|
|
4443
4579
|
redirect: "error",
|
|
@@ -4482,6 +4618,7 @@ async function admitPolicyCredentialV4(input) {
|
|
|
4482
4618
|
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
4483
4619
|
const challenge = await requestPolicyChallengeV3({
|
|
4484
4620
|
nodeOrigin,
|
|
4621
|
+
policyRuntimePath: input.policyRuntimePath,
|
|
4485
4622
|
policyCid: input.policyCid,
|
|
4486
4623
|
recipientDid: input.credential.holderDid,
|
|
4487
4624
|
requestedCapabilities: input.requestedCapabilities,
|
|
@@ -4493,7 +4630,7 @@ async function admitPolicyCredentialV4(input) {
|
|
|
4493
4630
|
policy,
|
|
4494
4631
|
challenge
|
|
4495
4632
|
});
|
|
4496
|
-
const response = await fetchFn(new URL(
|
|
4633
|
+
const response = await fetchFn(new URL(`${policyRuntimeBasePath2(input.policyRuntimePath)}/delegations`, nodeOrigin), {
|
|
4497
4634
|
method: "POST",
|
|
4498
4635
|
redirect: "error",
|
|
4499
4636
|
signal: input.signal,
|
|
@@ -4520,8 +4657,22 @@ async function admitPolicyCredentialV4(input) {
|
|
|
4520
4657
|
enforcerDid: input.expectedEnforcerDid
|
|
4521
4658
|
});
|
|
4522
4659
|
if (session.cid !== value.sessionCid || session.aud !== input.credential.holderDid || session.fact.policyCid !== input.policyCid || session.fact.recipientDid !== input.credential.holderDid || session.fact.policyDelegationCid !== input.policyRootCid || session.fact.enforcementDelegationCid !== input.enforcementRootCid || jcsCanonicalize(session.att) !== jcsCanonicalize(expectedAttenuation)) throw new Error("policy delegation signed binding is invalid");
|
|
4660
|
+
const importResponse = await fetchFn(new URL("/delegate", nodeOrigin), {
|
|
4661
|
+
method: "POST",
|
|
4662
|
+
redirect: "error",
|
|
4663
|
+
signal: input.signal,
|
|
4664
|
+
headers: { Authorization: session.authorization }
|
|
4665
|
+
});
|
|
4666
|
+
if (!importResponse.ok) throw new Error(`delegation import rejected (${importResponse.status})`);
|
|
4523
4667
|
input.signal?.throwIfAborted();
|
|
4524
|
-
return Object.freeze({ challenge, presentation, session });
|
|
4668
|
+
return Object.freeze({ challenge, presentation, session, delegationImported: true });
|
|
4669
|
+
}
|
|
4670
|
+
function policyRuntimeBasePath2(value) {
|
|
4671
|
+
const path = value ?? "/policy/v3";
|
|
4672
|
+
if (!/^\/policy(?:\/[a-z0-9-]+)*$/.test(path)) {
|
|
4673
|
+
throw new Error("policy runtime path is invalid");
|
|
4674
|
+
}
|
|
4675
|
+
return path;
|
|
4525
4676
|
}
|
|
4526
4677
|
|
|
4527
4678
|
// src/requester/index.ts
|
|
@@ -11711,41 +11862,12 @@ function shareDeliveryTrustedKid(publicKey) {
|
|
|
11711
11862
|
|
|
11712
11863
|
// src/delegations/share-delivery-v3.ts
|
|
11713
11864
|
import { ed25519 as ed2551910 } from "@noble/curves/ed25519";
|
|
11714
|
-
|
|
11715
|
-
var
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
"shareId",
|
|
11721
|
-
"policyCid",
|
|
11722
|
-
"policyRootCid",
|
|
11723
|
-
"enforcementRootCid",
|
|
11724
|
-
"nodeAudience",
|
|
11725
|
-
"enforcerDid",
|
|
11726
|
-
"targetOrigin",
|
|
11727
|
-
"openCredentialsAudience",
|
|
11728
|
-
"holder",
|
|
11729
|
-
"recipientMatcher",
|
|
11730
|
-
"deliveryEmail",
|
|
11731
|
-
"shareUrl",
|
|
11732
|
-
"returnOrigin",
|
|
11733
|
-
"documentName",
|
|
11734
|
-
"senderDid",
|
|
11735
|
-
"senderTrust",
|
|
11736
|
-
"contentSource",
|
|
11737
|
-
"contentSourceDigestHex",
|
|
11738
|
-
"shareExpiresAt",
|
|
11739
|
-
"issuedAt",
|
|
11740
|
-
"reportAbuseToken",
|
|
11741
|
-
"actions",
|
|
11742
|
-
"resource",
|
|
11743
|
-
"requestBodyDigest",
|
|
11744
|
-
"idempotencyKey",
|
|
11745
|
-
"expiresAt",
|
|
11746
|
-
"dataAuthority"
|
|
11747
|
-
];
|
|
11748
|
-
function exactObject(value, keys, label) {
|
|
11865
|
+
import { sha256 as sha25611 } from "@noble/hashes/sha256";
|
|
11866
|
+
var CREDENTIAL_INVITATION_REQUEST_DOMAIN = "xyz.tinycloud.credentials/invitation-request/v1\0";
|
|
11867
|
+
var DELIVERY_ADMISSION_DOMAIN = "xyz.tinycloud.policy/delivery-admission/v0\0";
|
|
11868
|
+
var REQUEST_KEYS = ["schema", "policyId", "recipient", "resource", "credentialType", "returnLink", "envelopeRef", "audience", "issuedAt", "expiresAt", "nonce"];
|
|
11869
|
+
var ADMISSION_KEYS = ["schema", "policyId", "ownerDid", "recipient", "resource", "actions", "credentialType", "returnLink", "envelopeRef", "senderKeyDid", "audience", "issuedAt", "expiresAt", "nonce", "signature"];
|
|
11870
|
+
function exactObject2(value, keys, label) {
|
|
11749
11871
|
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(`${label} is invalid`);
|
|
11750
11872
|
const record2 = value;
|
|
11751
11873
|
if (Object.keys(record2).length !== keys.length || keys.some((key) => !Object.prototype.hasOwnProperty.call(record2, key))) throw new Error(`${label} has unknown or missing fields`);
|
|
@@ -11764,6 +11886,12 @@ function object3(value, label) {
|
|
|
11764
11886
|
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(`${label} is invalid`);
|
|
11765
11887
|
return value;
|
|
11766
11888
|
}
|
|
11889
|
+
function didKeyBytes2(did) {
|
|
11890
|
+
if (!did.startsWith("did:key:z") || /[#/?]/.test(did.slice("did:key:".length))) throw new Error("v3 delivery admission signer is invalid");
|
|
11891
|
+
const decoded = base58btc.decode(did.slice("did:key:".length));
|
|
11892
|
+
if (decoded.length !== 34 || decoded[0] !== 237 || decoded[1] !== 1) throw new Error("v3 delivery admission signer is invalid");
|
|
11893
|
+
return decoded.slice(2);
|
|
11894
|
+
}
|
|
11767
11895
|
function validateShareDeliveryAuthorizationV3Bytes(bytes2, expected) {
|
|
11768
11896
|
let parsed;
|
|
11769
11897
|
try {
|
|
@@ -11771,33 +11899,27 @@ function validateShareDeliveryAuthorizationV3Bytes(bytes2, expected) {
|
|
|
11771
11899
|
} catch {
|
|
11772
11900
|
throw new Error("v3 share delivery response is not valid UTF-8 JSON");
|
|
11773
11901
|
}
|
|
11774
|
-
const root =
|
|
11775
|
-
const
|
|
11776
|
-
const
|
|
11902
|
+
const root = exactObject2(parsed, ["request", "admission"], "v3 share delivery response");
|
|
11903
|
+
const request = exactObject2(root.request, REQUEST_KEYS, "credential invitation request");
|
|
11904
|
+
const admission = exactObject2(root.admission, ADMISSION_KEYS, "delivery admission");
|
|
11905
|
+
const signature = exactObject2(admission.signature, ["suite", "signerDid", "value"], "delivery admission signature");
|
|
11777
11906
|
const envelope = object3(expected.request.envelope, "v3 share envelope");
|
|
11778
|
-
const
|
|
11779
|
-
const
|
|
11780
|
-
const
|
|
11781
|
-
const
|
|
11782
|
-
const resource = object3(envelope.resource, "v3 resource");
|
|
11907
|
+
const policy = object3(envelope.policy, "v3 share policy");
|
|
11908
|
+
const requirement = object3(policy.credentialRequirement, "v3 credential requirement");
|
|
11909
|
+
const credentialType = object3(requirement.credentialType, "v3 credential type");
|
|
11910
|
+
const contentSource = object3(envelope.contentSource, "v3 content source");
|
|
11783
11911
|
const envelopeSignature = object3(envelope.signature, "v3 envelope signature");
|
|
11784
|
-
const
|
|
11785
|
-
const
|
|
11786
|
-
|
|
11787
|
-
const
|
|
11788
|
-
const
|
|
11789
|
-
if (
|
|
11790
|
-
|
|
11791
|
-
|
|
11792
|
-
const
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
if (!Number.isFinite(issuedAt) || !Number.isFinite(expiresAt) || !Number.isFinite(shareExpiresAt) || expiresAt <= issuedAt || expiresAt - issuedAt > 5 * 6e4 || shareExpiresAt <= issuedAt || typeof authorization.holder !== "string" || !authorization.holder.startsWith("did:")) throw new Error("v3 share delivery authorization time or holder is invalid");
|
|
11796
|
-
const publicKey = expected.nodeProof.publicKey.length === 34 ? expected.nodeProof.publicKey.slice(2) : expected.nodeProof.publicKey;
|
|
11797
|
-
const signature = decodeBase64Url3(proof.signature);
|
|
11798
|
-
const signed = new TextEncoder().encode(`${SHARE_DELIVERY_AUTHORIZATION_V3_DOMAIN}${canonicalizeSignedObjectUnsigned(authorization)}`);
|
|
11799
|
-
if (publicKey.length !== 32 || signature.length !== 64 || !ed2551910.verify(signature, signed, publicKey)) throw new Error("v3 share delivery proof signature is invalid");
|
|
11800
|
-
return { authorization, proof };
|
|
11912
|
+
const target = object3(envelope.target, "v3 target");
|
|
11913
|
+
const fields = ["policyId", "recipient", "resource", "credentialType", "returnLink", "envelopeRef", "audience", "issuedAt", "expiresAt", "nonce"];
|
|
11914
|
+
if (request.schema !== "xyz.tinycloud.credentials/invitation-request/v1" || admission.schema !== "xyz.tinycloud.policy/delivery-admission/v0" || fields.some((field) => request[field] !== admission[field]) || request.policyId !== envelope.policyCid || request.recipient !== expected.request.recipientEmail || request.resource !== contentSource.kvResource || request.credentialType !== credentialType.id || request.credentialType !== "opencredentials.email/v1" || request.returnLink !== expected.request.shareUrl || request.envelopeRef !== expected.request.shareCid || request.audience !== expected.credentialsAudience || request.expiresAt !== expected.request.expiresAt || request.nonce !== expected.request.jti || admission.ownerDid !== envelopeSignature.signerDid || admission.senderKeyDid !== expected.senderKeyDid || canonicalizeSignedObjectUnsigned(admission.actions) !== canonicalizeSignedObjectUnsigned(["tinycloud.kv/get"]) || signature.suite !== "eddsa-ed25519-sha256-jcs-v1" || signature.signerDid !== target.nodeAudience) throw new Error("v3 share delivery authorization is not bound to the submitted request");
|
|
11915
|
+
const issuedAt = Date.parse(String(request.issuedAt));
|
|
11916
|
+
const expiresAt = Date.parse(String(request.expiresAt));
|
|
11917
|
+
if (!Number.isFinite(issuedAt) || !Number.isFinite(expiresAt) || expiresAt <= issuedAt || expiresAt - issuedAt > 15 * 6e4) throw new Error("v3 share delivery authorization time is invalid");
|
|
11918
|
+
const admissionSignature = decodeBase64Url3(signature.value);
|
|
11919
|
+
const { signature: _signature, ...unsignedAdmission } = admission;
|
|
11920
|
+
const digest4 = sha25611(new TextEncoder().encode(`${DELIVERY_ADMISSION_DOMAIN}${canonicalizeSignedObjectUnsigned(unsignedAdmission)}`));
|
|
11921
|
+
if (admissionSignature.length !== 64 || !ed2551910.verify(admissionSignature, digest4, didKeyBytes2(String(signature.signerDid)))) throw new Error("v3 share delivery admission signature is invalid");
|
|
11922
|
+
return { request, admission };
|
|
11801
11923
|
}
|
|
11802
11924
|
|
|
11803
11925
|
// src/delegations/sender-share-store.ts
|
|
@@ -14664,6 +14786,7 @@ import {
|
|
|
14664
14786
|
SecretsService,
|
|
14665
14787
|
SECRET_NAME_RE as SECRET_NAME_RE2,
|
|
14666
14788
|
canonicalizeSecretScope,
|
|
14789
|
+
parseSecretCatalogKey,
|
|
14667
14790
|
resolveSecretListPrefix,
|
|
14668
14791
|
resolveSecretPath as resolveSecretPath2,
|
|
14669
14792
|
EncryptionService,
|
|
@@ -18232,6 +18355,7 @@ export {
|
|
|
18232
18355
|
CREDENTIAL_CONTRACT_VERSION,
|
|
18233
18356
|
CREDENTIAL_ERROR_CODES,
|
|
18234
18357
|
CREDENTIAL_FORMAT,
|
|
18358
|
+
CREDENTIAL_INVITATION_REQUEST_DOMAIN,
|
|
18235
18359
|
CREDENTIAL_ACQUISITION_PROTOCOL as CREDENTIAL_PROTOCOL,
|
|
18236
18360
|
CREDENTIAL_STEP_REGISTRY_VERSION,
|
|
18237
18361
|
CapabilityKeyRegistry,
|
|
@@ -18255,6 +18379,7 @@ export {
|
|
|
18255
18379
|
DEFAULT_SIGNED_READ_URL_EXPIRY_MS,
|
|
18256
18380
|
DEFAULT_TINYCLOUD_FALLBACK_HOST,
|
|
18257
18381
|
DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL,
|
|
18382
|
+
DELIVERY_ADMISSION_DOMAIN,
|
|
18258
18383
|
DUCKDB,
|
|
18259
18384
|
DataVaultService,
|
|
18260
18385
|
DatabaseHandle,
|
|
@@ -18345,7 +18470,6 @@ export {
|
|
|
18345
18470
|
SERVICE_LONG_TO_SHORT,
|
|
18346
18471
|
SERVICE_SHORT_TO_LONG,
|
|
18347
18472
|
SHARE_DELIVERY_AUTHORIZATION_DOMAIN,
|
|
18348
|
-
SHARE_DELIVERY_AUTHORIZATION_V3_DOMAIN,
|
|
18349
18473
|
SPACE,
|
|
18350
18474
|
SQL,
|
|
18351
18475
|
SQLAction,
|
|
@@ -18548,6 +18672,7 @@ export {
|
|
|
18548
18672
|
parsePolicySessionUcan,
|
|
18549
18673
|
parsePortableDelegation,
|
|
18550
18674
|
parseRecapCapabilities,
|
|
18675
|
+
parseSecretCatalogKey,
|
|
18551
18676
|
parseShareArtifact,
|
|
18552
18677
|
parseShareUrl,
|
|
18553
18678
|
parseSpaceUri,
|
|
@@ -18561,6 +18686,7 @@ export {
|
|
|
18561
18686
|
projectUnifiedPolicyCapabilities,
|
|
18562
18687
|
projectUnifiedPolicyCapability,
|
|
18563
18688
|
recapCaveatsEqual,
|
|
18689
|
+
registerPolicyV3,
|
|
18564
18690
|
renewPolicyRootStatusV3,
|
|
18565
18691
|
requestTinyCloudManageKeyScope,
|
|
18566
18692
|
resolveCloudLocation,
|