| /external/python/google-auth-library-python/tests/oauth2/ |
| D | test_service_account.py | 53 return service_account.Credentials( 58 credentials = service_account.Credentials.from_service_account_info( 62 assert credentials._signer.key_id == SERVICE_ACCOUNT_INFO["private_key_id"] 63 assert credentials.service_account_email == SERVICE_ACCOUNT_INFO["client_email"] 64 assert credentials._token_uri == SERVICE_ACCOUNT_INFO["token_uri"] 72 credentials = service_account.Credentials.from_service_account_info( 76 assert credentials.service_account_email == info["client_email"] 77 assert credentials.project_id == info["project_id"] 78 assert credentials._signer.key_id == info["private_key_id"] 79 assert credentials._token_uri == info["token_uri"] [all …]
|
| D | test_credentials.py | 27 from google.oauth2 import credentials 47 return credentials.Credentials( 58 credentials = self.make_credentials() 59 assert not credentials.valid 61 assert not credentials.expired 62 # Scopes aren't required for these credentials 63 assert not credentials.requires_scopes 65 assert credentials.refresh_token == self.REFRESH_TOKEN 66 assert credentials.token_uri == self.TOKEN_URI 67 assert credentials.client_id == self.CLIENT_ID [all …]
|
| /external/python/google-auth-library-python/tests_async/oauth2/ |
| D | test_service_account_async.py | 34 return service_account.Credentials( 39 credentials = service_account.Credentials.from_service_account_info( 44 credentials._signer.key_id 48 credentials.service_account_email 52 credentials._token_uri 62 credentials = service_account.Credentials.from_service_account_info( 66 assert credentials.service_account_email == info["client_email"] 67 assert credentials.project_id == info["project_id"] 68 assert credentials._signer.key_id == info["private_key_id"] 69 assert credentials._token_uri == info["token_uri"] [all …]
|
| /external/python/google-auth-library-python/tests_async/ |
| D | test_jwt_async.py | 37 credentials = None variable in TestCredentials 41 self.credentials = jwt_async.Credentials( 52 credentials = jwt_async.Credentials.from_service_account_info( 56 assert credentials._signer.key_id == info["private_key_id"] 57 assert credentials._issuer == info["client_email"] 58 assert credentials._subject == info["client_email"] 59 assert credentials._audience == self.AUDIENCE 64 credentials = jwt_async.Credentials.from_service_account_info( 71 assert credentials._signer.key_id == info["private_key_id"] 72 assert credentials._issuer == info["client_email"] [all …]
|
| D | test_credentials_async.py | 19 from google.auth import _credentials_async as credentials unknown 23 class CredentialsImpl(credentials.Credentials): 32 credentials = CredentialsImpl() 33 assert not credentials.token 34 assert not credentials.expiry 35 assert not credentials.expired 36 assert not credentials.valid 40 credentials = CredentialsImpl() 41 credentials.token = "token" 43 assert credentials.valid [all …]
|
| D | test__default_async.py | 21 from google.auth import _credentials_async as credentials unknown 28 import google.oauth2.credentials 31 MOCK_CREDENTIALS = mock.Mock(spec=credentials.CredentialsWithQuotaProject) 69 credentials, project_id = _default.load_credentials_from_file( 72 assert isinstance(credentials, google.oauth2._credentials_async.Credentials) 78 # loadable credentials type 99 credentials, project_id = _default.load_credentials_from_file( 102 assert isinstance(credentials, google.oauth2._credentials_async.Credentials) 106 credentials, project_id = _default.load_credentials_from_file( 109 assert isinstance(credentials, google.oauth2._credentials_async.Credentials) [all …]
|
| /external/python/google-api-python-client/googleapiclient/ |
| D | _auth.py | 21 import google.auth.credentials 42 """Returns credentials loaded from a file.""" 44 …credentials, _ = google.auth.load_credentials_from_file(filename, scopes=scopes, quota_project_id=… 45 return credentials 52 """Returns Application Default Credentials.""" 54 credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id) 55 return credentials 70 def with_scopes(credentials, scopes): argument 71 """Scopes the credentials if necessary. 74 credentials (Union[ [all …]
|
| /external/python/google-auth-library-python/google/auth/ |
| D | _default.py | 15 """Application default credentials. 17 Implements application default credentials and project ID detection. 34 # Valid types accepted for file-based credentials. 40 # Help message when no credentials can be found. 42 Could not automatically determine credentials. Please set {env} or \ 43 explicitly create credentials and re-run the application. For more \ 47 env=environment_vars.CREDENTIALS 50 # Warning when using Cloud SDK user credentials 52 Your application has authenticated using end user credentials from Google \ 59 # The subject token type used for AWS external_account credentials. [all …]
|
| D | _oauth2client.py | 29 import google.oauth2.credentials 47 _CONVERT_ERROR_TMPL = "Unable to convert {} to a google-auth credentials class." 50 def _convert_oauth2_credentials(credentials): argument 51 """Converts to :class:`google.oauth2.credentials.Credentials`. 54 credentials (Union[oauth2client.client.OAuth2Credentials, 55 oauth2client.client.GoogleCredentials]): The credentials to 59 google.oauth2.credentials.Credentials: The converted credentials. 61 new_credentials = google.oauth2.credentials.Credentials( 62 token=credentials.access_token, 63 refresh_token=credentials.refresh_token, [all …]
|
| D | _credentials_async.py | 16 """Interfaces for credentials.""" 23 from google.auth import credentials 27 class Credentials(credentials.Credentials): class 28 """Async inherited credentials class from google.auth.credentials. 31 All credentials have a :attr:`token` that is used for authentication and 35 Most credentials will be :attr:`invalid` until :meth:`refresh` is called. 36 Credentials can do this automatically before the first HTTP request in 39 Although the token and expiration will change as the credentials are 40 :meth:`refreshed <refresh>` and used, credentials should be considered 41 immutable. Various credentials will accept configuration such as private [all …]
|
| D | credentials.py | 16 """Interfaces for credentials.""" 26 class Credentials(object): class 27 """Base class for all credentials. 29 All credentials have a :attr:`token` that is used for authentication and 33 Most credentials will be :attr:`invalid` until :meth:`refresh` is called. 34 Credentials can do this automatically before the first HTTP request in 37 Although the token and expiration will change as the credentials are 38 :meth:`refreshed <refresh>` and used, credentials should be considered 39 immutable. Various credentials will accept configuration such as private 41 construction. Some classes will provide mechanisms to copy the credentials [all …]
|
| D | _default_async.py | 15 """Application default credentials. 17 Implements application default credentials and project ID detection. 32 """Loads Google credentials from a file. 34 The credentials file must be a service account key or stored authorized 35 user credentials. 38 filename (str): The full path to the credentials file. 39 scopes (Optional[Sequence[str]]): The list of scopes for the credentials. If 40 specified, the credentials will automatically be scoped if 46 Tuple[google.auth.credentials.Credentials, Optional[str]]: Loaded 47 credentials and the project ID. Authorized user credentials do not [all …]
|
| /external/python/google-api-python-client/tests/ |
| D | test__auth.py | 18 import google.auth.credentials 37 default.return_value = (mock.sentinel.credentials, mock.sentinel.project) 39 credentials = _auth.default_credentials() 41 self.assertEqual(credentials, mock.sentinel.credentials) 47 default.return_value = (mock.sentinel.credentials, mock.sentinel.project) 49 credentials = _auth.credentials_from_file("credentials.json") 51 self.assertEqual(credentials, mock.sentinel.credentials) 53 "credentials.json", scopes=None, quota_project_id=None 58 default.return_value = (mock.sentinel.credentials, mock.sentinel.project) 59 credentials = _auth.default_credentials(scopes=["1", "2"]) [all …]
|
| /external/python/google-auth-library-python/tests/ |
| D | test_app_engine.py | 93 app_engine.Credentials() 98 credentials = app_engine.Credentials() 101 assert not credentials.valid 103 assert not credentials.expired 105 assert not credentials.scopes 106 assert not credentials.default_scopes 107 assert credentials.requires_scopes 108 assert not credentials.quota_project_id 111 credentials = app_engine.Credentials() 113 assert not credentials.scopes [all …]
|
| D | test__default.py | 25 from google.auth import credentials 31 import google.oauth2.credentials 63 SECURITY_CREDS_URL = "http://169.254.169.254/latest/meta-data/iam/security-credentials" 130 MOCK_CREDENTIALS = mock.Mock(spec=credentials.CredentialsWithQuotaProject) 147 external_account.Credentials, 182 credentials, project_id = _default.load_credentials_from_file(AUTHORIZED_USER_FILE) 183 assert isinstance(credentials, google.oauth2.credentials.Credentials) 189 # loadable credentials type 210 credentials, project_id = _default.load_credentials_from_file( 213 assert isinstance(credentials, google.oauth2.credentials.Credentials) [all …]
|
| D | test_credentials.py | 20 from google.auth import credentials 23 class CredentialsImpl(credentials.Credentials): 32 credentials = CredentialsImpl() 33 assert not credentials.token 34 assert not credentials.expiry 35 assert not credentials.expired 36 assert not credentials.valid 40 credentials = CredentialsImpl() 41 credentials.token = "token" 43 assert credentials.valid [all …]
|
| D | test_impersonated_credentials.py | 28 from google.auth.impersonated_credentials import Credentials 29 from google.oauth2 import credentials 103 SOURCE_CREDENTIALS = service_account.Credentials( 106 USER_SOURCE_CREDENTIALS = credentials.Credentials(token="ABCDE") 120 return Credentials( 130 credentials = self.make_credentials( 133 assert not credentials.valid 134 assert credentials.expired 137 credentials = self.make_credentials() 138 assert not credentials.valid [all …]
|
| D | test_jwt.py | 325 credentials = None variable in TestCredentials 329 self.credentials = jwt.Credentials( 340 credentials = jwt.Credentials.from_service_account_info( 344 assert credentials._signer.key_id == info["private_key_id"] 345 assert credentials._issuer == info["client_email"] 346 assert credentials._subject == info["client_email"] 347 assert credentials._audience == self.AUDIENCE 352 credentials = jwt.Credentials.from_service_account_info( 359 assert credentials._signer.key_id == info["private_key_id"] 360 assert credentials._issuer == info["client_email"] [all …]
|
| D | test_external_account.py | 69 class CredentialsImpl(external_account.Credentials): 279 credentials = self.make_credentials() 282 assert not credentials.token 283 assert not credentials.valid 285 assert not credentials.expiry 286 assert not credentials.expired 288 assert not credentials.scopes 289 assert credentials.requires_scopes 290 assert not credentials.quota_project_id 304 "pool credentials" [all …]
|
| D | test_identity_pool.py | 154 credentials, 168 """Utility to assert that a credentials are initialized with the expected 232 credentials.refresh(request) 253 assert credentials.token == impersonation_response["accessToken"] 255 assert credentials.token == token_response["access_token"] 256 assert credentials.quota_project_id == quota_project_id 257 assert credentials.scopes == scopes 258 assert credentials.default_scopes == default_scopes 274 return identity_pool.Credentials( 288 @mock.patch.object(identity_pool.Credentials, "__init__", return_value=None) [all …]
|
| /external/python/google-auth-library-python/tests/compute_engine/ |
| D | test_credentials.py | 25 from google.auth.compute_engine import credentials 48 credentials = None variable in TestCredentials 52 self.credentials = credentials.Credentials() 55 assert not self.credentials.valid 57 assert not self.credentials.expired 59 assert self.credentials.requires_scopes 61 assert self.credentials.service_account_email == "default" 63 assert not self.credentials._quota_project_id 84 # Refresh credentials 85 self.credentials.refresh(None) [all …]
|
| /external/python/google-auth-library-python/docs/ |
| D | user-guide.rst | 6 Credentials and account types 9 :class:`~credentials.Credentials` are the means of identifying an application or 10 user to a service or API. Credentials can be obtained with three different types 13 Credentials from service accounts identify a particular application. These types 14 of credentials are used in server-to-server use cases, such as accessing a 15 database. This library primarily focuses on service account credentials. 17 Credentials from user accounts are obtained by asking the user to authorize 18 access to their data. These types of credentials are used in cases where your 21 obtaining user credentials, but does provide limited support for using user 22 credentials. [all …]
|
| /external/python/oauth2client/oauth2client/contrib/ |
| D | multiprocess_file_storage.py | 17 This module provides file-based storage that supports multiple credentials and 29 from other processes will re-fetch the credentials from the file instead 38 credentials are refreshed again it will retry locking and writing as 45 credentials. A few common strategies include: 47 * If you're storing credentials for multiple users in a single file, use 49 * If you're storing credentials for multiple client IDs in a single file, 51 * If you're storing multiple credentials for one user, use the scopes as 59 filename = 'credentials' 63 To store the credentials:: 65 storage.put(credentials) [all …]
|
| /external/python/oauth2client/tests/contrib/ |
| D | test_gce.py | 41 credentials = gce.AppAssertionCredentials() 42 self.assertIsNone(credentials.assertion_type, None) 43 self.assertIsNone(credentials.service_account_email) 44 self.assertIsNone(credentials.scopes) 45 self.assertTrue(credentials.invalid) 51 credentials = gce.AppAssertionCredentials(scopes=scopes) 52 self.assertEqual(credentials.scopes, None) 53 self.assertEqual(credentials.assertion_type, None) 57 credentials = gce.AppAssertionCredentials() 59 credentials.to_json() [all …]
|
| /external/python/google-auth-library-python/google/oauth2/ |
| D | _service_account_async.py | 17 NOTE: This file adds asynchronous refresh methods to both credentials 19 method when using service account credentials with asynchronous functionality. 21 credentials file google.oauth2.service_account 31 class Credentials( class 32 service_account.Credentials, credentials_async.Scoped, credentials_async.Credentials 34 """Service account credentials 36 Usually, you'll create these credentials with one of the helper 37 constructors. To create credentials using a Google service account 40 credentials = _service_account_async.Credentials.from_service_account_file( 46 credentials = _service_account_async.Credentials.from_service_account_info( [all …]
|