Skip to content

feat(auth): Add tenant operations, tenant-aware user operations, and provider config operations #395

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 31 commits into from
Jul 16, 2020

Conversation

micahstairs
Copy link
Contributor

@micahstairs micahstairs commented Apr 22, 2020

This adds multi-tenancy support to the Firebase client, as well as support for SAML/OIDC provider config operations. See issue #332.

This moves parts of FirebaseAuth into an abstract class as part of adding multi-tenancy support.
This pull request adds the Tenant class (including it's create/update inner classes) as part of adding multi-tenancy support.
Add ListTenantsPage and some supporting code as part of adding multi-tenancy support. This code was very largely based off of ListUsersPage and ListUsersPageTest.
Added some things to the Tenant class and added a few unit tests. This is part of the initiative to adding multi-tenancy support (see issue #332).
)

Add the TenantManager class and wire through the listTenants operation. Also add unit tests to FirebaseUserManagerTest.
This adds deleteTenant to the TenantManager class. I've added the relevant unit tests to FirebaseUserManagerTest. This is part of the initiative to adding multi-tenancy support (see issue #332).
Added getTenant to the TenantManager class. Also added the relevant unit tests to FirebaseUserManagerTest. This is part of the initiative to adding multi-tenancy support (see issue #332).
Added createTenant and updateTenant to the TenantManager class. Also added the relevant unit tests to FirebaseUserManagerTest. This is part of the initiative to adding multi-tenancy support (see issue #332).
This adds some integration testing for all of the tenant operations in TenantManager. Several bugs were uncovered after running the tests, so these have been fixed. This is part of the initiative to adding multi-tenancy support (see issue #332).
This addresses some TODOs left as part of the initiative to add multi-tenancy support (see issue #332).
This makes user operations tenant-aware. I've added some integration tests to ensure that this is working correctly. This is part of the initiative to adding multi-tenancy support (see issue #332).
Remove unused AutoValue dependency (and remove Java 8 API dependency which was accidentally introduced).
This incorporates the tenant ID into the token generation and validation when using a tenant-aware client. This is part of the initiative to add multi-tenancy support (see issue #332).
@micahstairs micahstairs requested a review from hiranya911 April 22, 2020 22:55
@micahstairs micahstairs added the release:stage Stage a release candidate label Apr 22, 2020
@hiranya911
Copy link
Contributor

hiranya911 commented Apr 22, 2020

@egilmorez please review the reference docs in following classes:

  • AbstractFirebaseAuth
  • FirebaseAuth
  • TenantAwareFirebaseAuth
  • TenantManager
  • Tenant
  • ListTenantsPage

@egilmorez
Copy link
Contributor

Thanks Hiranya!

I'm going to try and pass this one to Kevin, who is the resident expert and owner of auth docs.

Kevin, please review:

AbstractFirebaseAuth
FirebaseAuth
TenantAwareFirebaseAuth
TenantManager
Tenant
ListTenantsPage

@micahstairs
Copy link
Contributor Author

Thanks for the review, Kevin! I've made all of the requested changes.

@hiranya911 hiranya911 removed the request for review from egilmorez May 5, 2020 23:02
@hiranya911
Copy link
Contributor

I've noticed some unit testing gaps in this PR. Following classes have less than ideal unit test coverage:

  1. TenantAwareFirebaseAuth - 0%
  2. FirebaseUserManager - 88%
  3. TenantManager - 68%

We should look to get close to 100% in these classes.

* Bump netty.version from 4.1.34.Final to 4.1.45.Final (#373)

Bumps `netty.version` from 4.1.34.Final to 4.1.45.Final.

Updates `netty-codec-http` from 4.1.34.Final to 4.1.45.Final
- [Release notes](https://github.com/netty/netty/releases)
- [Commits](netty/netty@netty-4.1.34.Final...netty-4.1.45.Final)

Updates `netty-handler` from 4.1.34.Final to 4.1.45.Final
- [Release notes](https://github.com/netty/netty/releases)
- [Commits](netty/netty@netty-4.1.34.Final...netty-4.1.45.Final)

Updates `netty-transport` from 4.1.34.Final to 4.1.45.Final
- [Release notes](https://github.com/netty/netty/releases)
- [Commits](netty/netty@netty-4.1.34.Final...netty-4.1.45.Final)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(auth): Add bulk get/delete methods (#365)

This PR allows callers to retrieve a list of users by unique identifier (uid, email, phone, federated provider uid) as well as to delete a list of users.

RELEASE NOTE: Added getUsers() and deleteUsers() APIs for retrieving and deleting user accounts in bulk.

* chore: Setting the version of the Maven Javadoc plugin (#412)

* [chore] Release 6.13.0 (#413)

* [chore] Release 6.13.0 take 2 (#414)

* Upgated the gpg keys

* Added temp verify script

* Disabled tty for gpg import

* Removing temp verification script

* Updated publish commands

* [chore] Release 6.13.0 take 3 (#415)

* [chore] Release 6.13.0 take 4 (#416)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rsgowman <rich@gowman.noip.me>
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to determine that you authored the commits in this PR. Maybe you used a different email address in the git commits than was used to sign the CLA? If someone else authored these commits, then please add them to this pull request and have them confirm that they're okay with them being contributed to Google. If there are co-authors, make sure they're formatted properly.

In order to pass this check, please resolve this problem and then comment@googlebot I fixed it... If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@hiranya911
Copy link
Contributor

@micahstairs are we expecting more changes on this branch? If not I can go ahead and merge it.

@micahstairs
Copy link
Contributor Author

@micahstairs are we expecting more changes on this branch? If not I can go ahead and merge it.

We just spoke and decided that I are going to finish the work on the idp-config branch and then merge that into this.

Adds all of the OIDC and SAML provider config operations, related to adding multi-tenancy support.
@micahstairs micahstairs changed the title Add tenant operations and user-aware tenant operations to Firebase client. Add tenant operations, tenant-aware user operations, and provider config operations to Firebase client. Jun 17, 2020
micahstairs and others added 4 commits June 17, 2020 13:53
* Multi-tenancy refactor experiment

* fix(auth): Completed tenant mgt refactor

* Added license header to new class

* Responding to code review comments: Consolidated error codes in AuthHttpClient
I've improved the unit test coverage of tenant/provider-related code, and I've also removed a number of unused imports.
Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Code reviewed in steps in other PRs

@hiranya911 hiranya911 added release-note and removed release:stage Stage a release candidate labels Jul 16, 2020
@hiranya911 hiranya911 changed the title Add tenant operations, tenant-aware user operations, and provider config operations to Firebase client. feat(auth): Add tenant operations, tenant-aware user operations, and provider config operations Jul 16, 2020
@hiranya911 hiranya911 merged commit 0a0662e into master Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants