openrtc-trust-play-integrity 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 +14 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/package.json +16 -0
package/LICENSE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# openrtc-trust-play-integrity
|
|
2
|
+
|
|
3
|
+
This package adapts an application-owned native Play Integrity implementation
|
|
4
|
+
to OpenRTC's provider-neutral enrollment interface. The native host must bind
|
|
5
|
+
the returned standard token to `base64url(SHA-256(challenge))` as the Play
|
|
6
|
+
Integrity `requestHash`. Package/signing identity, freshness, request hash,
|
|
7
|
+
app recognition, licensing policy, and device-integrity verdicts are validated
|
|
8
|
+
by the managed server adapter. Request tokens only for enrollment, key
|
|
9
|
+
rotation, recovery, or an explicit risk escalation—not as a connection timer.
|
|
10
|
+
|
|
11
|
+
The adapter declares `request-challenge` binding. OpenRTC still verifies the
|
|
12
|
+
install-key signature and nonce independently, and the server derives the
|
|
13
|
+
authoritative trust policy from the registered provider rather than trusting a
|
|
14
|
+
client-declared strength.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { OpenRTCAttestationProvider } from 'openrtc';
|
|
2
|
+
export interface PlayIntegrityHost {
|
|
3
|
+
attest(input: {
|
|
4
|
+
challenge: string;
|
|
5
|
+
apiKey: string;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
token: string;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export declare class PlayIntegrityProvider implements OpenRTCAttestationProvider {
|
|
11
|
+
private readonly host;
|
|
12
|
+
readonly kind: "play-integrity";
|
|
13
|
+
readonly evidenceBinding: "request-challenge";
|
|
14
|
+
constructor(host: PlayIntegrityHost);
|
|
15
|
+
getEvidence(input: {
|
|
16
|
+
challenge: string;
|
|
17
|
+
apiKey: string;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
token: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
//# 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,iBAAiB;IAC9B,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,qBAAsB,YAAW,0BAA0B;IAGxD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAC1C,QAAQ,CAAC,eAAe,EAAG,mBAAmB,CAAU;gBAC3B,IAAI,EAAE,iBAAiB;IAE9C,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,14 @@
|
|
|
1
|
+
export class PlayIntegrityProvider {
|
|
2
|
+
constructor(host) {
|
|
3
|
+
this.host = host;
|
|
4
|
+
this.kind = 'play-integrity';
|
|
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('Play Integrity returned empty evidence.');
|
|
11
|
+
return evidence;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,qBAAqB;IAG9B,YAA6B,IAAuB;QAAvB,SAAI,GAAJ,IAAI,CAAmB;QAF3C,SAAI,GAAG,gBAAyB,CAAC;QACjC,oBAAe,GAAG,mBAA4B,CAAC;IACD,CAAC;IAExD,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,yCAAyC,CAAC,CAAC;QAChF,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openrtc-trust-play-integrity",
|
|
3
|
+
"version": "2.0.0-rc.15",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"description": "Optional Google Play Integrity 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
|
+
}
|