-
Notifications
You must be signed in to change notification settings - Fork 289
chore: Merging master into tenant-mgt #422
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ab3af3c
Bump netty.version from 4.1.34.Final to 4.1.45.Final (#373)
dependabot[bot] f8052c7
feat(auth): Add bulk get/delete methods (#365)
rsgowman 30801e3
chore: Setting the version of the Maven Javadoc plugin (#412)
hiranya911 a4a5315
[chore] Release 6.13.0 (#413)
hiranya911 200d1f9
[chore] Release 6.13.0 take 2 (#414)
hiranya911 68c05d7
[chore] Release 6.13.0 take 3 (#415)
hiranya911 8c9608d
[chore] Release 6.13.0 take 4 (#416)
hiranya911 1e0518e
Merged with master
hiranya911 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/java/com/google/firebase/auth/DeleteUsersResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright 2020 Google Inc. | ||
* | ||
* 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. | ||
*/ | ||
|
||
package com.google.firebase.auth; | ||
|
||
import static com.google.common.base.Preconditions.checkArgument; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.google.firebase.auth.internal.BatchDeleteResponse; | ||
import com.google.firebase.internal.NonNull; | ||
import java.util.List; | ||
|
||
/** | ||
* Represents the result of the {@link FirebaseAuth#deleteUsersAsync(List)} API. | ||
*/ | ||
public final class DeleteUsersResult { | ||
|
||
private final int successCount; | ||
private final List<ErrorInfo> errors; | ||
|
||
DeleteUsersResult(int users, BatchDeleteResponse response) { | ||
ImmutableList.Builder<ErrorInfo> errorsBuilder = ImmutableList.builder(); | ||
List<BatchDeleteResponse.ErrorInfo> responseErrors = response.getErrors(); | ||
if (responseErrors != null) { | ||
checkArgument(users >= responseErrors.size()); | ||
for (BatchDeleteResponse.ErrorInfo error : responseErrors) { | ||
errorsBuilder.add(new ErrorInfo(error.getIndex(), error.getMessage())); | ||
} | ||
} | ||
errors = errorsBuilder.build(); | ||
successCount = users - errors.size(); | ||
} | ||
|
||
/** | ||
* Returns the number of users that were deleted successfully (possibly zero). Users that did not | ||
* exist prior to calling {@link FirebaseAuth#deleteUsersAsync(List)} are considered to be | ||
* successfully deleted. | ||
*/ | ||
public int getSuccessCount() { | ||
return successCount; | ||
} | ||
|
||
/** | ||
* Returns the number of users that failed to be deleted (possibly zero). | ||
*/ | ||
public int getFailureCount() { | ||
return errors.size(); | ||
} | ||
|
||
/** | ||
* A list of {@link ErrorInfo} instances describing the errors that were encountered during | ||
* the deletion. Length of this list is equal to the return value of | ||
* {@link #getFailureCount()}. | ||
* | ||
* @return A non-null list (possibly empty). | ||
*/ | ||
@NonNull | ||
public List<ErrorInfo> getErrors() { | ||
return errors; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/com/google/firebase/auth/EmailIdentifier.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2020 Google Inc. | ||
* | ||
* 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. | ||
*/ | ||
|
||
package com.google.firebase.auth; | ||
|
||
import com.google.firebase.auth.internal.GetAccountInfoRequest; | ||
import com.google.firebase.internal.NonNull; | ||
|
||
/** | ||
* Used for looking up an account by email. | ||
* | ||
* @see {FirebaseAuth#getUsers} | ||
*/ | ||
public final class EmailIdentifier extends UserIdentifier { | ||
private final String email; | ||
|
||
public EmailIdentifier(@NonNull String email) { | ||
UserRecord.checkEmail(email); | ||
this.email = email; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "EmailIdentifier(" + email + ")"; | ||
} | ||
|
||
@Override | ||
void populate(@NonNull GetAccountInfoRequest payload) { | ||
payload.addEmail(email); | ||
} | ||
|
||
@Override | ||
boolean matches(@NonNull UserRecord userRecord) { | ||
return email.equals(userRecord.getEmail()); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make
TenantAwareFirebaseAuth
final for consistency?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should. Lets do that in a separate PR to keep this merge commit clean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! I'll slip that into
tenant-mgt
in a separate commit.