Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ object TesAsyncBackendJobExecutionActor {
| exit 1
| fi
|fi
|
|curl --version
|jq --version
|# Acquire bearer token, relying on the User Assigned Managed Identity of this VM.
|echo Acquiring Bearer Token using User Assigned Managed Identity...
|BEARER_TOKEN=$$(curl 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com%2F' -H Metadata:true -s | jq .access_token)
|
|# Remove the leading and trailing quotes
|BEARER_TOKEN="$${BEARER_TOKEN#\\"}"
|BEARER_TOKEN="$${BEARER_TOKEN%\\"}"
Expand All @@ -117,7 +117,9 @@ object TesAsyncBackendJobExecutionActor {
| -X POST "$getSasWsmEndpoint" \\
| -H "Content-Type: application/json" \\
| -H "accept: */*" \\
| -H "Authorization: Bearer $${BEARER_TOKEN}")
| -H "Authorization: Bearer $${BEARER_TOKEN}" \\
| -H "Content-Length: 0" \\
| -d "")
|
|# Store token as environment variable
|export $environmentVariableName=$$(echo "$${sas_response_json}" | jq -r '.token')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ class TesAsyncBackendJobExecutionActorSpec extends AnyFlatSpec with Matchers wit
| -X POST "$expectedEndpoint" \\
| -H "Content-Type: application/json" \\
| -H "accept: */*" \\
| -H "Authorization: Bearer $${BEARER_TOKEN}")
| -H "Authorization: Bearer $${BEARER_TOKEN}" \\
| -H "Content-Length: 0" \\
| -d "")
|""".stripMargin
val exportCommandSubstring = s"""export $mockEnvironmentVariableNameFromWom=$$(echo "$${sas_response_json}" | jq -r '.token')"""
val echoCommandSubstring = s"""echo "Saving sas token: $${$mockEnvironmentVariableNameFromWom:0:4}**** to environment variable $mockEnvironmentVariableNameFromWom...""""
Expand Down