Commit 3f90d1b4 authored by Daniel Scholl's avatar Daniel Scholl
Browse files

Merge branch 'crs_catalog_azure_integration_test' into 'master'

Integration Test changes for Azure

See merge request osdu/platform/reference/crs-catalog-service!1
parents cf1a48f3 638be37d
Pipeline #7760 canceled with stages
......@@ -83,7 +83,7 @@ python3 -m pip install -r requirements.txt
To run:
```bash
python3 python3 run_test.py
python3 run_test.py
```
**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](https://slb-swt.visualstudio.com/data-at-rest/_git/dps-vsts-build-agent?path=%2FREADME.md&version=GBmaster) 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 = 'https://login.microsoftonline.com'
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": "dummy@dummy.com",
"iss": "dummy@dummy.com",
"aud": "dummy.dummy.com",
"iat": 1556137273,
"exp": 1556223673,
"provider": "dummy.com",
"client": "dummy.com",
"userid": "dummytester.com",
"email": "dummytester.com",
"authz": "",
"lastname": "dummy",
"firstname": "dummy",
"country": "",
"company": "",
"jobtitle": "",
"subid": "dummyid",
"idp": "dummy",
"hd": "dummy.com",
"desid": "dummyid",
"contact_email": "dummy@dummy.com"
}
'''
return "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJkdW1teUBkdW1teS5jb20iLCJpc3MiOiJkdW1teUBkdW1teS5jb20iLCJhdWQiOiJkdW1teS5kdW1teS5jb20iLCJpYXQiOjE1NTYxMzcyNzMsImV4cCI6MTU1NjIzMDk3OSwicHJvdmlkZXIiOiJkdW1teS5jb20iLCJjbGllbnQiOiJkdW1teS5jb20iLCJ1c2VyaWQiOiJkdW1teXRlc3Rlci5jb20iLCJlbWFpbCI6ImR1bW15dGVzdGVyLmNvbSIsImF1dGh6IjoiIiwibGFzdG5hbWUiOiJkdW1teSIsImZpcnN0bmFtZSI6ImR1bW15IiwiY291bnRyeSI6IiIsImNvbXBhbnkiOiIiLCJqb2J0aXRsZSI6IiIsInN1YmlkIjoiZHVtbXlpZCIsImlkcCI6ImR1bW15IiwiaGQiOiJkdW1teS5jb20iLCJkZXNpZCI6ImR1bW15aWQiLCJjb250YWN0X2VtYWlsIjoiZHVtbXlAZHVtbXkuY29tIiwianRpIjoiNGEyMWYyYzItZjU5Yy00NWZhLTk0MTAtNDNkNDdhMTg4ODgwIn0.nkiyKtfXXxAlC60iDjXuB2EAGDfZiVglP-CyU1T4etc"
adal==1.2.2
msal==1.3.0
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
......
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