mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-30 20:58:05 +08:00
Full release of actions/core 1.6.0 with oidc behavior (#919)
* OIDC Client for actions/core Co-authored-by: Sourav Chanduka <souravchanduka37@gmail.com> Co-authored-by: Sourav Chanduka <souravchanduka@users.noreply.github.com> Co-authored-by: Tingluo Huang <tingluohuang@github.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import * as fs from 'fs'
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
import * as core from '../src/core'
|
||||
import {HttpClient} from '@actions/http-client'
|
||||
import {toCommandProperties} from '../src/utils'
|
||||
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
@@ -469,3 +470,20 @@ function verifyFileCommand(command: string, expectedContents: string): void {
|
||||
fs.unlinkSync(filePath)
|
||||
}
|
||||
}
|
||||
|
||||
function getTokenEndPoint(): string {
|
||||
return 'https://vstoken.actions.githubusercontent.com/.well-known/openid-configuration'
|
||||
}
|
||||
|
||||
describe('oidc-client-tests', () => {
|
||||
it('Get Http Client', async () => {
|
||||
const http = new HttpClient('actions/oidc-client')
|
||||
expect(http).toBeDefined()
|
||||
})
|
||||
|
||||
it('HTTP get request to get token endpoint', async () => {
|
||||
const http = new HttpClient('actions/oidc-client')
|
||||
const res = await http.get(getTokenEndPoint())
|
||||
expect(res.message.statusCode).toBe(200)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user