- Notifications
You must be signed in to change notification settings - Fork 298
Refactoring the User Management API #37
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
Changes from 6 commits
bd74c51 4882923 2b113dc a79112e 47db434 f4ef0ff 6cc5086 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -17,13 +17,12 @@ | |
| package com.google.firebase.auth; | ||
| | ||
| import com.google.firebase.auth.internal.GetAccountInfoResponse; | ||
| import com.google.firebase.internal.Nullable; | ||
| | ||
| /** | ||
| * Contains metadata regarding how a user is known by a particular identity provider (IdP). | ||
| * Instances of this class are immutable and thread safe. | ||
| */ | ||
| public class ProviderUserInfo { | ||
| class ProviderUserInfo implements UserInfo { | ||
| | ||
| private final String uid; | ||
| private final String displayName; | ||
| | @@ -39,51 +38,22 @@ public class ProviderUserInfo { | |
| this.providerId = response.getProviderId(); | ||
| } | ||
| | ||
| /** | ||
| * Returns the user's unique ID assigned by the identity provider. | ||
| * | ||
| * @return a user ID string. | ||
| */ | ||
| public String getUid() { | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be annotated with @ Override? Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done | ||
| return uid; | ||
| } | ||
| | ||
| /** | ||
| * Returns the user's display name. | ||
| * | ||
| * @return a display name string or null. | ||
| */ | ||
| @Nullable | ||
| public String getDisplayName() { | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, but I think we still want @ Nullable annotation? Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done | ||
| return displayName; | ||
| } | ||
| | ||
| /** | ||
| * Returns the user's email address. | ||
| * | ||
| * @return an email address string or null. | ||
| */ | ||
| @Nullable | ||
| public String getEmail() { | ||
| return email; | ||
| } | ||
| | ||
| /** | ||
| * Returns the user's photo URL. | ||
| * | ||
| * @return a URL string or null. | ||
| */ | ||
| @Nullable | ||
| public String getPhotoUrl() { | ||
| return photoUrl; | ||
| } | ||
| | ||
| /** | ||
| * Returns the ID of the identity provider. This can be a short domain name (e.g. google.com) or | ||
| * the identifier of an OpenID identity provider. | ||
| * | ||
| * @return an ID string that uniquely identifies the identity provider. | ||
| */ | ||
| public String getProviderId() { | ||
| return providerId; | ||
| } | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /* | ||
| * Copyright 2017 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.internal.Nullable; | ||
| | ||
| /** | ||
| * A collection of standard profile information for a user. Used to expose profile information | ||
| * returned by an identity provider. | ||
| */ | ||
| public interface UserInfo { | ||
| | ||
| /** | ||
| * Returns the user's unique ID assigned by the identity provider. | ||
| * | ||
| * @return a user ID string. | ||
| */ | ||
| String getUid(); | ||
| | ||
| /** | ||
| * Returns the user's display name, if available. | ||
| * | ||
| * @return a display name string or null. | ||
| */ | ||
| @Nullable | ||
| String getDisplayName(); | ||
| | ||
| /** | ||
| * Returns the user's email address, if available. | ||
| * | ||
| * @return an email address string or null. | ||
| */ | ||
| @Nullable | ||
| String getEmail(); | ||
| | ||
| /** | ||
| * Returns the user's photo URL, if available. | ||
| * | ||
| * @return a URL string or null. | ||
| */ | ||
| @Nullable | ||
| String getPhotoUrl(); | ||
| | ||
| /** | ||
| * Returns the ID of the identity provider. This can be a short domain name (e.g. google.com) or | ||
| * the identifier of an OpenID identity provider. | ||
| * | ||
| * @return an ID string that uniquely identifies the identity provider. | ||
| */ | ||
| String getProviderId(); | ||
| | ||
| } |
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.
user => request ?
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.
Done