From e38598c52d9f98dd34d81d1ac5f7257ebf8d02c8 Mon Sep 17 00:00:00 2001 From: Rich Gowman Date: Tue, 12 May 2020 18:04:33 -0400 Subject: [PATCH 1/5] Followup to #400 to ensure all new types are exported --- firebase_admin/auth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firebase_admin/auth.py b/firebase_admin/auth.py index 5d2fe0f68..583daeb55 100644 --- a/firebase_admin/auth.py +++ b/firebase_admin/auth.py @@ -34,6 +34,7 @@ __all__ = [ 'ActionCodeSettings', + 'BatchDeleteAccountsResponse', 'CertificateFetchError', 'Client', 'ConfigurationNotFoundError', @@ -43,6 +44,8 @@ 'ExpiredIdTokenError', 'ExpiredSessionCookieError', 'ExportedUserRecord', + 'DeleteUsersResult', + 'GetUsersResult', 'ImportUserRecord', 'InsufficientPermissionError', 'InvalidDynamicLinkDomainError', From adace66483f56737dd318f9985ce6acdbab32a95 Mon Sep 17 00:00:00 2001 From: Rich Gowman Date: Tue, 12 May 2020 18:30:23 -0400 Subject: [PATCH 2/5] Fix multi-line Returns: doc statements. See also https://github.com/sphinx-contrib/napoleon/issues/4 --- firebase_admin/_auth_client.py | 2 +- firebase_admin/_auth_providers.py | 2 +- firebase_admin/_user_mgt.py | 6 +++--- firebase_admin/auth.py | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/firebase_admin/_auth_client.py b/firebase_admin/_auth_client.py index 12d60592e..a8e6adc27 100644 --- a/firebase_admin/_auth_client.py +++ b/firebase_admin/_auth_client.py @@ -200,7 +200,7 @@ def get_users(self, identifiers): Returns: GetUsersResult: A ``GetUsersResult`` instance corresponding to the - specified identifiers. + specified identifiers. Raises: ValueError: If any of the identifiers are invalid or if more than 100 diff --git a/firebase_admin/_auth_providers.py b/firebase_admin/_auth_providers.py index 96f1b5348..46de6fe5f 100644 --- a/firebase_admin/_auth_providers.py +++ b/firebase_admin/_auth_providers.py @@ -121,7 +121,7 @@ def get_next_page(self): Returns: ListProviderConfigsPage: Next page of provider configs, or None if this is the last - page. + page. """ if self.has_next_page: return self.__class__(self._download, self.next_page_token, self._max_results) diff --git a/firebase_admin/_user_mgt.py b/firebase_admin/_user_mgt.py index 0307959f3..1d97dd504 100644 --- a/firebase_admin/_user_mgt.py +++ b/firebase_admin/_user_mgt.py @@ -78,7 +78,7 @@ def last_refresh_timestamp(self): Returns: integer: Milliseconds since epoch timestamp, or `None` if the user was - never active. + never active. """ return self._last_refresh_timestamp @@ -215,7 +215,7 @@ def tokens_valid_after_timestamp(self): Returns: int: Timestamp in milliseconds since the epoch, truncated to the second. - All tokens issued before that time are considered revoked. + All tokens issued before that time are considered revoked. """ valid_since = self._data.get('validSince') if valid_since is not None: @@ -752,7 +752,7 @@ def delete_users(self, uids, force_delete=False): Returns: BatchDeleteAccountsResponse: Server's proto response, wrapped in a - python object. + python object. Raises: ValueError: If any of the identifiers are invalid or if more than 1000 diff --git a/firebase_admin/auth.py b/firebase_admin/auth.py index 583daeb55..b43bfff1e 100644 --- a/firebase_admin/auth.py +++ b/firebase_admin/auth.py @@ -366,7 +366,7 @@ def get_users(identifiers, app=None): Returns: GetUsersResult: A ``GetUsersResult`` instance corresponding to the - specified identifiers. + specified identifiers. Raises: ValueError: If any of the identifiers are invalid or if more than 100 @@ -525,8 +525,7 @@ def delete_users(uids, app=None): Returns: DeleteUsersResult: The total number of successful/failed deletions, as - well as the array of errors that correspond to the failed - deletions. + well as the array of errors that correspond to the failed deletions. Raises: ValueError: If any of the identifiers are invalid or if more than 1000 From d9857f62bcdbe22fcf1e5da58e0a04c778af41ff Mon Sep 17 00:00:00 2001 From: Rich Gowman Date: Tue, 12 May 2020 18:39:29 -0400 Subject: [PATCH 3/5] Missed one --- firebase_admin/_auth_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firebase_admin/_auth_client.py b/firebase_admin/_auth_client.py index a8e6adc27..1c9b37082 100644 --- a/firebase_admin/_auth_client.py +++ b/firebase_admin/_auth_client.py @@ -374,8 +374,8 @@ def delete_users(self, uids): Returns: DeleteUsersResult: The total number of successful/failed deletions, as - well as the array of errors that correspond to the failed - deletions. + well as the array of errors that correspond to the failed + deletions. Raises: ValueError: If any of the identifiers are invalid or if more than 1000 From b1b521186bedb08cfb9ed0c8eb0c5685586eb686 Mon Sep 17 00:00:00 2001 From: Rich Gowman Date: Tue, 12 May 2020 18:54:08 -0400 Subject: [PATCH 4/5] drop BatchDeleteAccountsResponse from __all__ --- firebase_admin/auth.py | 1 - 1 file changed, 1 deletion(-) diff --git a/firebase_admin/auth.py b/firebase_admin/auth.py index b43bfff1e..9b4062c09 100644 --- a/firebase_admin/auth.py +++ b/firebase_admin/auth.py @@ -34,7 +34,6 @@ __all__ = [ 'ActionCodeSettings', - 'BatchDeleteAccountsResponse', 'CertificateFetchError', 'Client', 'ConfigurationNotFoundError', From fb3cc9eec7a31865afbe51398e30702851584071 Mon Sep 17 00:00:00 2001 From: Rich Gowman Date: Tue, 12 May 2020 19:23:46 -0400 Subject: [PATCH 5/5] Identifier -> UserIdentifier --- firebase_admin/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firebase_admin/auth.py b/firebase_admin/auth.py index 9b4062c09..c5361bc38 100644 --- a/firebase_admin/auth.py +++ b/firebase_admin/auth.py @@ -358,9 +358,9 @@ def get_users(identifiers, app=None): identifiers are supplied, this method raises a `ValueError`. Args: - identifiers (list[Identifier]): A list of ``Identifier`` instances used - to indicate which user records should be returned. Must have <= 100 - entries. + identifiers (list[UserIdentifier]): A list of ``UserIdentifier`` + instances used to indicate which user records should be returned. + Must have <= 100 entries. app: An App instance (optional). Returns: