scopes (Optional]): The list of scopes for the credentials. Args: filename (str): The full path to the credentials file. The credentials file must be a service account key, stored authorized user credentials, external account credentials, or impersonated service account credentials. def load_credentials_from_file ( filename, scopes = None, default_scopes = None, quota_project_id = None, request = None ): """Loads Google credentials from a file. """ from th import _cloud_sdk if credentials. Credentials from the Cloud SDK that are associated with Cloud SDK's project are problematic because they may not have APIs enabled and have limited quota. _AWS_SUBJECT_TOKEN_TYPE = "urn:ietf:params:aws:token-type:aws4_request" def _warn_about_problematic_credentials ( credentials ): """Determines if the credentials are problematic. \ """ # The subject token type used for AWS external_account credentials. See the following page for troubleshooting: \. You might receive a "quota exceeded" \ or "API not enabled" error. \ """ # Warning when using Cloud SDK user credentials _CLOUD_SDK_CREDENTIALS_WARNING = """ \ Your application has authenticated using end user credentials from Google \ Cloud SDK without a quota project. ![]() To set up Application Default Credentials, \ see for more information. _CLOUD_SDK_MISSING_CREDENTIALS = """ \ Your default credentials were not found. _AUTHORIZED_USER_TYPE = "authorized_user" _SERVICE_ACCOUNT_TYPE = "service_account" _EXTERNAL_ACCOUNT_TYPE = "external_account" _EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = "external_account_authorized_user" _IMPERSONATED_SERVICE_ACCOUNT_TYPE = "impersonated_service_account" _GDCH_SERVICE_ACCOUNT_TYPE = "gdch_service_account" _VALID_TYPES = ( _AUTHORIZED_USER_TYPE, _SERVICE_ACCOUNT_TYPE, _EXTERNAL_ACCOUNT_TYPE, _EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE, _IMPERSONATED_SERVICE_ACCOUNT_TYPE, _GDCH_SERVICE_ACCOUNT_TYPE, ) # Help message when no credentials can be found. getLogger ( _name_ ) # Valid types accepted for file-based credentials. ![]() """ import io import json import logging import os import warnings import six from th import environment_vars from th import exceptions import ._http_client _LOGGER = logging. Implements application default credentials and project ID detection. # See the License for the specific language governing permissions and # limitations under the License. ![]() # You may obtain a copy of the License at # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License.
0 Comments
Leave a Reply. |