@mentra/cloud-client 3.3.0-dev.797 → 3.3.0-dev.801
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/package.json +2 -2
- package/src/modules/auth/auth.ts +5 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mentra/cloud-client",
|
|
3
|
-
"version": "3.3.0-dev.
|
|
3
|
+
"version": "3.3.0-dev.801",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "bun test"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@mentra/cloud-protocol": "3.3.0-dev.
|
|
15
|
+
"@mentra/cloud-protocol": "3.3.0-dev.801",
|
|
16
16
|
"tweetnacl": "^1.0.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
package/src/modules/auth/auth.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface AuthModule {
|
|
|
53
53
|
// a miniapp-scoped token, cached per packageName and re-minted before expiry
|
|
54
54
|
getMiniappToken(
|
|
55
55
|
packageName: string,
|
|
56
|
-
opts?: {minTtlMs?: number
|
|
56
|
+
opts?: {minTtlMs?: number},
|
|
57
57
|
): Promise<{token: string; expiresAt: number}>
|
|
58
58
|
// Core-owned user/oem identity, read from the Core access token.
|
|
59
59
|
// Runtime-only deployments do not expose this surface.
|
|
@@ -257,7 +257,7 @@ export class Auth implements AuthModule {
|
|
|
257
257
|
*/
|
|
258
258
|
async getMiniappToken(
|
|
259
259
|
packageName: string,
|
|
260
|
-
opts?: {minTtlMs?: number
|
|
260
|
+
opts?: {minTtlMs?: number},
|
|
261
261
|
): Promise<{token: string; expiresAt: number}> {
|
|
262
262
|
this.assertSessionActive()
|
|
263
263
|
const generation = this.sessionGeneration
|
|
@@ -277,14 +277,9 @@ export class Auth implements AuthModule {
|
|
|
277
277
|
|
|
278
278
|
const accessToken = await this.getCoreToken()
|
|
279
279
|
const http = this.requireCoreHttp()
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
packageName,
|
|
284
|
-
...(opts?.devAttestation ? {devAttestation: opts.devAttestation} : {}),
|
|
285
|
-
},
|
|
286
|
-
{bearer: accessToken},
|
|
287
|
-
)
|
|
280
|
+
// A dev build of a package is that package: the request names it and
|
|
281
|
+
// nothing else. The phone has already applied the installed signer rule.
|
|
282
|
+
const res = await http.post<MiniappTokenEntry>(MINIAPP_TOKEN_PATH, {packageName}, {bearer: accessToken})
|
|
288
283
|
|
|
289
284
|
this.assertSessionActive(generation)
|
|
290
285
|
const entry: MiniappTokenEntry = {token: res.token, expiresAt: res.expiresAt}
|