Skip to content

Python requests wrapper for service-to-service auth on GCP

License

Notifications You must be signed in to change notification settings

adrianchifor/requests-gcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

requests-gcp

Python requests wrapper for service-to-service authentication on GCP. Drop-in replacement with support for get, head, post, put, patch, delete, options.

Adds Authorization header with a Google-signed OAuth ID token for the receiving URL. The JWT tokens are cached for subsequent requests and automatically renewed (they usually expire within 1h).

Install

pip3 install requests-gcp

Usage

import requestsgcp as requests

# Request to a private Cloud Run service
requests.get("https://<service>.run.app")

# External request
requests.get("https://yahoo.com", gcp_auth=False)

About

Python requests wrapper for service-to-service auth on GCP

Resources

License

Stars

Watchers

Forks

Packages

No packages published