Skip to content

Commit 7c413f6

Browse files
Arash Fatahzadehiranya911
Arash Fatahzade
authored andcommitted
Coding style and broken links (#288)
* Fix 2 blank line between function definitions * Fix broken links
1 parent 8f71485 commit 7c413f6

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ $ pip install -r requirements.txt # Install additional tools and dependencies
106106

107107
We use [pylint](https://pylint.org/) for verifying source code format, and
108108
enforcing other Python programming best practices.
109-
There is a pylint configuration file ([`.pylintrc`](../.pylintrc)) at the root of this Git
109+
There is a pylint configuration file ([`.pylintrc`](.pylintrc)) at the root of this Git
110110
repository. This enables you to invoke pylint directly from the command line:
111111

112112
```
113113
pylint firebase_admin
114114
```
115115

116-
However, it is recommended that you use the [`lint.sh`](../lint.sh) bash script to invoke
116+
However, it is recommended that you use the [`lint.sh`](lint.sh) bash script to invoke
117117
pylint. This script will run the linter on both `firebase_admin` and the corresponding
118118
`tests` module. It suprresses some of the noisy warnings that get generated
119119
when running pylint on test code. Note that by default `lint.sh` will only
@@ -226,7 +226,7 @@ pyenv install 3.3.0 # install Python 3.3.0
226226
pyenv install pypy2-5.6.0 # install pypy2
227227
```
228228

229-
Refer to the [`tox.ini`](../tox.ini) file for a list of target environments that we usually test.
229+
Refer to the [`tox.ini`](tox.ini) file for a list of target environments that we usually test.
230230
Use pyenv to install all the required Python versions on your workstation. Verify that they are
231231
installed by running the following command:
232232

firebase_admin/auth.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def create_custom_token(uid, developer_claims=None, app=None):
121121
except _token_gen.ApiCallError as error:
122122
raise AuthError(error.code, str(error), error.detail)
123123

124+
124125
def verify_id_token(id_token, app=None, check_revoked=False):
125126
"""Verifies the signature and data for the provided JWT.
126127
@@ -150,6 +151,7 @@ def verify_id_token(id_token, app=None, check_revoked=False):
150151
_check_jwt_revoked(verified_claims, _ID_TOKEN_REVOKED, 'ID token', app)
151152
return verified_claims
152153

154+
153155
def create_session_cookie(id_token, expires_in, app=None):
154156
"""Creates a new Firebase session cookie from the given ID token and options.
155157
@@ -174,6 +176,7 @@ def create_session_cookie(id_token, expires_in, app=None):
174176
except _token_gen.ApiCallError as error:
175177
raise AuthError(error.code, str(error), error.detail)
176178

179+
177180
def verify_session_cookie(session_cookie, check_revoked=False, app=None):
178181
"""Verifies a Firebase session cookie.
179182
@@ -199,6 +202,7 @@ def verify_session_cookie(session_cookie, check_revoked=False, app=None):
199202
_check_jwt_revoked(verified_claims, _SESSION_COOKIE_REVOKED, 'session cookie', app)
200203
return verified_claims
201204

205+
202206
def revoke_refresh_tokens(uid, app=None):
203207
"""Revokes all refresh tokens for an existing user.
204208
@@ -214,6 +218,7 @@ def revoke_refresh_tokens(uid, app=None):
214218
user_manager = _get_auth_service(app).user_manager
215219
user_manager.update_user(uid, valid_since=int(time.time()))
216220

221+
217222
def get_user(uid, app=None):
218223
"""Gets the user data corresponding to the specified user ID.
219224
@@ -236,6 +241,7 @@ def get_user(uid, app=None):
236241
except _user_mgt.ApiCallError as error:
237242
raise AuthError(error.code, str(error), error.detail)
238243

244+
239245
def get_user_by_email(email, app=None):
240246
"""Gets the user data corresponding to the specified user email.
241247
@@ -281,6 +287,7 @@ def get_user_by_phone_number(phone_number, app=None):
281287
except _user_mgt.ApiCallError as error:
282288
raise AuthError(error.code, str(error), error.detail)
283289

290+
284291
def list_users(page_token=None, max_results=_user_mgt.MAX_LIST_USERS_RESULTS, app=None):
285292
"""Retrieves a page of user accounts from a Firebase project.
286293
@@ -381,6 +388,7 @@ def update_user(uid, **kwargs):
381388
except _user_mgt.ApiCallError as error:
382389
raise AuthError(error.code, str(error), error.detail)
383390

391+
384392
def set_custom_user_claims(uid, custom_claims, app=None):
385393
"""Sets additional claims on an existing user account.
386394
@@ -407,6 +415,7 @@ def set_custom_user_claims(uid, custom_claims, app=None):
407415
except _user_mgt.ApiCallError as error:
408416
raise AuthError(error.code, str(error), error.detail)
409417

418+
410419
def delete_user(uid, app=None):
411420
"""Deletes the user identified by the specified user ID.
412421
@@ -424,6 +433,7 @@ def delete_user(uid, app=None):
424433
except _user_mgt.ApiCallError as error:
425434
raise AuthError(error.code, str(error), error.detail)
426435

436+
427437
def import_users(users, hash_alg=None, app=None):
428438
"""Imports the specified list of users into Firebase Auth.
429439
@@ -453,6 +463,7 @@ def import_users(users, hash_alg=None, app=None):
453463
except _user_mgt.ApiCallError as error:
454464
raise AuthError(error.code, str(error), error.detail)
455465

466+
456467
def generate_password_reset_link(email, action_code_settings=None, app=None):
457468
"""Generates the out-of-band email action link for password reset flows for the specified email
458469
address.
@@ -477,6 +488,7 @@ def generate_password_reset_link(email, action_code_settings=None, app=None):
477488
except _user_mgt.ApiCallError as error:
478489
raise AuthError(error.code, str(error), error.detail)
479490

491+
480492
def generate_email_verification_link(email, action_code_settings=None, app=None):
481493
"""Generates the out-of-band email action link for email verification flows for the specified
482494
email address.
@@ -501,6 +513,7 @@ def generate_email_verification_link(email, action_code_settings=None, app=None)
501513
except _user_mgt.ApiCallError as error:
502514
raise AuthError(error.code, str(error), error.detail)
503515

516+
504517
def generate_sign_in_with_email_link(email, action_code_settings, app=None):
505518
"""Generates the out-of-band email action link for email link sign-in flows, using the action
506519
code settings provided.
@@ -525,6 +538,7 @@ def generate_sign_in_with_email_link(email, action_code_settings, app=None):
525538
except _user_mgt.ApiCallError as error:
526539
raise AuthError(error.code, str(error), error.detail)
527540

541+
528542
def _check_jwt_revoked(verified_claims, error_code, label, app):
529543
user = get_user(verified_claims.get('uid'), app=app)
530544
if verified_claims.get('iat') * 1000 < user.tokens_valid_after_timestamp:

0 commit comments

Comments
 (0)