1
0
Fork 0

addressed comments

pull/887/head
Sourav Chanduka 2021-08-17 09:32:42 +05:30
parent 1c86c4c890
commit 22e5d95310
2 changed files with 7 additions and 8 deletions

View File

@ -227,11 +227,8 @@ In action's `main.ts`:
const core = require('@actions/core');
async function getIDTokenAction(): Promise<void> {
let aud = ''
const audience = core.getInput('audience', {required: false})
if (audience !== undefined)
aud = `${audience}`
const id_token = await core.getIDToken(aud)
const id_token = await core.getIDToken(audience)
core.setOutput('id_token', id_token)
}

View File

@ -15,9 +15,11 @@ interface TokenResponse {
export class OidcClient {
private static createHttpClient(allowRetry = true, maxRetry = 10) {
let requestOptions : IRequestOptions = {}
requestOptions.allowRetries = allowRetry
requestOptions.maxRetries = maxRetry
let requestOptions : IRequestOptions = {
allowRetries: allowRetry,
maxRetries: maxRetry
}
return new HttpClient('actions/oidc-client', [
new BearerCredentialHandler(OidcClient.getRuntimeToken())],
requestOptions)
@ -45,7 +47,7 @@ export class OidcClient {
private static async postCall(httpclient: actions_http_client.HttpClient, id_token_url: string, audience: string): Promise<string> {
const data :TokenRequest = { aud: !!audience ? audience : ''}
const data: TokenRequest = { aud: audience }
debug(`audience is ${!!audience ? audience : 'not defined'}`)