Skip to content

feat: Add abuse reduction support #1264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/scripts/run_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ gpg --quiet --batch --yes --decrypt --passphrase="${FIREBASE_SERVICE_ACCT_KEY}"

echo "${FIREBASE_API_KEY}" > test/resources/apikey.txt

echo "${FIREBASE_APP_ID}" > test/resources/appid.txt

npm run test:integration -- --updateRules --testMultiTenancy
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
env:
FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }}
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}

- name: Package release artifacts
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
env:
FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }}
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}

- name: Package release artifacts
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ node_modules/
# Real key file should not be checked in
test/resources/key.json
test/resources/apikey.txt
test/resources/appid.txt

# Release tarballs should not be checked in
firebase-admin-*.tgz
Expand Down
12 changes: 12 additions & 0 deletions docgen/content-sources/node/toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ toc:
- title: "App"
path: /docs/reference/admin/node/admin.app.App-1

- title: "admin.appCheck"
path: /docs/reference/admin/node/admin.appCheck
section:
- title: "AppCheck"
path: /docs/reference/admin/node/admin.appCheck.AppCheck-1
- title: "AppCheckToken"
path: /docs/reference/admin/node/admin.appCheck.AppCheckToken
- title: "DecodedAppCheckToken"
path: /docs/reference/admin/node/admin.appCheck.DecodedAppCheckToken
- title: "VerifyAppCheckTokenResponse"
path: /docs/reference/admin/node/admin.appCheck.VerifyAppCheckTokenResponse

- title: "admin.auth"
path: /docs/reference/admin/node/admin.auth
section:
Expand Down
33 changes: 33 additions & 0 deletions etc/firebase-admin.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export function app(name?: string): app.App;
// @public (undocumented)
export namespace app {
export interface App {
// (undocumented)
appCheck(): appCheck.AppCheck;
// (undocumented)
auth(): auth.Auth;
// (undocumented)
Expand All @@ -41,6 +43,37 @@ export namespace app {
}
}

// @public
export function appCheck(app?: app.App): appCheck.AppCheck;

// @public (undocumented)
export namespace appCheck {
export interface AppCheck {
// (undocumented)
app: app.App;
createToken(appId: string): Promise<AppCheckToken>;
verifyToken(appCheckToken: string): Promise<VerifyAppCheckTokenResponse>;
}
export interface AppCheckToken {
token: string;
ttlMillis: number;
}
export interface DecodedAppCheckToken {
// (undocumented)
[key: string]: any;
app_id: string;
aud: string[];
exp: number;
iat: number;
iss: string;
sub: string;
}
export interface VerifyAppCheckTokenResponse {
appId: string;
token: appCheck.DecodedAppCheckToken;
}
}

// @public
export interface AppOptions {
credential?: credential.Credential;
Expand Down
Loading