Skip to content

Commit c220234

Browse files
committed
PR Feedback
1 parent f0119d6 commit c220234

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

.changeset/rude-adults-rest.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@firebase/app-check-interop-types': minor
3+
'@firebase/app-check': minor
4+
'@firebase/functions': minor
5+
---
6+
7+
Add support for App Check replay protection in callable functions

docs-devsite/functions.httpscallableoptions.md

+11
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface HttpsCallableOptions
2323
| Property | Type | Description |
2424
| --- | --- | --- |
2525
| [timeout](./functions.httpscallableoptions.md#httpscallableoptionstimeout) | number | Time in milliseconds after which to cancel if there is no response. Default is 70000. |
26+
| [useLimitedUseAppCheckToken](./functions.httpscallableoptions.md#httpscallableoptionsuselimiteduseappchecktoken) | boolean | If set to true, uses limited use App Check token for callable function requests from this instance of Functions. By default, this is false. |
2627

2728
## HttpsCallableOptions.timeout
2829

@@ -33,3 +34,13 @@ Time in milliseconds after which to cancel if there is no response. Default is 7
3334
```typescript
3435
timeout?: number;
3536
```
37+
38+
## HttpsCallableOptions.useLimitedUseAppCheckToken
39+
40+
If set to true, uses limited use App Check token for callable function requests from this instance of Functions. By default, this is false.
41+
42+
<b>Signature:</b>
43+
44+
```typescript
45+
useLimitedUseAppCheckToken?: boolean;
46+
```

packages/functions/src/callable.test.ts

+4-24
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,6 @@ describe('Firebase Functions > Call', () => {
138138
});
139139

140140
it('app check token', async () => {
141-
const authProvider = new Provider<FirebaseAuthInternalName>(
142-
'auth-internal',
143-
new ComponentContainer('test')
144-
);
145-
146-
const messagingProvider = new Provider<MessagingInternalComponentName>(
147-
'messaging-internal',
148-
new ComponentContainer('test')
149-
);
150-
151141
const appCheckMock: FirebaseAppCheckInternal = {
152142
getToken: async () => ({ token: 'app-check-token' })
153143
} as unknown as FirebaseAppCheckInternal;
@@ -165,8 +155,8 @@ describe('Firebase Functions > Call', () => {
165155
const functions = createTestService(
166156
app,
167157
region,
168-
authProvider,
169-
messagingProvider,
158+
undefined,
159+
undefined,
170160
appCheckProvider
171161
);
172162

@@ -181,16 +171,6 @@ describe('Firebase Functions > Call', () => {
181171
});
182172

183173
it('app check limited use token', async () => {
184-
const authProvider = new Provider<FirebaseAuthInternalName>(
185-
'auth-internal',
186-
new ComponentContainer('test')
187-
);
188-
189-
const messagingProvider = new Provider<MessagingInternalComponentName>(
190-
'messaging-internal',
191-
new ComponentContainer('test')
192-
);
193-
194174
const appCheckMock: FirebaseAppCheckInternal = {
195175
getLimitedUseToken: async () => ({ token: 'app-check-single-use-token' })
196176
} as unknown as FirebaseAppCheckInternal;
@@ -208,8 +188,8 @@ describe('Firebase Functions > Call', () => {
208188
const functions = createTestService(
209189
app,
210190
region,
211-
authProvider,
212-
messagingProvider,
191+
undefined,
192+
undefined,
213193
appCheckProvider
214194
);
215195

0 commit comments

Comments
 (0)