Skip to content

Merge auth-exp into master #3722

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 111 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
3d36734
Initial submit of auth-next framework (#2851)
sam-gc Apr 3, 2020
7c9ba3e
Add mock fetch helper (#2878)
sam-gc Apr 7, 2020
e01666a
Add core types & error map to auth-exp (#2890)
avolkovi Apr 10, 2020
f26d746
Add signUp API method for auth-next (#2892)
avolkovi Apr 13, 2020
f2844c6
Add initial user object implementation (#2896)
sam-gc Apr 14, 2020
a4524d7
Consolidate mock auth object, add user object (#2906)
sam-gc Apr 14, 2020
7d40bf4
Add remaining API methods to auth-next (#2901)
avolkovi Apr 15, 2020
4f70d0e
Add support for API timeouts to auth-next (#2915)
avolkovi Apr 16, 2020
cd682ec
Add version helpers to auth-next (#2910)
avolkovi Apr 16, 2020
77d0809
Add persistence layer: index db, in memory, and browser{local, sessio…
sam-gc Apr 16, 2020
603d5a1
Add fetchSignInMethodsForEmail to auth-next (#2924)
avolkovi Apr 17, 2020
9dd0683
Add sendEmailVerification to auth-next (#2926)
avolkovi Apr 20, 2020
13d007b
Add a persistence manager class (#2925)
sam-gc Apr 20, 2020
2f76777
Added react native build target (#2947)
avolkovi Apr 21, 2020
92fcd3d
Add password reset methods to auth-next (#2928)
avolkovi Apr 21, 2020
fdf6aed
use queryString helper in auth-next (#2936)
avolkovi Apr 21, 2020
e50c16a
Initial auth object implementation + initializeAuth() (#2932)
sam-gc Apr 22, 2020
a68e597
use app-exp in the build:deps script
Feiyang1 Apr 22, 2020
2dea002
Add conditional delays to auth-next (#2934)
avolkovi Apr 23, 2020
f97ff83
Add sendSignInWithEmail to auth-next (#2960)
avolkovi Apr 23, 2020
54c574a
Add auth listener implementation, add user.reload() (#2961)
sam-gc Apr 23, 2020
fef3796
Standardize auth-next style (#2983)
avolkovi Apr 24, 2020
e14fd14
Add refresh token endpoint + implementation to token manager (#2975)
sam-gc May 4, 2020
5076fe6
Add react native persistence class (#2955)
avolkovi May 4, 2020
aa0fcb4
Add getIdTokenResult implementation (#3014)
sam-gc May 5, 2020
8b715a6
Update internal types to work with external types (#3075)
sam-gc May 15, 2020
781ff7a
Further refactoring of auth types. Add public exports to src/index.ts…
sam-gc May 19, 2020
4d3fbc9
user.delete() implementation (#3072)
sam-gc May 19, 2020
f01abbb
Use auth impl object instead of mock auth object (#3098)
sam-gc May 21, 2020
8a28557
Add signInWithCredential to auth-next (#2963)
avolkovi May 27, 2020
88d9cc5
Refactor so every unit test gets its own Auth object (#3129)
sam-gc May 28, 2020
c8acf25
Add updateProfile, updateEmail, updatePassword (#3122)
sam-gc Jun 1, 2020
a78d79e
Add recaptcha implementation (#3166)
sam-gc Jun 5, 2020
d64083e
Add signInWithPhoneNumber implementation (#3191)
sam-gc Jun 9, 2020
dcd9238
Add signInAnonymously to auth-next (#2986)
avolkovi Jun 9, 2020
f333fbb
Add signInWithCustomToken implementation (#3136)
sam-gc Jun 10, 2020
5f2fa05
add signInWithEmailAndPassword & signInWithEmailLink to auth-next (#3…
avolkovi Jun 12, 2020
b2de41a
Add linkWithCredential(), linkWithPhoneNumber(), unlink() (#3213)
sam-gc Jun 15, 2020
cfd6d00
Add createUserWithEmailAndPassword to auth-next (#3212)
avolkovi Jun 15, 2020
26ac663
Cleanup public types in auth-next (#3217)
avolkovi Jun 16, 2020
77f5813
Add a demo page to auth-exp using the new modular methods (#3197)
sam-gc Jun 16, 2020
3d90e2e
Add custom email flow methods to auth-next (#3223)
avolkovi Jun 16, 2020
a2c8b42
Add reauthenticateWithCredential, reauthenticateWithPhoneNumber (#3225)
sam-gc Jun 16, 2020
3d490d0
Add link and reauth implementation to email credential (#3226)
sam-gc Jun 17, 2020
f9eb317
Add AdditionalUserInfo class to auth-exp (#2979)
avolkovi Jun 24, 2020
b9525cf
Big refactor of reauth / link + basic idp tasks (#3242)
sam-gc Jun 24, 2020
3228e3f
Add useDeviceLanguage to auth-next (#3273)
avolkovi Jun 24, 2020
fa723c4
Fix broken build (#3275)
avolkovi Jun 24, 2020
0c38816
Address (some) of the tree shaking issues w/ ReCaptcha (#3277)
sam-gc Jun 24, 2020
fa0833a
Add gapi and iframe loading libraries (#3334)
sam-gc Jul 6, 2020
2fa42d3
Add popup util and bare-bones OAuthProvider (#3335)
sam-gc Jul 6, 2020
713dd10
First pass at adding MFA support to auth-next (#3292)
avolkovi Jul 7, 2020
0192ae5
Tree shakeable persistence (#3288)
sam-gc Jul 8, 2020
3ed64f6
Make the _getInstance() instantiator a util for the whole SDK (#3369)
sam-gc Jul 8, 2020
2d14646
Add browser popup resolver class, some utils (#3336)
sam-gc Jul 8, 2020
b56ae95
Merge conflict
avolkovi Jul 8, 2020
90a6a4c
Cleanup demo code & get it working with MFA flows (#3380)
avolkovi Jul 9, 2020
663c9f9
Add updatePhoneNumber to auth-next (#3392)
avolkovi Jul 13, 2020
aed80ee
Add verifyBeforeUpdate to auth-next (#3391)
avolkovi Jul 13, 2020
293bb24
Add popup strategy implementation, (sign in, link, reauth) (#3363)
sam-gc Jul 14, 2020
a389131
Update the auth event manager to handle redirects. Add redirect logic…
sam-gc Jul 15, 2020
4fe05df
Populate enrolled factors on reload() (#3406)
avolkovi Jul 15, 2020
d13b786
Add persistence for redirect users (#3410)
sam-gc Jul 15, 2020
006142a
Web worker support for auth-next (#3413)
avolkovi Jul 17, 2020
3ec6602
Add redirect strategy (#3416)
sam-gc Jul 20, 2020
5ed0335
Add auth isolation for oauth flows (#3420)
sam-gc Jul 20, 2020
4588d88
Move all of our helper files in test/ to a new directory test/helpers…
sam-gc Jul 22, 2020
6a80c1b
Foundation for integration tests for auth-exp (#3453)
sam-gc Jul 22, 2020
08c808b
Add integration tests for anonymous auth (#3455)
sam-gc Jul 22, 2020
6548f25
Update the integration testing structure to have a new auth every tes…
sam-gc Jul 22, 2020
7ff84d5
Add integration tests for email flow (#3462)
sam-gc Jul 24, 2020
190721f
Add integration tests for phone, plus address some issues caught by t…
sam-gc Jul 24, 2020
0c48fb0
Refactor the way UserCredentials work in anticipation of mudularizati…
sam-gc Jul 28, 2020
3d0b727
First pass at service workers for auth-next (#3434)
avolkovi Jul 28, 2020
4435a4f
Fix broken integration tests (#3503)
sam-gc Jul 28, 2020
202def2
Add a standard OAuthCredential and a GoogleAuthProvider (#3498)
sam-gc Jul 29, 2020
27f3da7
Add the remaining oauth providers (#3500)
sam-gc Jul 29, 2020
f22f929
Handle some edge cases in responses from the server (#3509)
sam-gc Jul 29, 2020
e1722ef
First pass at polyfill (#3517)
avolkovi Aug 5, 2020
a70284a
Copy demo code over to auth-compat-layer, fix our build scripts (#3563)
avolkovi Aug 6, 2020
745bd50
Fix more edge cases around auth-compat-exp polyfill (auth-next) (#3567)
avolkovi Aug 6, 2020
767209d
Add platform specific persistence validation to auth-compat-exp (#3593)
avolkovi Aug 10, 2020
11b8a5a
Add an assertTypes utility (#3578)
sam-gc Aug 10, 2020
18d451e
Refactor project structure to support node (#3579)
avolkovi Aug 10, 2020
098adbf
Expose additionalUserInfo in auth-exp and auth-compat-exp (#3595)
avolkovi Aug 12, 2020
73323d2
Clean up our to/from JSON implementations (#3606)
avolkovi Aug 12, 2020
5523471
Register auth with the app component. Add the getAuth() methods for e…
sam-gc Aug 24, 2020
b9061c4
Add the internal auth interface including proactive refresh (#3655)
sam-gc Aug 24, 2020
900fdcb
Implement cross-window browser events for auth-next (#3631)
avolkovi Aug 25, 2020
090137c
Auth next build (#3654)
Feiyang1 Aug 27, 2020
747e1b8
yarn.lock
sam-gc Sep 1, 2020
f640521
Fix the broken build. (#3717)
sam-gc Sep 1, 2020
a38527b
Add hooks into auth-next for emulator config (#3716)
sam-gc Sep 1, 2020
455deb2
Add assertions for type of OAuthProvider in popup/redirect (#3720)
sam-gc Sep 1, 2020
1fd5434
Remove circular dependency issue with AuthCredential (#3718)
sam-gc Sep 1, 2020
2fac9ce
Add origin validation to popup/redirect flows (#3730)
sam-gc Sep 2, 2020
9b09edc
Put some guardrails around the recaptcha host language param (#3734)
sam-gc Sep 2, 2020
e8b5dbb
Prepare auth-next for merging to master (#3740)
Feiyang1 Sep 8, 2020
9498b4b
Finish off the emulator hooks (#3732)
sam-gc Sep 11, 2020
54f35fa
Add network timeout cancellation to the core network code (#3771)
sam-gc Sep 15, 2020
a7fc8bf
Fix failing auth compat tests (#3783)
sam-gc Sep 18, 2020
bce8eaa
Fix the phone integration test
sam-gc Sep 22, 2020
d761886
Clear the redirect user on signout (#3784)
sam-gc Sep 25, 2020
2be9c66
Add user invalidation handling (#3804)
sam-gc Sep 25, 2020
6c44e52
Add a cache layer to the event manager (#3808)
sam-gc Sep 25, 2020
b66a0ce
Handle null auth events from the iframe (#3818)
sam-gc Sep 25, 2020
c28e89b
Add web storage support check to popup actions (#3823)
sam-gc Sep 25, 2020
bea9aab
Update package.json
sam-gc Sep 29, 2020
3774885
Fix gapi linter issue
sam-gc Sep 30, 2020
2ac24f5
Update auth-next deps before merging to master (#3809)
Feiyang1 Sep 30, 2020
d0b6c12
Ignore phone integration test in catch-all yarn:test
sam-gc Oct 1, 2020
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
26 changes: 26 additions & 0 deletions packages-exp/auth-compat-exp/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
extends: '../../config/.eslintrc.js',
parserOptions: {
project: 'tsconfig.json',
// to make vscode-eslint work with monorepo
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
tsconfigRootDir: __dirname
}
};
5 changes: 5 additions & 0 deletions packages-exp/auth-compat-exp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @firebase/auth-compat-exp

This is a compatability layer to for the Firebase Authentication SDK

**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
Empty file.
29 changes: 29 additions & 0 deletions packages-exp/auth-compat-exp/demo/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
extends: '../../../config/.eslintrc.js',
parserOptions: {
project: 'tsconfig.json',
// to make vscode-eslint work with monorepo
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
tsconfigRootDir: __dirname
},
rules: {
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true }]
}
};
6 changes: 6 additions & 0 deletions packages-exp/auth-compat-exp/demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
src/config.js
.firebaserc
public/config.js
public/service-worker.*
public/web-worker.*
public/index.*
73 changes: 73 additions & 0 deletions packages-exp/auth-compat-exp/demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Firebase-Auth for web - Auth Demo (Auth Compatibility Layer)

## Prerequisite

You need to have created a Firebase Project in the
[Firebase Console](https://firebase.google.com/console/) as well as configured a web app.

## Installation
Make sure you run `yarn` to install all dependencies in the root directory.

Enable the Auth providers you would like to offer your users in the console, under
Auth > Sign-in methods.

Run:

```bash
git clone https://github.com/firebase/firebase-js-sdk.git
cd firebase-js-sdk/packages-exp/auth-compat-exp/demo
```

This will clone the repository in the current directory.

If you want to be able to deploy the demo app to one of your own Firebase Hosting instance,
configure it using the following command:

```bash
firebase use --add
```

Select the project you have created in the prerequisite, and type in `default` or
any other name as the alias to use for this project.

Copy `public/sample-config.js` to `public/config.js`:

```bash
cp public/sample-config.js public/config.js
```

Then copy and paste the Web snippet config found in the console (either by clicking "Add Firebase to
your web app" button in your Project overview, or clicking the "Web setup" button in the Auth page)
in the `config.js` file.

In the `functions` folder you'll need to install the admin SDK:

```bash
cd functions
yarn install
```

## Deploy

Before deploying, you may need to build the auth-exp package:
```bash
yarn build:deps
```

You'll also need to build a fully resolved firebase-app.js and firebase-auth.js from auth-compat-exp:

```bash
yarn build
```

This can take some time, and you only need to do it if you've modified the auth-exp or auth-compta-exp packages.

To run the app locally, simply issue the following command in the `auth-compat-exp/demo` directory:

```bash
yarn run demo
```

This will compile all the files needed to run Firebase Auth, and start a Firebase server locally at
[http://localhost:5000](http://localhost:5000).

13 changes: 13 additions & 0 deletions packages-exp/auth-compat-exp/demo/database.rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"rules": {
".read": "auth != null",
".write": "auth != null",
"users": {
"$user_id": {
".read": "$user_id === auth.uid",
".write": "$user_id === auth.uid"
}
}
}
}

14 changes: 14 additions & 0 deletions packages-exp/auth-compat-exp/demo/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "/checkIfAuthenticated",
"function": "checkIfAuthenticated"
}
]
}
}
45 changes: 45 additions & 0 deletions packages-exp/auth-compat-exp/demo/functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @fileoverview Defines the HTTP endpoints hosted via firebase functions which
* are used to test service worker functionality for Firebase Auth via demo
* app.
*/

const functions = require('firebase-functions');
const admin = require('firebase-admin');

admin.initializeApp(functions.config().firebase);

exports.checkIfAuthenticated = functions.https.onRequest((req, res) => {
const idToken = req.get('x-id-token');
res.setHeader('Content-Type', 'application/json');
if (idToken) {
admin
.auth()
.verifyIdToken(idToken)
.then(decodedIdToken => {
res.status(200).send(JSON.stringify({ uid: decodedIdToken.sub }));
})
.catch(error => {
res.status(400).send(JSON.stringify({ error: error.code }));
});
} else {
res.status(403).send(JSON.stringify({ error: 'Unauthorized access' }));
}
});
16 changes: 16 additions & 0 deletions packages-exp/auth-compat-exp/demo/functions/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase experimental:functions:shell",
"start": "yarn shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "8.11.0",
"firebase-functions": "3.6.1"
},
"private": true
}
Loading