-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Other): add App Check support (#7905)
- Loading branch information
Showing
13 changed files
with
360 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
.github/workflows/scripts/functions/src/fetchAppCheckToken.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* | ||
* Testing tools for invertase/react-native-firebase use only. | ||
* | ||
* Copyright (C) 2018-present Invertase Limited <[email protected]> | ||
* | ||
* See License file for more information. | ||
*/ | ||
|
||
import * as admin from 'firebase-admin'; | ||
import * as functions from 'firebase-functions'; | ||
|
||
// Note: this will only work in a live environment, not locally via the Firebase emulator. | ||
export const fetchAppCheckToken = functions.https.onCall(async data => { | ||
const { appId } = data; | ||
const expireTimeMillis = Math.floor(Date.now() / 1000) + 60 * 60; | ||
const result = await admin.appCheck().createToken(appId); | ||
return { ...result, expireTimeMillis }; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.