environment_vars.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 2016 Google LLC
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. """Environment variables used by :mod:`google.auth`."""
  15. PROJECT = "GOOGLE_CLOUD_PROJECT"
  16. """Environment variable defining default project.
  17. This used by :func:`google.auth.default` to explicitly set a project ID. This
  18. environment variable is also used by the Google Cloud Python Library.
  19. """
  20. LEGACY_PROJECT = "GCLOUD_PROJECT"
  21. """Previously used environment variable defining the default project.
  22. This environment variable is used instead of the current one in some
  23. situations (such as Google App Engine).
  24. """
  25. GOOGLE_CLOUD_QUOTA_PROJECT = "GOOGLE_CLOUD_QUOTA_PROJECT"
  26. """Environment variable defining the project to be used for
  27. quota and billing."""
  28. CREDENTIALS = "GOOGLE_APPLICATION_CREDENTIALS"
  29. """Environment variable defining the location of Google application default
  30. credentials."""
  31. # The environment variable name which can replace ~/.config if set.
  32. CLOUD_SDK_CONFIG_DIR = "CLOUDSDK_CONFIG"
  33. """Environment variable defines the location of Google Cloud SDK's config
  34. files."""
  35. # These two variables allow for customization of the addresses used when
  36. # contacting the GCE metadata service.
  37. GCE_METADATA_HOST = "GCE_METADATA_HOST"
  38. """Environment variable providing an alternate hostname or host:port to be
  39. used for GCE metadata requests.
  40. This environment variable was originally named GCE_METADATA_ROOT. The system will
  41. check this environemnt variable first; should there be no value present,
  42. the system will fall back to the old variable.
  43. """
  44. GCE_METADATA_ROOT = "GCE_METADATA_ROOT"
  45. """Old environment variable for GCE_METADATA_HOST."""
  46. GCE_METADATA_IP = "GCE_METADATA_IP"
  47. """Environment variable providing an alternate ip:port to be used for ip-only
  48. GCE metadata requests."""
  49. GOOGLE_API_USE_CLIENT_CERTIFICATE = "GOOGLE_API_USE_CLIENT_CERTIFICATE"
  50. """Environment variable controlling whether to use client certificate or not.
  51. The default value is false. Users have to explicitly set this value to true
  52. in order to use client certificate to establish a mutual TLS channel."""
  53. LEGACY_APPENGINE_RUNTIME = "APPENGINE_RUNTIME"
  54. """Gen1 environment variable defining the App Engine Runtime.
  55. Used to distinguish between GAE gen1 and GAE gen2+.
  56. """
  57. # AWS environment variables used with AWS workload identity pools to retrieve
  58. # AWS security credentials and the AWS region needed to create a serialized
  59. # signed requests to the AWS STS GetCalledIdentity API that can be exchanged
  60. # for a Google access tokens via the GCP STS endpoint.
  61. # When not available the AWS metadata server is used to retrieve these values.
  62. AWS_ACCESS_KEY_ID = "AWS_ACCESS_KEY_ID"
  63. AWS_SECRET_ACCESS_KEY = "AWS_SECRET_ACCESS_KEY"
  64. AWS_SESSION_TOKEN = "AWS_SESSION_TOKEN"
  65. AWS_REGION = "AWS_REGION"
  66. AWS_DEFAULT_REGION = "AWS_DEFAULT_REGION"