1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- """Firebase Phone Number Verification (FPNV) module.
15+ """Firebase Phone Number Verification module.
1616
1717This module contains functions for verifying JWTs related to the Firebase
18- Phone Number Verification (FPNV) service.
18+ Phone Number Verification service.
1919"""
2020from __future__ import annotations
2121from typing import Any , Dict , Optional
@@ -38,10 +38,10 @@ def _get_fpnv_service(app):
3838 return _utils .get_app_service (app , _FPNV_ATTRIBUTE , _FpnvService )
3939
4040def verify_token (token : str , app : Optional [App ] = None ) -> PhoneNumberVerificationToken :
41- """Verifies a Firebase Phone Number Verification (FPNV) token.
41+ """Verifies a Firebase Phone Number Verification token.
4242
4343 Args:
44- token: A string containing the FPNV JWT.
44+ token: A string containing the Firebase Phone Number Verification JWT.
4545 app: An App instance (optional).
4646
4747 Returns:
@@ -56,7 +56,7 @@ def verify_token(token: str, app: Optional[App] = None) -> PhoneNumberVerificati
5656
5757
5858class PhoneNumberVerificationToken (dict ):
59- """Represents a verified FPNV token.
59+ """Represents a verified Firebase Phone Number Verification token.
6060
6161 This class behaves like a dictionary, allowing access to the decoded claims.
6262 It also provides convenience properties for common claims.
@@ -112,8 +112,8 @@ def __init__(self, app):
112112 self ._project_id = app .project_id
113113 if not self ._project_id :
114114 raise ValueError (
115- 'Project ID is required for FPNV . Please ensure the app is '
116- 'initialized with a credential that contains a project ID.'
115+ 'Project ID is required for Firebase Phone Number Verification . Please ensure the '
116+ 'app is initialized with a credential that contains a project ID.'
117117 )
118118
119119 self ._verifier = _FpnvTokenVerifier (self ._project_id )
@@ -138,7 +138,7 @@ def verify_token(self, token) -> PhoneNumberVerificationToken:
138138
139139
140140class _FpnvTokenVerifier :
141- """Internal class for verifying FPNV JWTs signed with ES256."""
141+ """Internal class for verifying Firebase Phone Number Verification JWTs signed with ES256."""
142142 _jwks_client = None
143143 _project_id = None
144144
@@ -147,8 +147,8 @@ def __init__(self, project_id):
147147 self ._jwks_client = PyJWKClient (_FPNV_JWKS_URL , lifespan = 21600 )
148148
149149 def verify (self , token ) -> Dict [str , Any ]:
150- """Verifies the given FPNV token."""
151- _Validators .check_string ("FPNV check token" , token )
150+ """Verifies the given Firebase Phone Number Verification token."""
151+ _Validators .check_string ("Firebase Phone Number Verification check token" , token )
152152 try :
153153 self ._validate_headers (jwt .get_unverified_header (token ))
154154 signing_key = self ._jwks_client .get_signing_key_from_jwt (token )
@@ -236,7 +236,7 @@ def check_string(cls, label: str, value: Any):
236236 if not isinstance (value , str ) or not value :
237237 raise ValueError (f'{ label } must be a non-empty string.' )
238238
239- # Firebase Phone Number Verification (FPNV) Errors
239+ # Firebase Phone Number Verification Errors
240240class InvalidTokenError (exceptions .InvalidArgumentError ):
241241 """Raised when a Firebase Phone Number Verification token is invalid."""
242242
0 commit comments