Skip to content

Instantly share code, notes, and snippets.

@prabhu
Created July 26, 2020 14:09
Embed
What would you like to do?
Example for making Bitbucket api calls from pipelines using the local proxy
import requests
# Use local bitbucket proxy to avoid the need for app password
proxies = {
"http": "http://localhost:29418",
"https": "http://localhost:29418",
}
# Use the proxies object in requests for making
# authenticated calls without app passwords
requests.put(
f"http://api.bitbucket.org/2.0/repositories/{BITBUCKET_REPO_OWNER}/{BITBUCKET_REPO_SLUG}/commit/{BITBUCKET_COMMIT}/reports/shiftleft-ngsast",
proxies=proxies,
headers={"Content-Type": "application/json",},
json=annotation,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment