Skip to content

Commit 3689708

Browse files
pragatimodiDoris-Ge
authored andcommitted
chore(auth): Update Auth API to v2 (#691)
* `v2beta1` -> `v2` * Reverting auto formatting changes * undo auto formatting
1 parent ca3f366 commit 3689708

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

firebase_admin/_auth_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self, app, tenant_id=None):
5050
if emulator_host:
5151
base_url = 'http://{0}/identitytoolkit.googleapis.com'.format(emulator_host)
5252
endpoint_urls['v1'] = base_url + '/v1'
53-
endpoint_urls['v2beta1'] = base_url + '/v2beta1'
53+
endpoint_urls['v2'] = base_url + '/v2'
5454
credential = _utils.EmulatorAdminCredentials()
5555
self.emulated = True
5656
else:
@@ -67,7 +67,7 @@ def __init__(self, app, tenant_id=None):
6767
self._user_manager = _user_mgt.UserManager(
6868
http_client, app.project_id, tenant_id, url_override=endpoint_urls.get('v1'))
6969
self._provider_manager = _auth_providers.ProviderConfigClient(
70-
http_client, app.project_id, tenant_id, url_override=endpoint_urls.get('v2beta1'))
70+
http_client, app.project_id, tenant_id, url_override=endpoint_urls.get('v2'))
7171

7272
@property
7373
def tenant_id(self):

firebase_admin/_auth_providers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def items(self):
176176
class ProviderConfigClient:
177177
"""Client for managing Auth provider configurations."""
178178

179-
PROVIDER_CONFIG_URL = 'https://identitytoolkit.googleapis.com/v2beta1'
179+
PROVIDER_CONFIG_URL = 'https://identitytoolkit.googleapis.com/v2'
180180

181181
def __init__(self, http_client, project_id, tenant_id=None, url_override=None):
182182
self.http_client = http_client

firebase_admin/tenant_mgt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def enable_email_link_sign_in(self):
232232
class _TenantManagementService:
233233
"""Firebase tenant management service."""
234234

235-
TENANT_MGT_URL = 'https://identitytoolkit.googleapis.com/v2beta1'
235+
TENANT_MGT_URL = 'https://identitytoolkit.googleapis.com/v2'
236236

237237
def __init__(self, app):
238238
credential = app.credential.get_credential()

tests/test_auth_providers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
from firebase_admin import exceptions
2424
from tests import testutils
2525

26-
ID_TOOLKIT_URL = 'https://identitytoolkit.googleapis.com/v2beta1'
26+
ID_TOOLKIT_URL = 'https://identitytoolkit.googleapis.com/v2'
2727
EMULATOR_HOST_ENV_VAR = 'FIREBASE_AUTH_EMULATOR_HOST'
2828
AUTH_EMULATOR_HOST = 'localhost:9099'
29-
EMULATED_ID_TOOLKIT_URL = 'http://{}/identitytoolkit.googleapis.com/v2beta1'.format(
29+
EMULATED_ID_TOOLKIT_URL = 'http://{}/identitytoolkit.googleapis.com/v2'.format(
3030
AUTH_EMULATOR_HOST)
3131
URL_PROJECT_SUFFIX = '/projects/mock-project-id'
3232
USER_MGT_URLS = {

tests/test_tenant_mgt.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@
108108
INVALID_BOOLEANS = ['', 1, 0, list(), tuple(), dict()]
109109

110110
USER_MGT_URL_PREFIX = 'https://identitytoolkit.googleapis.com/v1/projects/mock-project-id'
111-
PROVIDER_MGT_URL_PREFIX = 'https://identitytoolkit.googleapis.com/v2beta1/projects/mock-project-id'
112-
TENANT_MGT_URL_PREFIX = 'https://identitytoolkit.googleapis.com/v2beta1/projects/mock-project-id'
111+
PROVIDER_MGT_URL_PREFIX = 'https://identitytoolkit.googleapis.com/v2/projects/mock-project-id'
112+
TENANT_MGT_URL_PREFIX = 'https://identitytoolkit.googleapis.com/v2/projects/mock-project-id'
113113

114114

115115
@pytest.fixture(scope='module')

0 commit comments

Comments
 (0)