Skip to content

SonicGarden/auth-backup-firebase-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auth-backup-firebase-functions

Firebase Authentication Backup for Firebase Cloud Functions

Installation

npm install --save @sonicgarden/auth-backup-firebase-functions
// or
yarn add @sonicgarden/auth-backup-firebase-functions

$ gcloud services enable cloudkms.googleapis.com $ gcloud kms keyrings create --location=asia-northeast1 firebase-authentication-keyring --project sg-ops-firebase-staging $ gcloud kms keys create --location=asia-northeast1
--keyring=firebase-authentication-keyring
--purpose=encryption
--rotation-period=90d
--next-rotation-time="2022-07-31T00:00:00Z"
firebase-authentication-backup-key
--project sg-ops-firebase-staging

$ gcloud kms keys
add-iam-policy-binding
--location=asia-northeast1
--keyring=firebase-authentication-keyring
firebase-authentication-backup-key
--member=serviceAccount:sg-ops-firebase-staging@appspot.gserviceaccount.com
--role=roles/cloudkms.cryptoKeyEncrypter
--project sg-ops-firebase-staging

Usage

import * as authBackup from '@sonicgarden/auth-backup-firebase-functions';
export backupAuth = authBackup.backupAuth({
  region: 'asia-northeast1',
  schedule: '0 0 * * *',
  timeZone: 'Asia/Tokyo',
});

//or

const authBackup = require('@sonicgarden/auth-backup-firebase-functions');
exports.backupAuth = authBackup.backupAuth({
  region: 'asia-northeast1',
  schedule: '0 0 * * *',
  timeZone: 'Asia/Tokyo',
});

Parameters

parameter required default value
region optional asia-northeast1
schedule optional 0 0 * * *
timeZone optional Asia/Tokyo
projectId optional process.env.GCLOUD_PROJECT
bucketName optional ${projectId}-authentication-backups

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published