@firebase/app-check 0.11.3 → 0.11.4
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/app-check.d.ts +3 -3
- package/dist/esm/index.esm.js +17 -7
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/client.d.ts +1 -1
- package/dist/esm/src/providers.d.ts +2 -2
- package/dist/esm/src/types.d.ts +1 -1
- package/dist/index.cjs.js +17 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/src/client.d.ts +1 -1
- package/dist/src/providers.d.ts +2 -2
- package/dist/src/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/app-check.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ declare interface AppCheckProvider {
|
|
|
55
55
|
* Returns an App Check token.
|
|
56
56
|
* @internal
|
|
57
57
|
*/
|
|
58
|
-
getToken: () => Promise<AppCheckTokenInternal>;
|
|
58
|
+
getToken: (isLimitedUse?: boolean) => Promise<AppCheckTokenInternal>;
|
|
59
59
|
/**
|
|
60
60
|
* @internal
|
|
61
61
|
*/
|
|
@@ -229,7 +229,7 @@ export declare class ReCaptchaEnterpriseProvider implements AppCheckProvider {
|
|
|
229
229
|
* Returns an App Check token.
|
|
230
230
|
* @internal
|
|
231
231
|
*/
|
|
232
|
-
getToken(): Promise<AppCheckTokenInternal>;
|
|
232
|
+
getToken(isLimitedUse?: boolean): Promise<AppCheckTokenInternal>;
|
|
233
233
|
/**
|
|
234
234
|
* @internal
|
|
235
235
|
*/
|
|
@@ -264,7 +264,7 @@ export declare class ReCaptchaV3Provider implements AppCheckProvider {
|
|
|
264
264
|
* Returns an App Check token.
|
|
265
265
|
* @internal
|
|
266
266
|
*/
|
|
267
|
-
getToken(): Promise<AppCheckTokenInternal>;
|
|
267
|
+
getToken(isLimitedUse?: boolean): Promise<AppCheckTokenInternal>;
|
|
268
268
|
/**
|
|
269
269
|
* @internal
|
|
270
270
|
*/
|
package/dist/esm/index.esm.js
CHANGED
|
@@ -850,12 +850,14 @@ async function getLimitedUseToken$1(appCheck) {
|
|
|
850
850
|
const { provider } = getStateReference(app);
|
|
851
851
|
if (isDebugMode()) {
|
|
852
852
|
const debugToken = await getDebugToken();
|
|
853
|
-
const
|
|
853
|
+
const request = getExchangeDebugTokenRequest(app, debugToken);
|
|
854
|
+
request.body['limited_use'] = true;
|
|
855
|
+
const { token } = await exchangeToken(request, appCheck.heartbeatServiceProvider);
|
|
854
856
|
return { token };
|
|
855
857
|
}
|
|
856
858
|
else {
|
|
857
859
|
// provider is definitely valid since we ensure AppCheck was activated
|
|
858
|
-
const { token } = await provider.getToken();
|
|
860
|
+
const { token } = await provider.getToken(true /* isLimitedUse */);
|
|
859
861
|
return { token };
|
|
860
862
|
}
|
|
861
863
|
}
|
|
@@ -1051,7 +1053,7 @@ function internalFactory(appCheck) {
|
|
|
1051
1053
|
}
|
|
1052
1054
|
|
|
1053
1055
|
const name = "@firebase/app-check";
|
|
1054
|
-
const version = "0.11.
|
|
1056
|
+
const version = "0.11.4";
|
|
1055
1057
|
|
|
1056
1058
|
/**
|
|
1057
1059
|
* @license
|
|
@@ -1229,7 +1231,7 @@ class ReCaptchaV3Provider {
|
|
|
1229
1231
|
* Returns an App Check token.
|
|
1230
1232
|
* @internal
|
|
1231
1233
|
*/
|
|
1232
|
-
async getToken() {
|
|
1234
|
+
async getToken(isLimitedUse = false) {
|
|
1233
1235
|
throwIfThrottled(this._throttleData);
|
|
1234
1236
|
// Top-level `getToken()` has already checked that App Check is initialized
|
|
1235
1237
|
// and therefore this._app and this._heartbeatServiceProvider are available.
|
|
@@ -1243,7 +1245,11 @@ class ReCaptchaV3Provider {
|
|
|
1243
1245
|
}
|
|
1244
1246
|
let result;
|
|
1245
1247
|
try {
|
|
1246
|
-
|
|
1248
|
+
const request = getExchangeRecaptchaV3TokenRequest(this._app, attestedClaimsToken);
|
|
1249
|
+
if (isLimitedUse) {
|
|
1250
|
+
request.body['limited_use'] = true;
|
|
1251
|
+
}
|
|
1252
|
+
result = await exchangeToken(request, this._heartbeatServiceProvider);
|
|
1247
1253
|
}
|
|
1248
1254
|
catch (e) {
|
|
1249
1255
|
if (e.code?.includes("fetch-status-error" /* AppCheckError.FETCH_STATUS_ERROR */)) {
|
|
@@ -1306,7 +1312,7 @@ class ReCaptchaEnterpriseProvider {
|
|
|
1306
1312
|
* Returns an App Check token.
|
|
1307
1313
|
* @internal
|
|
1308
1314
|
*/
|
|
1309
|
-
async getToken() {
|
|
1315
|
+
async getToken(isLimitedUse = false) {
|
|
1310
1316
|
throwIfThrottled(this._throttleData);
|
|
1311
1317
|
// Top-level `getToken()` has already checked that App Check is initialized
|
|
1312
1318
|
// and therefore this._app and this._heartbeatServiceProvider are available.
|
|
@@ -1320,7 +1326,11 @@ class ReCaptchaEnterpriseProvider {
|
|
|
1320
1326
|
}
|
|
1321
1327
|
let result;
|
|
1322
1328
|
try {
|
|
1323
|
-
|
|
1329
|
+
const request = getExchangeRecaptchaEnterpriseTokenRequest(this._app, attestedClaimsToken);
|
|
1330
|
+
if (isLimitedUse) {
|
|
1331
|
+
request.body['limited_use'] = true;
|
|
1332
|
+
}
|
|
1333
|
+
result = await exchangeToken(request, this._heartbeatServiceProvider);
|
|
1324
1334
|
}
|
|
1325
1335
|
catch (e) {
|
|
1326
1336
|
if (e.code?.includes("fetch-status-error" /* AppCheckError.FETCH_STATUS_ERROR */)) {
|