Commit 638be37d authored by Komal Makkar's avatar Komal Makkar Committed by Daniel Scholl
Browse files

Integration Test changes for Azure

parent cf1a48f3
......@@ -83,7 +83,7 @@ python3 -m pip install -r requirements.txt
To run:
python3 python3
**Note:** To simulate a runtime exactly as that of the vsts build agent, you can simply exec into the docker image we use for the build agent, and run the tests from inside it. To know how to do this, please follow [this]( documentation.
\ No newline at end of file
import os
import msal
import urllib
import sys
def get_id_token():
raise Exception("The operation is not implemented")
# Generate valid Token for given tenant.
tenant_id = os.environ["AZURE_DEPLOY_TENANT"]
resource_id = os.environ["AZURE_AD_APP_RESOURCE_ID"]
client_id = os.environ["AZURE_DEPLOY_CLIENT_ID"]
client_secret = os.environ["AZURE_DEPLOY_CLIENT_SECRET"]
authority_host_uri = ''
authority_uri = urllib.parse.urljoin(authority_host_uri, tenant_id)
scopes = [resource_id + '/.default']
app = msal.ConfidentialClientApplication(client_id=client_id, authority=authority_uri, client_credential=client_secret)
result = app.acquire_token_for_client(scopes=scopes)
return result.get('access_token')
def get_invalid_token():
return ""
This is dummy jwt
"sub": "",
"iss": "",
"aud": "",
"iat": 1556137273,
"exp": 1556223673,
"provider": "",
"client": "",
"userid": "",
"email": "",
"authz": "",
"lastname": "dummy",
"firstname": "dummy",
"country": "",
"company": "",
"jobtitle": "",
"subid": "dummyid",
"idp": "dummy",
"hd": "",
"desid": "dummyid",
"contact_email": ""
return "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJkdW1teUBkdW1teS5jb20iLCJpc3MiOiJkdW1teUBkdW1teS5jb20iLCJhdWQiOiJkdW1teS5kdW1teS5jb20iLCJpYXQiOjE1NTYxMzcyNzMsImV4cCI6MTU1NjIzMDk3OSwicHJvdmlkZXIiOiJkdW1teS5jb20iLCJjbGllbnQiOiJkdW1teS5jb20iLCJ1c2VyaWQiOiJkdW1teXRlc3Rlci5jb20iLCJlbWFpbCI6ImR1bW15dGVzdGVyLmNvbSIsImF1dGh6IjoiIiwibGFzdG5hbWUiOiJkdW1teSIsImZpcnN0bmFtZSI6ImR1bW15IiwiY291bnRyeSI6IiIsImNvbXBhbnkiOiIiLCJqb2J0aXRsZSI6IiIsInN1YmlkIjoiZHVtbXlpZCIsImlkcCI6ImR1bW15IiwiaGQiOiJkdW1teS5jb20iLCJkZXNpZCI6ImR1bW15aWQiLCJjb250YWN0X2VtYWlsIjoiZHVtbXlAZHVtbXkuY29tIiwianRpIjoiNGEyMWYyYzItZjU5Yy00NWZhLTk0MTAtNDNkNDdhMTg4ODgwIn0.nkiyKtfXXxAlC60iDjXuB2EAGDfZiVglP-CyU1T4etc"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment