5
5
# --------------------------------------------------------------------------------------
6
6
7
7
8
- from oauth2client . service_account import ServiceAccountCredentials
8
+ from google . oauth2 . service_account import Credentials
9
9
10
10
11
11
def _service_account_creds_from_secret (service_account_secret ):
@@ -18,19 +18,20 @@ def _service_account_creds_from_secret(service_account_secret):
18
18
:param service_account_secret: Service Account Secret Key from Firebase Console.
19
19
:type service_account_secret: dict | str
20
20
:return: Service Account Credentials
21
- :rtype: ServiceAccountCredentials
21
+ :rtype: :class:`~google.oauth2.service_account.Credentials`
22
22
"""
23
23
24
24
credentials = None
25
25
scopes = [
26
26
'https://www.googleapis.com/auth/firebase.database' ,
27
+ "https://www.googleapis.com/auth/datastore" ,
27
28
'https://www.googleapis.com/auth/userinfo.email' ,
28
29
"https://www.googleapis.com/auth/cloud-platform"
29
30
]
30
31
31
32
if type (service_account_secret ) is str :
32
- credentials = ServiceAccountCredentials . from_json_keyfile_name (service_account_secret , scopes )
33
+ credentials = Credentials . from_service_account_file (service_account_secret , scopes = scopes )
33
34
if type (service_account_secret ) is dict :
34
- credentials = ServiceAccountCredentials . from_json_keyfile_dict (service_account_secret , scopes )
35
+ credentials = Credentials . from_service_account_info (service_account_secret , scopes = scopes )
35
36
36
37
return credentials
0 commit comments