@burnt-labs/expo-satya-attest 1.1.1 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0 - 2026-06-26
4
+
5
+ - Added artifact envelope metadata for SDK/version-aware verifier compatibility while preserving the existing `attestationId`.
6
+ - Backend verifier responses can now report the artifact schema/profile and SDK version for easier compatibility debugging.
7
+ - The verifier compatibility profile supports SDK `1.x` and rejects older `0.x` artifacts that do not carry `policyHash`.
8
+
3
9
  ## 1.1.1 - 2026-06-25
4
10
 
5
11
  - Fixed provider WebView injections so registry-provided scripts run directly in the managed WebView execution path instead of being wrapped in runtime eval.
package/README.md CHANGED
@@ -21,8 +21,9 @@ use the SDK-owned button component for the full managed flow:
21
21
  7. Native extraction applies the endpoint's reveal rules to the pinned response — JSON
22
22
  paths for `json` bodies, and regex (`regex`/`jsonRegex`) over the raw body — producing
23
23
  the disclosed claims. The Rust core emits a `native-pinned-observed` SATYA artifact.
24
- 8. The SDK verifies locally, optionally posts the artifact to `satya-verifier-service`,
25
- and returns the result through `onComplete`.
24
+ 8. The SDK stamps Expo package metadata onto the artifact envelope, verifies locally,
25
+ optionally posts the artifact to `satya-verifier-service`, and returns the result
26
+ through `onComplete`.
26
27
 
27
28
  The earlier mock and plain `webview-observed` modes are no longer exposed through the
28
29
  high-level Expo client because they do not prove a provider response fetched through a
@@ -42,6 +43,32 @@ relies on canonical statement hashes, device/witness signatures, active provider
42
43
  policy, fresh revocation epochs, backend-trusted SPKI pins, and pass-2 platform
43
44
  verification where appropriate.
44
45
 
46
+ ## Artifact Identity And Versioning
47
+
48
+ Every artifact includes a stable `attestationId`. It is derived from the signed
49
+ statement hash, so a replay of the same artifact keeps the same id while a fresh
50
+ attestation gets a new one.
51
+
52
+ New SDK artifacts also include envelope metadata:
53
+
54
+ ```json
55
+ {
56
+ "schemaVersion": "1.0.0",
57
+ "attestationId": "satya_w_...",
58
+ "attestationIdVersion": "statement-sha256-96-v1",
59
+ "producer": {
60
+ "sdk": "@burnt-labs/expo-satya-attest",
61
+ "sdkVersion": "1.2.0",
62
+ "artifactSchemaVersion": "1.0.0",
63
+ "coreVersion": "0.1.0"
64
+ }
65
+ }
66
+ ```
67
+
68
+ The verifier uses this metadata for compatibility routing and diagnostics. It is
69
+ not allowed to downgrade cryptographic checks; policy decisions still come from
70
+ the signed statement, provider registry policy, and platform evidence.
71
+
45
72
  ## Build The Rust Core
46
73
 
47
74
  The generated native artifacts are gitignored:
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'expo.modules.satyaattest'
7
- version = '1.1.1'
7
+ version = '1.2.0'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.satyaattest"
11
11
  defaultConfig {
12
12
  versionCode 1
13
- versionName "1.1.1"
13
+ versionName "1.2.0"
14
14
  // StrongBox key attestation needs API 28+; basic Keystore attestation API 24+.
15
15
  minSdkVersion 24
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SatyaMobileClient.d.ts","sourceRoot":"","sources":["../src/SatyaMobileClient.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACb,MAAM,SAAS,CAAC;AAQjB,KAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;AAqB1D,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,eAAe,EAAE,oBAAoB,CAAC;IACtC,eAAe,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,aAAa,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,qBAAa,iBAAiB;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O,CAAC,IAAI,CAAC;CAGzB"}
@@ -1,4 +1,5 @@
1
1
  import SatyaAttest from './SatyaAttestModule';
2
+ import { attachArtifactProducer } from './artifactMetadata';
2
3
  import { satyaDebug } from './debugLog';
3
4
  import { SatyaErrorCode, asSatyaError, satyaError, } from './types/error.types';
4
5
  const REPLAY_PROGRESS = [
@@ -66,7 +67,8 @@ export class SatyaMobileClient {
66
67
  }
67
68
  let artifact;
68
69
  try {
69
- artifact = JSON.parse(raw);
70
+ artifact = attachArtifactProducer(JSON.parse(raw), this.coreVersion());
71
+ raw = JSON.stringify(artifact);
70
72
  }
71
73
  catch (cause) {
72
74
  throw satyaError(SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED, 'native replay returned invalid artifact JSON', {
@@ -1 +1 @@
1
- {"version":3,"file":"SatyaMobileClient.js","sourceRoot":"","sources":["../src/SatyaMobileClient.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAUxC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,GAEX,MAAM,qBAAqB,CAAC;AAI7B,MAAM,eAAe,GAAuD;IAC1E,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,IAAI,CAAC;IACpD,CAAC,kBAAkB,EAAE,4BAA4B,EAAE,IAAI,CAAC;IACxD,CAAC,iBAAiB,EAAE,6BAA6B,EAAE,IAAI,CAAC;IACxD,CAAC,cAAc,EAAE,mCAAmC,EAAE,IAAI,CAAC;IAC3D,CAAC,gBAAgB,EAAE,+BAA+B,EAAE,IAAI,CAAC;IACzD,CAAC,iBAAiB,EAAE,kCAAkC,EAAE,GAAG,CAAC;IAC5D,CAAC,iBAAiB,EAAE,2BAA2B,EAAE,IAAI,CAAC;IACtD,CAAC,kBAAkB,EAAE,iCAAiC,EAAE,IAAI,CAAC;CAC9D,CAAC;AAEF,SAAS,eAAe,CAAC,MAA4B;IACnD,OAAO;QAC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MAAM,CAAC,YAAY;gBACjC,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;YAC3D,MAAM,KAAK,CAAC;QACd,CAAC;QAED,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,iCAAiC,EAAE;YAC3D,UAAU,EAAE,gBAAgB,CAAC,UAAU;YACvC,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,uCAAuC,EAAE,GAAG,CAAC,CAAC;QACpE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,YAAoB;QAC/B,IAAI,CAAC;YACH,OAAO,MAAM,WAAW,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,4BAA4B,EAAE;gBACrE,SAAS,EAAE,wBAAwB;aACpC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,WAAW;QACT,OAAO,WAAW,CAAC,gBAAgB,EAAE,CAAC;IACxC,CAAC;IAED,OAAO;QACL,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF","sourcesContent":["import SatyaAttest from './SatyaAttestModule';\nimport { satyaDebug } from './debugLog';\nimport {\n SatyaArtifact,\n CapturedProviderRequest,\n SatyaPhase,\n SatyaProviderTemplate,\n SatyaProgress,\n SatyaTransportConfig,\n VerifyResult,\n} from './types';\nimport {\n SatyaErrorCode,\n asSatyaError,\n satyaError,\n type SatyaErrorDiagnostics,\n} from './types/error.types';\n\ntype ProgressListener = (progress: SatyaProgress) => void;\n\nconst REPLAY_PROGRESS: readonly (readonly [SatyaPhase, string, number])[] = [\n ['witnessEnrollment', 'Enrolling witness key', 0.12],\n ['sessionChallenge', 'Creating session challenge', 0.24],\n ['witnessTlsSetup', 'Preparing pinned TLS policy', 0.38],\n ['tlsHandshake', 'Replaying request over pinned TLS', 0.52],\n ['recordExchange', 'Capturing response transcript', 0.66],\n ['selectiveReveal', 'Parsing disclosure from response', 0.8],\n ['witnessFinalize', 'Signing witness statement', 0.88],\n ['artifactFinalize', 'Finalizing attestation artifact', 0.94],\n];\n\nfunction serializeConfig(config: SatyaTransportConfig): Record<string, unknown> {\n return {\n verifierUrl: config.verifierUrl,\n enableLogging: config.enableLogging ?? false,\n cloudProjectNumber: config.cloudProjectNumber ?? 0,\n };\n}\n\nexport interface NativeReplayAttestArgs {\n providerTemplate: SatyaProviderTemplate;\n transportConfig: SatyaTransportConfig;\n capturedRequest?: CapturedProviderRequest | null;\n}\n\nexport interface AttestOutcome {\n artifact: SatyaArtifact;\n raw: string;\n verify: VerifyResult;\n}\n\nexport class SatyaMobileClient {\n private readonly listeners = new Set<ProgressListener>();\n\n subscribeProgress(listener: ProgressListener): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n private emit(\n phase: SatyaPhase,\n message: string,\n percent: number,\n error?: SatyaErrorDiagnostics\n ): void {\n for (const listener of this.listeners) {\n listener({ phase, message, percent, error });\n }\n }\n\n async attestNativeReplay(args: NativeReplayAttestArgs): Promise<AttestOutcome> {\n const { providerTemplate, transportConfig, capturedRequest } = args;\n satyaDebug.info('client', 'initializing native core for replay', {\n providerId: providerTemplate.providerId,\n verifierUrl: transportConfig.verifierUrl,\n hasCapturedRequest: !!capturedRequest,\n });\n try {\n await SatyaAttest.initialize(JSON.stringify(serializeConfig(transportConfig)));\n } catch (cause) {\n const error = satyaError(\n SatyaErrorCode.NATIVE_REPLAY_FAILED,\n 'native module initialization failed',\n {\n providerId: providerTemplate.providerId,\n operation: 'initialize',\n },\n cause,\n 'initialization'\n );\n this.emit('failed', error.message, 1.0, error.diagnostics);\n throw error;\n }\n\n for (const [phase, message, percent] of REPLAY_PROGRESS) {\n this.emit(phase, message, percent);\n }\n\n let raw: string;\n try {\n raw = await SatyaAttest.attestNativeReplay(\n JSON.stringify(providerTemplate),\n capturedRequest ? JSON.stringify(capturedRequest) : null\n );\n } catch (cause) {\n const error = satyaError(\n SatyaErrorCode.NATIVE_REPLAY_FAILED,\n cause instanceof Error ? cause.message : String(cause),\n {\n providerId: providerTemplate.providerId,\n operation: 'attestNativeReplay',\n },\n cause\n );\n this.emit('failed', error.message, 1.0, error.diagnostics);\n throw error;\n }\n\n let artifact: SatyaArtifact;\n try {\n artifact = JSON.parse(raw) as SatyaArtifact;\n } catch (cause) {\n throw satyaError(\n SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED,\n 'native replay returned invalid artifact JSON',\n {\n providerId: providerTemplate.providerId,\n operation: 'parseNativeReplayArtifact',\n },\n cause\n );\n }\n let verify: VerifyResult;\n try {\n verify = await SatyaAttest.verifyArtifactDetailed(raw);\n } catch (cause) {\n const error = satyaError(\n SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED,\n cause instanceof Error ? cause.message : String(cause),\n {\n providerId: providerTemplate.providerId,\n operation: 'verifyArtifactDetailed',\n },\n cause\n );\n this.emit('failed', error.message, 1.0, error.diagnostics);\n throw error;\n }\n\n if (!verify.ok) {\n const message = verify.error ?? 'Native replay artifact verification failed';\n satyaDebug.error('client', 'native replay artifact verification failed', {\n providerId: providerTemplate.providerId,\n code: SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED,\n error: message,\n });\n const error = satyaError(SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED, message, {\n providerId: providerTemplate.providerId,\n operation: 'verifyArtifactDetailed',\n attestationId: verify.attestationId,\n mode: verify.mode,\n platformTier: verify.platformTier,\n policy: verify.policy,\n });\n this.emit('failed', error.message, 1.0, error.diagnostics);\n throw error;\n }\n\n satyaDebug.info('client', 'native replay artifact verified', {\n providerId: providerTemplate.providerId,\n attestationId: verify.attestationId,\n platformTier: verify.platformTier,\n policy: verify.policy,\n });\n this.emit('verified', 'Satya native replay artifact verified', 1.0);\n return { artifact, raw, verify };\n }\n\n async verify(artifactJson: string): Promise<VerifyResult> {\n try {\n return await SatyaAttest.verifyArtifactDetailed(artifactJson);\n } catch (cause) {\n throw asSatyaError(cause, SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED, {\n operation: 'verifyArtifactDetailed',\n });\n }\n }\n\n coreVersion(): string {\n return SatyaAttest.satyaCoreVersion();\n }\n\n dispose(): Promise<void> {\n return SatyaAttest.dispose();\n }\n}\n"]}
1
+ {"version":3,"file":"SatyaMobileClient.js","sourceRoot":"","sources":["../src/SatyaMobileClient.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAUxC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,GAEX,MAAM,qBAAqB,CAAC;AAI7B,MAAM,eAAe,GAAuD;IAC1E,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,IAAI,CAAC;IACpD,CAAC,kBAAkB,EAAE,4BAA4B,EAAE,IAAI,CAAC;IACxD,CAAC,iBAAiB,EAAE,6BAA6B,EAAE,IAAI,CAAC;IACxD,CAAC,cAAc,EAAE,mCAAmC,EAAE,IAAI,CAAC;IAC3D,CAAC,gBAAgB,EAAE,+BAA+B,EAAE,IAAI,CAAC;IACzD,CAAC,iBAAiB,EAAE,kCAAkC,EAAE,GAAG,CAAC;IAC5D,CAAC,iBAAiB,EAAE,2BAA2B,EAAE,IAAI,CAAC;IACtD,CAAC,kBAAkB,EAAE,iCAAiC,EAAE,IAAI,CAAC;CAC9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actMetadata';\nimport { satyaDebug } from './debugLog';\nimport {\n SatyaArtifact,\n CapturedProviderRequest,\n SatyaPhase,\n SatyaProviderTemplate,\n SatyaProgress,\n SatyaTransportConfig,\n VerifyResult,\n} from './types';\nimport {\n SatyaErrorCode,\n asSatyaError,\n satyaError,\n type SatyaErrorDiagnostics,\n} from './types/error.types';\n\ntype ProgressListener = (progress: SatyaProgress) => void;\n\nconst REPLAY_PROGRESS: readonly (readonly [SatyaPhase, string, number])[] = [\n ['witnessEnrollment', 'Enrolling witness key', 0.12],\n ['sessionChallenge', 'Creating session challenge', 0.24],\n ['witnessTlsSetup', 'Preparing pinned TLS policy', 0.38],\n ['tlsHandshake', 'Replaying request over pinned TLS', 0.52],\n ['recordExchange', 'Capturing response transcript', 0.66],\n ['selectiveReveal', 'Parsing disclosure from response', 0.8],\n ['witnessFinalize', 'Signing witness statement', 0.88],\n ['artifactFinalize', 'Finalizing attestation artifact', 0.94],\n];\n\nfunction serializeConfig(config: SatyaTransportConfig): Record<string, unknown> {\n return {\n verifierUrl: config.verifierUrl,\n enableLogging: config.enableLogging ?? false,\n cloudProjectNumber: config.cloudProjectNumber ?? 0,\n };\n}\n\nexport interface NativeReplayAttestArgs {\n providerTemplate: SatyaProviderTemplate;\n transportConfig: SatyaTransportConfig;\n capturedRequest?: CapturedProviderRequest | null;\n}\n\nexport interface AttestOutcome {\n artifact: SatyaArtifact;\n raw: string;\n verify: VerifyResult;\n}\n\nexport class SatyaMobileClient {\n private readonly listeners = new Set<ProgressListener>();\n\n subscribeProgress(listener: ProgressListener): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n private emit(\n phase: SatyaPhase,\n message: string,\n percent: number,\n error?: SatyaErrorDiagnostics\n ): void {\n for (const listener of this.listeners) {\n listener({ phase, message, percent, error });\n }\n }\n\n async attestNativeReplay(args: NativeReplayAttestArgs): Promise<AttestOutcome> {\n const { providerTemplate, transportConfig, capturedRequest } = args;\n satyaDebug.info('client', 'initializing native core for replay', {\n providerId: providerTemplate.providerId,\n verifierUrl: transportConfig.verifierUrl,\n hasCapturedRequest: !!capturedRequest,\n });\n try {\n await SatyaAttest.initialize(JSON.stringify(serializeConfig(transportConfig)));\n } catch (cause) {\n const error = satyaError(\n SatyaErrorCode.NATIVE_REPLAY_FAILED,\n 'native module initialization failed',\n {\n providerId: providerTemplate.providerId,\n operation: 'initialize',\n },\n cause,\n 'initialization'\n );\n this.emit('failed', error.message, 1.0, error.diagnostics);\n throw error;\n }\n\n for (const [phase, message, percent] of REPLAY_PROGRESS) {\n this.emit(phase, message, percent);\n }\n\n let raw: string;\n try {\n raw = await SatyaAttest.attestNativeReplay(\n JSON.stringify(providerTemplate),\n capturedRequest ? JSON.stringify(capturedRequest) : null\n );\n } catch (cause) {\n const error = satyaError(\n SatyaErrorCode.NATIVE_REPLAY_FAILED,\n cause instanceof Error ? cause.message : String(cause),\n {\n providerId: providerTemplate.providerId,\n operation: 'attestNativeReplay',\n },\n cause\n );\n this.emit('failed', error.message, 1.0, error.diagnostics);\n throw error;\n }\n\n let artifact: SatyaArtifact;\n try {\n artifact = attachArtifactProducer(JSON.parse(raw) as SatyaArtifact, this.coreVersion());\n raw = JSON.stringify(artifact);\n } catch (cause) {\n throw satyaError(\n SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED,\n 'native replay returned invalid artifact JSON',\n {\n providerId: providerTemplate.providerId,\n operation: 'parseNativeReplayArtifact',\n },\n cause\n );\n }\n let verify: VerifyResult;\n try {\n verify = await SatyaAttest.verifyArtifactDetailed(raw);\n } catch (cause) {\n const error = satyaError(\n SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED,\n cause instanceof Error ? cause.message : String(cause),\n {\n providerId: providerTemplate.providerId,\n operation: 'verifyArtifactDetailed',\n },\n cause\n );\n this.emit('failed', error.message, 1.0, error.diagnostics);\n throw error;\n }\n\n if (!verify.ok) {\n const message = verify.error ?? 'Native replay artifact verification failed';\n satyaDebug.error('client', 'native replay artifact verification failed', {\n providerId: providerTemplate.providerId,\n code: SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED,\n error: message,\n });\n const error = satyaError(SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED, message, {\n providerId: providerTemplate.providerId,\n operation: 'verifyArtifactDetailed',\n attestationId: verify.attestationId,\n mode: verify.mode,\n platformTier: verify.platformTier,\n policy: verify.policy,\n });\n this.emit('failed', error.message, 1.0, error.diagnostics);\n throw error;\n }\n\n satyaDebug.info('client', 'native replay artifact verified', {\n providerId: providerTemplate.providerId,\n attestationId: verify.attestationId,\n platformTier: verify.platformTier,\n policy: verify.policy,\n });\n this.emit('verified', 'Satya native replay artifact verified', 1.0);\n return { artifact, raw, verify };\n }\n\n async verify(artifactJson: string): Promise<VerifyResult> {\n try {\n return await SatyaAttest.verifyArtifactDetailed(artifactJson);\n } catch (cause) {\n throw asSatyaError(cause, SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED, {\n operation: 'verifyArtifactDetailed',\n });\n }\n }\n\n coreVersion(): string {\n return SatyaAttest.satyaCoreVersion();\n }\n\n dispose(): Promise<void> {\n return SatyaAttest.dispose();\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { SatyaArtifact } from './types';
2
+ export declare const SATYA_ARTIFACT_SCHEMA_VERSION = "1.0.0";
3
+ export declare const SATYA_ATTESTATION_ID_VERSION = "statement-sha256-96-v1";
4
+ export declare function attachArtifactProducer(artifact: SatyaArtifact, coreVersion?: string): SatyaArtifact;
5
+ //# sourceMappingURL=artifactMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifactMetadata.d.ts","sourceRoot":"","sources":["../src/artifactMetadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAyB,MAAM,SAAS,CAAC;AAEpE,eAAO,MAAM,6BAA6B,UAAU,CAAC;AACrD,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAErE,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,aAAa,EACvB,WAAW,CAAC,EAAE,MAAM,GACnB,aAAa,CAOf"}
@@ -0,0 +1,20 @@
1
+ import { EXPO_SATYA_ATTEST_SDK_NAME, EXPO_SATYA_ATTEST_SDK_VERSION } from './sdkMetadata.generated';
2
+ export const SATYA_ARTIFACT_SCHEMA_VERSION = '1.0.0';
3
+ export const SATYA_ATTESTATION_ID_VERSION = 'statement-sha256-96-v1';
4
+ export function attachArtifactProducer(artifact, coreVersion) {
5
+ return {
6
+ ...artifact,
7
+ schemaVersion: SATYA_ARTIFACT_SCHEMA_VERSION,
8
+ attestationIdVersion: SATYA_ATTESTATION_ID_VERSION,
9
+ producer: expoArtifactProducer(coreVersion),
10
+ };
11
+ }
12
+ function expoArtifactProducer(coreVersion) {
13
+ return {
14
+ sdk: EXPO_SATYA_ATTEST_SDK_NAME,
15
+ sdkVersion: EXPO_SATYA_ATTEST_SDK_VERSION,
16
+ artifactSchemaVersion: SATYA_ARTIFACT_SCHEMA_VERSION,
17
+ coreVersion: coreVersion || undefined,
18
+ };
19
+ }
20
+ //# sourceMappingURL=artifactMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifactMetadata.js","sourceRoot":"","sources":["../src/artifactMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAGpG,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAO,CAAC;AACrD,MAAM,CAAC,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AAErE,MAAM,UAAU,sBAAsB,CACpC,QAAuB,EACvB,WAAoB;IAEpB,OAAO;QACL,GAAG,QAAQ;QACX,aAAa,EAAE,6BAA6B;QAC5C,oBAAoB,EAAE,4BAA4B;QAClD,QAAQ,EAAE,oBAAoB,CAAC,WAAW,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,WAAoB;IAChD,OAAO;QACL,GAAG,EAAE,0BAA0B;QAC/B,UAAU,EAAE,6BAA6B;QACzC,qBAAqB,EAAE,6BAA6B;QACpD,WAAW,EAAE,WAAW,IAAI,SAAS;KACtC,CAAC;AACJ,CAAC","sourcesContent":["import { EXPO_SATYA_ATTEST_SDK_NAME, EXPO_SATYA_ATTEST_SDK_VERSION } from './sdkMetadata.generated';\nimport type { SatyaArtifact, SatyaArtifactProducer } from './types';\n\nexport const SATYA_ARTIFACT_SCHEMA_VERSION = '1.0.0';\nexport const SATYA_ATTESTATION_ID_VERSION = 'statement-sha256-96-v1';\n\nexport function attachArtifactProducer(\n artifact: SatyaArtifact,\n coreVersion?: string\n): SatyaArtifact {\n return {\n ...artifact,\n schemaVersion: SATYA_ARTIFACT_SCHEMA_VERSION,\n attestationIdVersion: SATYA_ATTESTATION_ID_VERSION,\n producer: expoArtifactProducer(coreVersion),\n };\n}\n\nfunction expoArtifactProducer(coreVersion?: string): SatyaArtifactProducer {\n return {\n sdk: EXPO_SATYA_ATTEST_SDK_NAME,\n sdkVersion: EXPO_SATYA_ATTEST_SDK_VERSION,\n artifactSchemaVersion: SATYA_ARTIFACT_SCHEMA_VERSION,\n coreVersion: coreVersion || undefined,\n };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const EXPO_SATYA_ATTEST_SDK_NAME: "@burnt-labs/expo-satya-attest";
2
+ export declare const EXPO_SATYA_ATTEST_SDK_VERSION: "1.2.0";
3
+ //# sourceMappingURL=sdkMetadata.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdkMetadata.generated.d.ts","sourceRoot":"","sources":["../src/sdkMetadata.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,0BAA0B,EAAG,+BAAwC,CAAC;AACnF,eAAO,MAAM,6BAA6B,EAAG,OAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Generated by internal/module_scripts/sync-sdk-metadata.js.
2
+ export const EXPO_SATYA_ATTEST_SDK_NAME = '@burnt-labs/expo-satya-attest';
3
+ export const EXPO_SATYA_ATTEST_SDK_VERSION = '1.2.0';
4
+ //# sourceMappingURL=sdkMetadata.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdkMetadata.generated.js","sourceRoot":"","sources":["../src/sdkMetadata.generated.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,0BAA0B,GAAG,+BAAwC,CAAC;AACnF,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAgB,CAAC","sourcesContent":["// Generated by internal/module_scripts/sync-sdk-metadata.js.\nexport const EXPO_SATYA_ATTEST_SDK_NAME = '@burnt-labs/expo-satya-attest' as const;\nexport const EXPO_SATYA_ATTEST_SDK_VERSION = '1.2.0' as const;\n"]}
@@ -2,6 +2,8 @@ export type SatyaArtifactMode = 'native-pinned-observed';
2
2
  export interface SatyaArtifact {
3
3
  schemaVersion: string;
4
4
  attestationId: string;
5
+ attestationIdVersion?: string;
6
+ producer?: SatyaArtifactProducer;
5
7
  createdAtUtc: string;
6
8
  mode: SatyaArtifactMode;
7
9
  statement: Record<string, unknown>;
@@ -12,4 +14,11 @@ export interface SatyaArtifact {
12
14
  telemetry?: Record<string, unknown>;
13
15
  [key: string]: unknown;
14
16
  }
17
+ export interface SatyaArtifactProducer {
18
+ sdk: string;
19
+ sdkVersion: string;
20
+ artifactSchemaVersion: string;
21
+ coreVersion?: string;
22
+ platform?: string;
23
+ }
15
24
  //# sourceMappingURL=artifact.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"artifact.types.d.ts","sourceRoot":"","sources":["../../src/types/artifact.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAA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AM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"artifact.types.js","sourceRoot":"","sources":["../../src/types/artifact.types.ts"],"names":[],"mappings":"","sourcesContent":["export type SatyaArtifactMode = 'native-pinned-observed';\n\nexport interface SatyaArtifact {\n schemaVersion: string;\n attestationId: string;\n createdAtUtc: string;\n mode: SatyaArtifactMode;\n statement: Record<string, unknown>;\n semanticStatement: Record<string, unknown>;\n disclosure?: Record<string, unknown>;\n witnessCommitment: Record<string, unknown>;\n witnessSignature: Record<string, unknown>;\n telemetry?: Record<string, unknown>;\n [key: string]: unknown;\n}\n"]}
1
+ {"version":3,"file":"artifact.types.js","sourceRoot":"","sources":["../../src/types/artifact.types.ts"],"names":[],"mappings":"","sourcesContent":["export type SatyaArtifactMode = 'native-pinned-observed';\n\nexport interface SatyaArtifact {\n schemaVersion: string;\n attestationId: string;\n attestationIdVersion?: string;\n producer?: SatyaArtifactProducer;\n createdAtUtc: string;\n mode: SatyaArtifactMode;\n statement: Record<string, unknown>;\n semanticStatement: Record<string, unknown>;\n disclosure?: Record<string, unknown>;\n witnessCommitment: Record<string, unknown>;\n witnessSignature: Record<string, unknown>;\n telemetry?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface SatyaArtifactProducer {\n sdk: string;\n sdkVersion: string;\n artifactSchemaVersion: string;\n coreVersion?: string;\n platform?: string;\n}\n"]}
@@ -10,18 +10,15 @@
10
10
  <key>HeadersPath</key>
11
11
  <string>Headers</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64_x86_64-simulator</string>
13
+ <string>ios-arm64</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libsatya_ffi.a</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
- <string>x86_64</string>
20
19
  </array>
21
20
  <key>SupportedPlatform</key>
22
21
  <string>ios</string>
23
- <key>SupportedPlatformVariant</key>
24
- <string>simulator</string>
25
22
  </dict>
26
23
  <dict>
27
24
  <key>BinaryPath</key>
@@ -29,15 +26,18 @@
29
26
  <key>HeadersPath</key>
30
27
  <string>Headers</string>
31
28
  <key>LibraryIdentifier</key>
32
- <string>ios-arm64</string>
29
+ <string>ios-arm64_x86_64-simulator</string>
33
30
  <key>LibraryPath</key>
34
31
  <string>libsatya_ffi.a</string>
35
32
  <key>SupportedArchitectures</key>
36
33
  <array>
37
34
  <string>arm64</string>
35
+ <string>x86_64</string>
38
36
  </array>
39
37
  <key>SupportedPlatform</key>
40
38
  <string>ios</string>
39
+ <key>SupportedPlatformVariant</key>
40
+ <string>simulator</string>
41
41
  </dict>
42
42
  </array>
43
43
  <key>CFBundlePackageType</key>
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'SatyaAttest'
3
- s.version = '1.1.1'
3
+ s.version = '1.2.0'
4
4
  s.summary = 'SATYA-W mobile TLS app-attestation (App Attest + Secure Enclave) backed by the Rust satya-sdk core'
5
5
  s.description = 'Expo native module wrapping the Rust satya-ffi XCFramework and layering iOS App Attest + Secure Enclave platform attestation.'
6
6
  s.author = 'Justin'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burnt-labs/expo-satya-attest",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "SATYA-W mobile TLS app-attestation (App Attest + Secure Enclave / Play Integrity) backed by the Rust satya-sdk core",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "prepublishOnly": "node internal/module_scripts/prepublish-check.js",
41
41
  "prepare": "node internal/module_scripts/prepare.js",
42
42
  "release:check": "node internal/module_scripts/prepublish-check.js",
43
- "test": "npm run build && node internal/module_scripts/test-providers.js && node internal/module_scripts/test-verifier-url.js && node internal/module_scripts/test-webview-chrome.js && node internal/module_scripts/test-reveal-rules.mjs && node internal/module_scripts/test-errors.js",
43
+ "test": "npm run build && node internal/module_scripts/test-providers.js && node internal/module_scripts/test-verifier-url.js && node internal/module_scripts/test-webview-chrome.js && node internal/module_scripts/test-reveal-rules.mjs && node internal/module_scripts/test-errors.js && node internal/module_scripts/test-artifact-metadata.js",
44
44
  "test:ios-spki": "node internal/module_scripts/test-ios-spki.js",
45
45
  "test:publishing-workflows": "node internal/module_scripts/test-publishing-workflows.js",
46
46
  "test:providers": "npm run build && node internal/module_scripts/test-providers.js",
@@ -1,4 +1,5 @@
1
1
  import SatyaAttest from './SatyaAttestModule';
2
+ import { attachArtifactProducer } from './artifactMetadata';
2
3
  import { satyaDebug } from './debugLog';
3
4
  import {
4
5
  SatyaArtifact,
@@ -120,7 +121,8 @@ export class SatyaMobileClient {
120
121
 
121
122
  let artifact: SatyaArtifact;
122
123
  try {
123
- artifact = JSON.parse(raw) as SatyaArtifact;
124
+ artifact = attachArtifactProducer(JSON.parse(raw) as SatyaArtifact, this.coreVersion());
125
+ raw = JSON.stringify(artifact);
124
126
  } catch (cause) {
125
127
  throw satyaError(
126
128
  SatyaErrorCode.ARTIFACT_VERIFICATION_FAILED,
@@ -0,0 +1,26 @@
1
+ import { EXPO_SATYA_ATTEST_SDK_NAME, EXPO_SATYA_ATTEST_SDK_VERSION } from './sdkMetadata.generated';
2
+ import type { SatyaArtifact, SatyaArtifactProducer } from './types';
3
+
4
+ export const SATYA_ARTIFACT_SCHEMA_VERSION = '1.0.0';
5
+ export const SATYA_ATTESTATION_ID_VERSION = 'statement-sha256-96-v1';
6
+
7
+ export function attachArtifactProducer(
8
+ artifact: SatyaArtifact,
9
+ coreVersion?: string
10
+ ): SatyaArtifact {
11
+ return {
12
+ ...artifact,
13
+ schemaVersion: SATYA_ARTIFACT_SCHEMA_VERSION,
14
+ attestationIdVersion: SATYA_ATTESTATION_ID_VERSION,
15
+ producer: expoArtifactProducer(coreVersion),
16
+ };
17
+ }
18
+
19
+ function expoArtifactProducer(coreVersion?: string): SatyaArtifactProducer {
20
+ return {
21
+ sdk: EXPO_SATYA_ATTEST_SDK_NAME,
22
+ sdkVersion: EXPO_SATYA_ATTEST_SDK_VERSION,
23
+ artifactSchemaVersion: SATYA_ARTIFACT_SCHEMA_VERSION,
24
+ coreVersion: coreVersion || undefined,
25
+ };
26
+ }
@@ -0,0 +1,3 @@
1
+ // Generated by internal/module_scripts/sync-sdk-metadata.js.
2
+ export const EXPO_SATYA_ATTEST_SDK_NAME = '@burnt-labs/expo-satya-attest' as const;
3
+ export const EXPO_SATYA_ATTEST_SDK_VERSION = '1.2.0' as const;
@@ -3,6 +3,8 @@ export type SatyaArtifactMode = 'native-pinned-observed';
3
3
  export interface SatyaArtifact {
4
4
  schemaVersion: string;
5
5
  attestationId: string;
6
+ attestationIdVersion?: string;
7
+ producer?: SatyaArtifactProducer;
6
8
  createdAtUtc: string;
7
9
  mode: SatyaArtifactMode;
8
10
  statement: Record<string, unknown>;
@@ -13,3 +15,11 @@ export interface SatyaArtifact {
13
15
  telemetry?: Record<string, unknown>;
14
16
  [key: string]: unknown;
15
17
  }
18
+
19
+ export interface SatyaArtifactProducer {
20
+ sdk: string;
21
+ sdkVersion: string;
22
+ artifactSchemaVersion: string;
23
+ coreVersion?: string;
24
+ platform?: string;
25
+ }