8000 Updated API reference docs · CyberSys/firebase-admin-python@2e1d9ad · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e1d9ad

Browse files
committed
Updated API reference docs
1 parent c47cf73 commit 2e1d9ad

File tree

4 files changed

+63
-63
lines changed

4 files changed

+63
-63
lines changed

firebase_admin/_auth_client.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Client:
3030

3131
def __init__(self, app, tenant_id=None):
3232
if not app.project_id:
33-
raise ValueError("""Project ID is required to access the auth service.
33+
raise ValueError("""A project ID is required to access the auth service.
3434
1. Use a service account credential, or
3535
2. set the project ID explicitly via Firebase App options, or
3636
3. set the project ID via the GOOGLE_CLOUD_PROJECT environment variable.""")
@@ -73,7 +73,7 @@ def create_custom_token(self, uid, developer_claims=None):
7373
def verify_id_token(self, id_token, check_revoked=False):
7474
"""Verifies the signature and data for the provided JWT.
7575
76-
Accepts a signed token string, verifies that it is current, and issued
76+
Accepts a signed token string, verifies that it is current, was issued
7777
to this project, and that it was correctly signed by Google.
7878
7979
Args:
@@ -113,7 +113,7 @@ def verify_id_token(self, id_token, check_revoked=False):
113113
def revoke_refresh_tokens(self, uid):
114114
"""Revokes all refresh tokens for an existing user.
115115
116-
revoke_refresh_tokens updates the user's tokens_valid_after_timestamp to the current UTC
116+
This method updates the user's ``tokens_valid_after_timestamp`` to the current UTC
117117
in seconds since the epoch. It is important that the server on which this is called has its
118118
clock set correctly and synchronized.
119119
@@ -138,7 +138,7 @@ def get_user(self, uid):
138138
uid: A user ID string.
139139
140140
Returns:
141-
UserRecord: A UserRecord instance.
141+
UserRecord: A user record instance.
142142
143143
Raises:
144144
ValueError: If the user ID is None, empty or malformed.
@@ -155,7 +155,7 @@ def get_user_by_email(self, email):
155155
email: A user email address string.
156156
157157
Returns:
158-
UserRecord: A UserRecord instance.
158+
UserRecord: A user record instance.
159159
160160
Raises:
161161
ValueError: If the email is None, empty or malformed.
@@ -172,10 +172,10 @@ def get_user_by_phone_number(self, phone_number):
172172
phone_number: A phone number string.
173173
174174
Returns:
175-
UserRecord: A UserRecord instance.
175+
UserRecord: A user record instance.
176176
177177
Raises:
178-
ValueError: If the phone number is None, empty or malformed.
178+
ValueError: If the phone number is ``None``, empty or malformed.
179179
UserNotFoundError: If no user exists by the specified phone number.
180180
FirebaseError: If an error occurs while retrieving the user.
181181
"""
@@ -187,7 +187,7 @@ def list_users(self, page_token=None, max_results=_user_mgt.MAX_LIST_USERS_RESUL
187187
188188
The ``page_token`` argument governs the starting point of the page. The ``max_results``
189189
argument governs the maximum number of user accounts that may be included in the returned
190-
page. This function never returns None. If there are no user accounts in the Firebase
190+
page. This function never returns ``None``. If there are no user accounts in the Firebase
191191
project, this returns an empty page.
192192
193193
Args:
@@ -198,7 +198,7 @@ def list_users(self, page_token=None, max_results=_user_mgt.MAX_LIST_USERS_RESUL
198198
allowed.
199199
200200
Returns:
201-
ListUsersPage: A ListUsersPage instance.
201+
ListUsersPage: A page of user accounts.
202202
203203
Raises:
204204
ValueError: If max_results or page_token are invalid.
@@ -310,7 +310,7 @@ def import_users(self, users, hash_alg=None):
310310
"""Imports the specified list of users into Firebase Auth.
311311
312312
At most 1000 users can be imported at a time. This operation is optimized for bulk imports
313-
and will ignore checks on identifier uniqueness which could result in duplications. The
313+
and ignores checks on identifier uniqueness, which could result in duplications. The
314314
``hash_alg`` parameter must be specified when importing users with passwords. Refer to the
315315
``UserImportHash`` class for supported hash algorithms.
316316
@@ -391,13 +391,13 @@ def generate_sign_in_with_email_link(self, email, action_code_settings):
391391
'EMAIL_SIGNIN', email, action_code_settings=action_code_settings)
392392

393393
def get_oidc_provider_config(self, provider_id):
394-
"""Returns the OIDCProviderConfig with the given ID.
394+
"""Returns the ``OIDCProviderConfig`` with the given ID.
395395
396396
Args:
397397
provider_id: Provider ID string.
398398
399399
Returns:
400-
SAMLProviderConfig: An OIDCProviderConfig instance.
400+
SAMLProviderConfig: An OIDC provider config instance.
401401
402402
Raises:
403403
ValueError: If the provider ID is invalid, empty or does not have ``oidc.`` prefix.
@@ -423,7 +423,7 @@ def create_oidc_provider_config(
423423
(optional). A user cannot sign in using a disabled provider.
424424
425425
Returns:
426-
OIDCProviderConfig: The newly created OIDCProviderConfig instance.
426+
OIDCProviderConfig: The newly created OIDC provider config instance.
427427
428428
Raises:
429429
ValueError: If any of the specified input parameters are invalid.
@@ -447,7 +447,7 @@ def update_oidc_provider_config(
447447
(optional).
448448
449449
Returns:
450-
OIDCProviderConfig: The updated OIDCProviderConfig instance.
450+
OIDCProviderConfig: The updated OIDC provider config instance.
451451
452452
Raises:
453453
ValueError: If any of the specified input parameters are invalid.
@@ -458,7 +458,7 @@ def update_oidc_provider_config(
458458
enabled=enabled)
459459

460460
def delete_oidc_provider_config(self, provider_id):
461-
"""Deletes the OIDCProviderConfig with the given ID.
461+
"""Deletes the ``OIDCProviderConfig`` with the given ID.
462462
463463
Args:
464464
provider_id: Provider ID string.
@@ -476,7 +476,7 @@ def list_oidc_provider_configs(
476476
477477
The ``page_token`` argument governs the starting point of the page. The ``max_results``
478478
argument governs the maximum number of configs that may be included in the returned
479-
page. This function never returns None. If there are no OIDC configs in the Firebase
479+
page. This function never returns ``None``. If there are no OIDC configs in the Firebase
480480
project, this returns an empty page.
481481
482482
Args:
@@ -487,22 +487,22 @@ def list_oidc_provider_configs(
487487
allowed.
488488
489489
Returns:
490-
ListProviderConfigsPage: A ListProviderConfigsPage instance.
490+
ListProviderConfigsPage: A page of OIDC provider config instances.
491491
492492
Raises:
493-
ValueError: If max_results or page_token are invalid.
493+
ValueError: If ``max_results`` or ``page_token`` are invalid.
494494
FirebaseError: If an error occurs while retrieving the OIDC provider configs.
495495
"""
496496
return self._provider_manager.list_oidc_provider_configs(page_token, max_results)
497497

498498
def get_saml_provider_config(self, provider_id):
499-
"""Returns the SAMLProviderConfig with the given ID.
499+
"""Returns the ``SAMLProviderConfig`` with the given ID.
500500
501501
Args:
502502
provider_id: Provider ID string.
503503
504504
Returns:
505-
SAMLProviderConfig: A SAMLProviderConfig instance.
505+
SAMLProviderConfig: A SAML provider config instance.
506506
507507
Raises:
508508
ValueError: If the provider ID is invalid, empty or does not have ``saml.`` prefix.
@@ -540,7 +540,7 @@ def create_saml_provider_config(
540540
(optional). A user cannot sign in using a disabled provider.
541541
542542
Returns:
543-
SAMLProviderConfig: The newly created SAMLProviderConfig instance.
543+
SAMLProviderConfig: The newly created SAML provider config instance.
544544
545545
Raises:
546546
ValueError: If any of the specified input parameters are invalid.
@@ -564,13 +564,13 @@ def update_saml_provider_config(
564564
provider (optional).
565565
rp_entity_id: The SAML relying party entity ID (optional).
566566
callback_url: Callback URL string (optional).
567-
display_name: The user-friendly display name to the current configuration (optional).
567+
display_name: The user-friendly display name of the current configuration (optional).
568568
Pass ``auth.DELETE_ATTRIBUTE`` to delete the current display name.
569569
enabled: A boolean indicating whether the provider configuration is enabled or disabled
570570
(optional).
571571
572572
Returns:
573-
SAMLProviderConfig: The updated SAMLProviderConfig instance.
573+
SAMLProviderConfig: The updated SAML provider config instance.
574574
575575
Raises:
576576
ValueError: If any of the specified input parameters are invalid.
@@ -582,7 +582,7 @@ def update_saml_provider_config(
582582
callback_url=callback_url, display_name=display_name, enabled=enabled)
583583

584584
def delete_saml_provider_config(self, provider_id):
585-
"""Deletes the SAMLProviderConfig with the given ID.
585+
"""Deletes the ``SAMLProviderConfig`` with the given ID.
586586
587587
Args:
588588
provider_id: Provider ID string.
@@ -600,7 +600,7 @@ def list_saml_provider_configs(
600600
601601
The ``page_token`` argument governs the starting point of the page. The ``max_results``
602602
argument governs the maximum number of configs that may be included in the returned
603-
page. This function never returns None. If there are no SAML configs in the Firebase
603+
page. This function never returns ``None``. If there are no SAML configs in the Firebase
604604
project, this returns an empty page.
605605
606606
Args:
@@ -611,10 +611,10 @@ def list_saml_provider_configs(
611611
allowed.
612612
613613
Returns:
614-
ListProviderConfigsPage: A ListProviderConfigsPage instance.
614+
ListProviderConfigsPage: A page of SAML provider config instances.
615615
616616
Raises:
617-
ValueError: If max_results or page_token are invalid.
617+
ValueError: If ``max_results`` or ``page_token`` are invalid.
618618
FirebaseError: If an error occurs while retrieving the SAML provider configs.
619619
"""
620620
return self._provider_manager.list_saml_provider_configs(page_token, max_results)

firebase_admin/_auth_providers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def _validate_non_empty_string(value, label):
368368

369369

370370
def _validate_url(url, label):
371-
"""Validates that the given value is a wellformed URL string."""
371+
"""Validates that the given value is a well-formed URL string."""
372372
if not isinstance(url, str) or not url:
373373
raise ValueError(
374374
'Invalid photo URL: "{0}". {1} must be a non-empty '

0 commit comments

Comments
 (0)
0