Skip to content

Commit ce75551

Browse files
committed
Merge remote-tracking branch 'origin/master' into rsgowman/enable_anon_auth
2 parents 1d3dff2 + eecbe41 commit ce75551

File tree

134 files changed

+24857
-14643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+24857
-14643
lines changed

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ module.exports = {
3636

3737
// Required checks
3838
'indent': ['error', 2],
39+
'keyword-spacing': ['error'],
40+
'max-len': [
41+
'error',
42+
{
43+
'code': 120,
44+
'ignoreUrls': true
45+
}
46+
],
47+
'object-curly-spacing': [2, 'always'],
3948
'@typescript-eslint/explicit-function-return-type': [
4049
'error',
4150
{
@@ -44,5 +53,8 @@ module.exports = {
4453
'allowHigherOrderFunctions': true
4554
}
4655
],
56+
'no-unused-vars': 'off', // Must be disabled to enable the next rule
57+
'@typescript-eslint/no-unused-vars': ['error'],
58+
'quotes': ['error', 'single', {'avoidEscape': true}]
4759
}
4860
};

.github/ISSUE_TEMPLATE/general-bug-report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ assignees: ''
77

88
---
99

10+
**Thank you for submitting your issue. We are operating at reduced capacity from Dec 18 2020 to Jan 4 2021. Please expect delayed responses. For more urgent requests please reach us via our support channels https://firebase.google.com/support**
11+
1012
### [READ] Step 1: Are you in the right place?
1113

1214
* For issues related to __the code in this repository__ file a Github issue.

.github/actions/send-tweet/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
name: 'Send Tweet Action'
1616
description: 'Send Tweets from GitHub Actions workflows.'
1717
inputs:
18-
repo:
19-
status: Status (Tweet) to be posted
18+
status:
19+
description: Status (Tweet) to be posted
2020
required: true
2121
consumer-key:
2222
description: Consumer API key.

.github/actions/send-tweet/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/send-tweet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
1515
"license": "Apache-2.0",
1616
"dependencies": {
17-
"@actions/core": "^1.2.2",
17+
"@actions/core": "^1.2.6",
1818
"twitter": "^1.7.1"
1919
},
2020
"devDependencies": {

.github/scripts/publish_package.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
set -e
1818
set -u
1919

20-
echo "//wombat-dressing-room.appspot.com/:_authToken=${NPM_AUTH_TOKEN}" >> ~/.npmrc
20+
echo "//wombat-dressing-room.appspot.com/:_authToken=${NPM_AUTH_TOKEN}" >> .npmrc
2121

2222
readonly UNPREFIXED_VERSION=`echo ${VERSION} | cut -c 2-`
23-
npm publish dist/firebase-admin-${UNPREFIXED_VERSION}.tgz --registry https://wombat-dressing-room.appspot.com
23+
npm publish ./dist/firebase-admin-${UNPREFIXED_VERSION}.tgz --registry https://wombat-dressing-room.appspot.com

verifyReleaseTarball.sh renamed to .github/scripts/verify_package.sh

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,55 +21,53 @@
2121
# applications.
2222

2323
set -e
24+
set -u
2425

2526
if [ -z "$1" ]; then
2627
echo "[ERROR] No package name provided."
27-
echo "[INFO] Usage: ./verifyReleaseTarball.sh <PACKAGE_NAME>"
28+
echo "[INFO] Usage: ./verify_package.sh <PACKAGE_NAME>"
2829
exit 1
2930
fi
3031

31-
# Variables
3232
PKG_NAME="$1"
33-
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
34-
MOCHA_CLI="$ROOT/node_modules/.bin/mocha -r ts-node/register"
35-
DIR="$ROOT/test/integration/typescript"
36-
WORK_DIR=`mktemp -d`
37-
38-
if [ ! -f "$ROOT/$PKG_NAME" ]; then
39-
echo "Package $PKG_NAME does not exist."
33+
if [ ! -f "${PKG_NAME}" ]; then
34+
echo "Package ${PKG_NAME} does not exist."
4035
exit 1
4136
fi
4237

43-
# check if tmp dir was created
44-
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
38+
# create a temporary directory
39+
WORK_DIR=`mktemp -d`
40+
if [[ ! "${WORK_DIR}" || ! -d "${WORK_DIR}" ]]; then
4541
echo "Could not create temp dir"
4642
exit 1
4743
fi
4844

4945
# deletes the temp directory
50-
function cleanup {
51-
rm -rf "$WORK_DIR"
52-
echo "Deleted temp working directory $WORK_DIR"
46+
function cleanup {
47+
rm -rf "${WORK_DIR}"
48+
echo "Deleted temp working directory ${WORK_DIR}"
5349
}
5450

5551
# register the cleanup function to be called on the EXIT signal
5652
trap cleanup EXIT
5753

58-
# Enter work dir
59-
pushd "$WORK_DIR"
54+
# Copy package and test sources into working directory
55+
cp "${PKG_NAME}" "${WORK_DIR}"
56+
cp -r test/integration/typescript/* "${WORK_DIR}"
57+
cp test/resources/mock.key.json "${WORK_DIR}"
6058

61-
# Copy test sources into working directory
62-
cp -r $DIR/* .
63-
cp "$ROOT/test/resources/mock.key.json" .
59+
# Enter work dir
60+
pushd "${WORK_DIR}"
6461

6562
# Install the test package
6663
npm install
6764

6865
# Install firebase-admin package
69-
npm install -S "$ROOT/$PKG_NAME"
66+
npm install -S "${PKG_NAME}"
7067

7168
echo "> tsc -p tsconfig.json"
72-
$ROOT/node_modules/.bin/tsc -p tsconfig.json
69+
./node_modules/.bin/tsc -p tsconfig.json
7370

71+
MOCHA_CLI="./node_modules/.bin/mocha -r ts-node/register"
7472
echo "> $MOCHA_CLI src/*.test.ts"
75-
$MOCHA_CLI src/*.test.ts
73+
$MOCHA_CLI src/*.test.ts

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Continuous Integration
22

3-
on: push
3+
on: pull_request
44

55
jobs:
66
build:
@@ -9,7 +9,7 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [8.x, 10.x]
12+
node-version: [10.x, 12.x, 14.x]
1313

1414
steps:
1515
- uses: actions/checkout@v1
@@ -23,3 +23,4 @@ jobs:
2323
npm run build
2424
npm run build:tests
2525
npm test
26+
npm run api-extractor

.github/workflows/release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Set up Node.js
4848
uses: actions/setup-node@v1
4949
with:
50-
node-version: 8.x
50+
node-version: 10.x
5151

5252
- name: Install and build
5353
run: |
@@ -58,6 +58,9 @@ jobs:
5858
- name: Run unit tests
5959
run: npm test
6060

61+
- name: Verify public API
62+
run: npm run api-extractor
63+
6164
- name: Run integration tests
6265
run: ./.github/scripts/run_integration_tests.sh
6366
env:
@@ -78,11 +81,10 @@ jobs:
7881
name: dist
7982
path: dist
8083

81-
# TODO: Move this script to .github/scripts.
8284
- name: Verify tarball
8385
run: |
8486
PACKAGE_TARBALL=`ls firebase-admin-*.tgz`
85-
./verifyReleaseTarball.sh $PACKAGE_TARBALL
87+
./.github/scripts/verify_package.sh $PACKAGE_TARBALL
8688
8789
publish_release:
8890
needs: stage_release
@@ -113,7 +115,7 @@ jobs:
113115
- name: Set up Node.js
114116
uses: actions/setup-node@v1
115117
with:
116-
node-version: 8.x
118+
node-version: 10.x
117119

118120
- name: Publish preflight check
119121
id: preflight
@@ -146,7 +148,7 @@ jobs:
146148
uses: ./.github/actions/send-tweet
147149
with:
148150
status: >
149-
${{ steps.preflight.outputs.version }} of @Firebase Admin Node.js SDK is avaialble.
151+
${{ steps.preflight.outputs.version }} of @Firebase Admin Node.js SDK is available.
150152
https://github.com/firebase/firebase-admin-node/releases/tag/${{ steps.preflight.outputs.version }}
151153
consumer-key: ${{ secrets.TWITTER_CONSUMER_KEY }}
152154
consumer-secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ npm-debug.log
55

66
lib/
77
.tmp/
8+
temp/
89
typings/
910
coverage/
1011
node_modules/

CONTRIBUTING.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ information on using pull requests.
8787

8888
### Prerequisites
8989

90-
1. Node.js 8.13.0 or higher.
90+
1. Node.js 10.10.0 or higher.
9191
2. NPM 5 or higher (NPM 6 recommended).
9292
3. Google Cloud SDK ([`gcloud`](https://cloud.google.com/sdk/downloads) utility)
9393

@@ -155,13 +155,17 @@ Then set up your Firebase/GCP project as follows:
155155
Firebase Console. Select the "Sign-in method" tab, and enable the
156156
"Email/Password" sign-in method, including the Email link (passwordless
157157
sign-in) option.
158-
3. Enable the IAM API: Go to the
158+
3. Enable the Firebase ML API: Go to the
159+
[Google Developers Console](
160+
https://console.developers.google.com/apis/api/firebaseml.googleapis.com/overview)
161+
and make sure your project is selected. If the API is not already enabled, click Enable.
162+
4. Enable the IAM API: Go to the
159163
[Google Cloud Platform Console](https://console.cloud.google.com) and make
160164
sure your Firebase/GCP project is selected. Select "APIs & Services >
161165
Dashboard" from the main menu, and click the "ENABLE APIS AND SERVICES"
162166
button. Search for and enable the "Identity and Access Management (IAM)
163167
API".
164-
4. Grant your service account the 'Firebase Authentication Admin' role. This is
168+
5. Grant your service account the 'Firebase Authentication Admin' role. This is
165169
required to ensure that exported user records contain the password hashes of
166170
the user accounts:
167171
1. Go to [Google Cloud Platform Console / IAM & admin](https://console.cloud.google.com/iam-admin).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ requests, code review feedback, and also pull requests.
5555

5656
## Supported Environments
5757

58-
We support Node.js 8.13.0 and higher.
58+
We support Node.js 10.10.0 and higher.
5959

6060
Please also note that the Admin SDK should only
6161
be used in server-side/back-end environments controlled by the app developer.

0 commit comments

Comments
 (0)