openrtc-trust-apple-app-attest 2.0.0-rc.15
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/LICENSE +3 -0
- package/README.md +18 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/package.json +16 -0
package/LICENSE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# openrtc-trust-apple-app-attest
|
|
2
|
+
|
|
3
|
+
This package adapts an application-owned native App Attest implementation to
|
|
4
|
+
OpenRTC's provider-neutral enrollment interface. The native host must return
|
|
5
|
+
evidence bound to the exact challenge it receives. Encode the host result as a
|
|
6
|
+
base64url JSON token. Initial enrollment uses
|
|
7
|
+
`{ mode: "attestation", keyId, attestationObject }`; renewal uses
|
|
8
|
+
`{ mode: "assertion", keyId, assertion }`. Binary fields are base64url.
|
|
9
|
+
|
|
10
|
+
OpenRTC verifies Apple’s App Attestation root chain, certificate nonce, App ID
|
|
11
|
+
RP hash, environment AAGUID, key identifier, validation category, bundle
|
|
12
|
+
version, assertion signature, challenge binding, and monotonic counter. Only
|
|
13
|
+
the verified public key and counter are retained; raw evidence is never stored.
|
|
14
|
+
|
|
15
|
+
`AppleAppAttestProvider` declares `request-challenge` binding. The separate
|
|
16
|
+
`AppleDeviceCheckProvider` is a lower-trust `app-session` fallback: DeviceCheck
|
|
17
|
+
does not sign OpenRTC's enrollment challenge and must be registered separately
|
|
18
|
+
in the developer manifest. Neither adapter is a connection heartbeat.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { OpenRTCAttestationProvider } from 'openrtc';
|
|
2
|
+
export interface AppleAppAttestHost {
|
|
3
|
+
attest(input: {
|
|
4
|
+
challenge: string;
|
|
5
|
+
apiKey: string;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
token: string;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export declare class AppleAppAttestProvider implements OpenRTCAttestationProvider {
|
|
11
|
+
private readonly host;
|
|
12
|
+
readonly kind: "apple-app-attest";
|
|
13
|
+
readonly evidenceBinding: "request-challenge";
|
|
14
|
+
constructor(host: AppleAppAttestHost);
|
|
15
|
+
getEvidence(input: {
|
|
16
|
+
challenge: string;
|
|
17
|
+
apiKey: string;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
token: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
/** Explicitly lower-trust fallback; it must be registered separately in the portal. */
|
|
23
|
+
export declare class AppleDeviceCheckProvider implements OpenRTCAttestationProvider {
|
|
24
|
+
private readonly host;
|
|
25
|
+
readonly kind: "custom:apple-device-check";
|
|
26
|
+
readonly evidenceBinding: "app-session";
|
|
27
|
+
constructor(host: AppleAppAttestHost);
|
|
28
|
+
getEvidence(input: {
|
|
29
|
+
challenge: string;
|
|
30
|
+
apiKey: string;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
token: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpF;AAED,qBAAa,sBAAuB,YAAW,0BAA0B;IAGzD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,QAAQ,CAAC,IAAI,EAAG,kBAAkB,CAAU;IAC5C,QAAQ,CAAC,eAAe,EAAG,mBAAmB,CAAU;gBAC3B,IAAI,EAAE,kBAAkB;IAE/C,WAAW,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAK9F;AAED,uFAAuF;AACvF,qBAAa,wBAAyB,YAAW,0BAA0B;IAG3D,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,QAAQ,CAAC,IAAI,EAAG,2BAA2B,CAAU;IACrD,QAAQ,CAAC,eAAe,EAAG,aAAa,CAAU;gBACrB,IAAI,EAAE,kBAAkB;IAE/C,WAAW,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAK9F"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class AppleAppAttestProvider {
|
|
2
|
+
constructor(host) {
|
|
3
|
+
this.host = host;
|
|
4
|
+
this.kind = 'apple-app-attest';
|
|
5
|
+
this.evidenceBinding = 'request-challenge';
|
|
6
|
+
}
|
|
7
|
+
async getEvidence(input) {
|
|
8
|
+
const evidence = await this.host.attest(input);
|
|
9
|
+
if (!evidence.token)
|
|
10
|
+
throw new Error('Apple App Attest returned empty evidence.');
|
|
11
|
+
return evidence;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/** Explicitly lower-trust fallback; it must be registered separately in the portal. */
|
|
15
|
+
export class AppleDeviceCheckProvider {
|
|
16
|
+
constructor(host) {
|
|
17
|
+
this.host = host;
|
|
18
|
+
this.kind = 'custom:apple-device-check';
|
|
19
|
+
this.evidenceBinding = 'app-session';
|
|
20
|
+
}
|
|
21
|
+
async getEvidence(input) {
|
|
22
|
+
const evidence = await this.host.attest(input);
|
|
23
|
+
if (!evidence.token)
|
|
24
|
+
throw new Error('Apple DeviceCheck returned empty evidence.');
|
|
25
|
+
return evidence;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,sBAAsB;IAG/B,YAA6B,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;QAF5C,SAAI,GAAG,kBAA2B,CAAC;QACnC,oBAAe,GAAG,mBAA4B,CAAC;IACA,CAAC;IAEzD,KAAK,CAAC,WAAW,CAAC,KAA4C;QAC1D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,QAAQ,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAClF,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAED,uFAAuF;AACvF,MAAM,OAAO,wBAAwB;IAGjC,YAA6B,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;QAF5C,SAAI,GAAG,2BAAoC,CAAC;QAC5C,oBAAe,GAAG,aAAsB,CAAC;IACM,CAAC;IAEzD,KAAK,CAAC,WAAW,CAAC,KAA4C;QAC1D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,QAAQ,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QACnF,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openrtc-trust-apple-app-attest",
|
|
3
|
+
"version": "2.0.0-rc.15",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"description": "Optional Apple App Attest host adapter for OpenRTC 2.0 device enrollment.",
|
|
8
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"files": ["dist", "LICENSE", "README.md"],
|
|
12
|
+
"exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" }, "./package.json": "./package.json" },
|
|
13
|
+
"scripts": { "build": "rm -rf dist && tsc", "test": "vitest run", "test:deterministic": "vitest run", "prepublishOnly": "pnpm run build && pnpm run test" },
|
|
14
|
+
"peerDependencies": { "openrtc": "2.0.0-rc.15" },
|
|
15
|
+
"devDependencies": { "openrtc": "workspace:*", "typescript": "^5.8.3", "vitest": "^4.0.18" }
|
|
16
|
+
}
|