This section contains samples for Downscoping with Credential Access Boundaries.
-
Your environment must be setup with authentication information. If you're running on Cloud Shell or Compute Engine, this is already setup. You can also use
gcloud auth application-default login. -
Install dependencies from
requirements.txt$ pip install -r requirements.txt -
Set the environment variable
GOOGLE_CLOUD_PROJECTto the project ID. More details are available in the AUTHORING_GUIDE. -
To run the samples, the
main(bucket_name, object_name)function should be run with a created storage bucket name and the object name in that bucket of the file to use to test access. -
To run the tests, the application default credentials principal should have the ability to create and delete a Cloud Storage bucket:
$ nox -s py-3.7 -- snippets_test.py
For more information on downscoped credentials you can visit:
