Compare commits
92
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e69bffbba | ||
|
|
d1aa255c7f | ||
|
|
7298ff3219 | ||
|
|
571d782946 | ||
|
|
ada9e00cda | ||
|
|
faf9cb2ea2 | ||
|
|
ac3a063583 | ||
|
|
7cc96bb976 | ||
|
|
fa6cc53297 | ||
|
|
f299e8ba1e | ||
|
|
1b9927d1c7 | ||
|
|
279e891118 | ||
|
|
340a1033a5 | ||
|
|
50f2977cce | ||
|
|
48a65377c0 | ||
|
|
f003268b32 | ||
|
|
3a33cca851 | ||
|
|
bb6c500939 | ||
|
|
76b6e24aee | ||
|
|
58d14c4ef5 | ||
|
|
7463cf3da6 | ||
|
|
90d9783552 | ||
|
|
7c61054649 | ||
|
|
b28406bd1f | ||
|
|
9517cdf52d | ||
|
|
49927e464a | ||
|
|
3e34f6d19c | ||
|
|
182702d2df | ||
|
|
1db73622df | ||
|
|
56832696fc | ||
|
|
176b40a888 | ||
|
|
361a115e53 | ||
|
|
dddc440d56 | ||
|
|
08d6f14ea8 | ||
|
|
73100a7f85 | ||
|
|
c6b487124a | ||
|
|
8735a7e2da | ||
|
|
d1df13e178 | ||
|
|
d3d7736bae | ||
|
|
7d18e7aa0d | ||
|
|
e60694077d | ||
|
|
ae38557bb0 | ||
|
|
abb586d71e | ||
|
|
81a73aba8b | ||
|
|
0e8fe8af62 | ||
|
|
29885a805e | ||
|
|
9eb3d3a673 | ||
|
|
6e642f628f | ||
|
|
0159bbe7f2 | ||
|
|
476276bf98 | ||
|
|
d82fd09f99 | ||
|
|
2961d73391 | ||
|
|
eb1cb3649c | ||
|
|
b384fe17ba | ||
|
|
ccb1df45d1 | ||
|
|
5a736647a1 | ||
|
|
918b468a41 | ||
|
|
234761dc05 | ||
|
|
fa1cb5d153 | ||
|
|
e998cf1216 | ||
|
|
2bbbf928ae | ||
|
|
fa06a1eadf | ||
|
|
5eea9e34e7 | ||
|
|
75b5e5376d | ||
|
|
be507421b1 | ||
|
|
5d943d4b7f | ||
|
|
67951b1f2b | ||
|
|
c104cf5dc0 | ||
|
|
4fb4c6ed94 | ||
|
|
df5a794b3d | ||
|
|
c01bc907ed | ||
|
|
222733049e | ||
|
|
fa9db3c8fa | ||
|
|
18a8a22c65 | ||
|
|
425f05e29d | ||
|
|
90fca23920 | ||
|
|
0d3d3bbb40 | ||
|
|
98ce947a6c | ||
|
|
2ed9516172 | ||
|
|
4fc93ec115 | ||
|
|
61d6acdeb1 | ||
|
|
f98ccd1e39 | ||
|
|
7f0a981b2e | ||
|
|
2e7a11c409 | ||
|
|
9ddf153e00 | ||
|
|
f8d95a85df | ||
|
|
59e9d284e9 | ||
|
|
4ce4c767e2 | ||
|
|
a0e6af1e53 | ||
|
|
ef77c9d60b | ||
|
|
8fee77b04b | ||
|
|
b807fc9c54 |
@@ -43,7 +43,7 @@ Note that before a PR will be accepted, you must ensure:
|
|||||||
1. In a new branch, create a new Lerna package:
|
1. In a new branch, create a new Lerna package:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ npm run create-package new-package
|
$ npm run new-package [name]
|
||||||
```
|
```
|
||||||
|
|
||||||
This will ask you some questions about the new package. Start with `0.0.0` as the first version (look generally at some of the other packages for how the package.json is structured).
|
This will ask you some questions about the new package. Start with `0.0.0` as the first version (look generally at some of the other packages for how the package.json is structured).
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
run: npm run bootstrap
|
run: npm run bootstrap
|
||||||
|
|
||||||
- name: audit tools (without allow-list)
|
- name: audit tools (without allow-list)
|
||||||
run: npm audit --audit-level=moderate
|
run: npm audit --audit-level=moderate --omit dev
|
||||||
|
|
||||||
- name: audit packages
|
- name: audit packages
|
||||||
run: npm run audit-all
|
run: npm run audit-all
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
name: Publish NPM
|
name: Publish NPM
|
||||||
|
|
||||||
|
run-name: Publish NPM - ${{ github.event.inputs.package }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
Generated
+3492
-1881
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -13,7 +13,7 @@
|
|||||||
"lint": "eslint packages/**/*.ts",
|
"lint": "eslint packages/**/*.ts",
|
||||||
"lint-fix": "eslint packages/**/*.ts --fix",
|
"lint-fix": "eslint packages/**/*.ts --fix",
|
||||||
"new-package": "scripts/create-package",
|
"new-package": "scripts/create-package",
|
||||||
"test": "jest --testTimeout 60000"
|
"test": "jest --testTimeout 70000"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.4",
|
"@types/jest": "^29.5.4",
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"flow-bin": "^0.115.0",
|
"flow-bin": "^0.115.0",
|
||||||
"jest": "^29.6.4",
|
"jest": "^29.6.4",
|
||||||
"lerna": "^7.1.4",
|
"lerna": "^6.4.1",
|
||||||
"nx": "16.6.0",
|
"nx": "16.6.0",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^29.1.1",
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @actions/artifact Releases
|
# @actions/artifact Releases
|
||||||
|
|
||||||
|
### 2.1.9
|
||||||
|
|
||||||
|
- Fixed artifact upload chunk timeout logic [#1774](https://github.com/actions/toolkit/pull/1774)
|
||||||
|
- Use lazy stream to prevent issues with open file limits [#1771](https://github.com/actions/toolkit/pull/1771)
|
||||||
|
|
||||||
|
### 2.1.8
|
||||||
|
|
||||||
|
- Allows `*.localhost` domains for hostname checks for local development.
|
||||||
|
|
||||||
|
### 2.1.7
|
||||||
|
|
||||||
|
- Update unzip-stream dependency and reverted to using `unzip.Extract()`
|
||||||
|
|
||||||
|
### 2.1.6
|
||||||
|
|
||||||
|
- Will retry on invalid request responses.
|
||||||
|
|
||||||
|
### 2.1.5
|
||||||
|
|
||||||
|
- Bumped `archiver` dependency to 7.0.1
|
||||||
|
|
||||||
### 2.1.4
|
### 2.1.4
|
||||||
|
|
||||||
- Adds info-level logging for zip extraction
|
- Adds info-level logging for zip extraction
|
||||||
|
|||||||
@@ -116,6 +116,54 @@ describe('artifact-http-client', () => {
|
|||||||
expect(mockPost).toHaveBeenCalledTimes(2)
|
expect(mockPost).toHaveBeenCalledTimes(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should retry if invalid body response', async () => {
|
||||||
|
const mockPost = jest
|
||||||
|
.fn(() => {
|
||||||
|
const msgSucceeded = new http.IncomingMessage(new net.Socket())
|
||||||
|
msgSucceeded.statusCode = 200
|
||||||
|
return {
|
||||||
|
message: msgSucceeded,
|
||||||
|
readBody: async () => {
|
||||||
|
return Promise.resolve(
|
||||||
|
`{"ok": true, "signedUploadUrl": "http://localhost:8080/upload"}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.mockImplementationOnce(() => {
|
||||||
|
const msgFailed = new http.IncomingMessage(new net.Socket())
|
||||||
|
msgFailed.statusCode = 502
|
||||||
|
msgFailed.statusMessage = 'Bad Gateway'
|
||||||
|
return {
|
||||||
|
message: msgFailed,
|
||||||
|
readBody: async () => {
|
||||||
|
return Promise.resolve('💥')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const mockHttpClient = (
|
||||||
|
HttpClient as unknown as jest.Mock
|
||||||
|
).mockImplementation(() => {
|
||||||
|
return {
|
||||||
|
post: mockPost
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const client = internalArtifactTwirpClient(clientOptions)
|
||||||
|
const artifact = await client.CreateArtifact({
|
||||||
|
workflowRunBackendId: '1234',
|
||||||
|
workflowJobRunBackendId: '5678',
|
||||||
|
name: 'artifact',
|
||||||
|
version: 4
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledTimes(1)
|
||||||
|
expect(artifact).toBeDefined()
|
||||||
|
expect(artifact.ok).toBe(true)
|
||||||
|
expect(artifact.signedUploadUrl).toBe('http://localhost:8080/upload')
|
||||||
|
expect(mockPost).toHaveBeenCalledTimes(2)
|
||||||
|
})
|
||||||
|
|
||||||
it('should fail if the request fails 5 times', async () => {
|
it('should fail if the request fails 5 times', async () => {
|
||||||
const mockPost = jest.fn(() => {
|
const mockPost = jest.fn(() => {
|
||||||
const msgFailed = new http.IncomingMessage(new net.Socket())
|
const msgFailed = new http.IncomingMessage(new net.Socket())
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ describe('isGhes', () => {
|
|||||||
expect(config.isGhes()).toBe(false)
|
expect(config.isGhes()).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should return false when the request domain ends with .localhost', () => {
|
||||||
|
process.env.GITHUB_SERVER_URL = 'https://github.localhost'
|
||||||
|
expect(config.isGhes()).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
it('should return false when the request domain is specific to an enterprise', () => {
|
it('should return false when the request domain is specific to an enterprise', () => {
|
||||||
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
|
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
|
||||||
expect(config.isGhes()).toBe(true)
|
expect(config.isGhes()).toBe(true)
|
||||||
|
|||||||
@@ -200,14 +200,12 @@ describe('download-artifact', () => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
await expect(
|
const response = await downloadArtifactPublic(
|
||||||
downloadArtifactPublic(
|
|
||||||
fixtures.artifactID,
|
fixtures.artifactID,
|
||||||
fixtures.repositoryOwner,
|
fixtures.repositoryOwner,
|
||||||
fixtures.repositoryName,
|
fixtures.repositoryName,
|
||||||
fixtures.token
|
fixtures.token
|
||||||
)
|
)
|
||||||
).rejects.toBeInstanceOf(Error)
|
|
||||||
|
|
||||||
expect(downloadArtifactMock).toHaveBeenCalledWith({
|
expect(downloadArtifactMock).toHaveBeenCalledWith({
|
||||||
owner: fixtures.repositoryOwner,
|
owner: fixtures.repositoryOwner,
|
||||||
@@ -223,6 +221,16 @@ describe('download-artifact', () => {
|
|||||||
expect(mockGetArtifactMalicious).toHaveBeenCalledWith(
|
expect(mockGetArtifactMalicious).toHaveBeenCalledWith(
|
||||||
fixtures.blobStorageUrl
|
fixtures.blobStorageUrl
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ensure path traversal was not possible
|
||||||
|
expect(
|
||||||
|
fs.existsSync(path.join(fixtures.workspaceDir, 'x/etc/hosts'))
|
||||||
|
).toBe(true)
|
||||||
|
expect(
|
||||||
|
fs.existsSync(path.join(fixtures.workspaceDir, 'y/etc/hosts'))
|
||||||
|
).toBe(true)
|
||||||
|
|
||||||
|
expect(response.downloadPath).toBe(fixtures.workspaceDir)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should successfully download an artifact to user defined path', async () => {
|
it('should successfully download an artifact to user defined path', async () => {
|
||||||
|
|||||||
@@ -1,257 +1,137 @@
|
|||||||
import * as uploadZipSpecification from '../src/internal/upload/upload-zip-specification'
|
import * as uploadZipSpecification from '../src/internal/upload/upload-zip-specification'
|
||||||
import * as zip from '../src/internal/upload/zip'
|
import * as zip from '../src/internal/upload/zip'
|
||||||
import * as util from '../src/internal/shared/util'
|
import * as util from '../src/internal/shared/util'
|
||||||
import * as retention from '../src/internal/upload/retention'
|
|
||||||
import * as config from '../src/internal/shared/config'
|
import * as config from '../src/internal/shared/config'
|
||||||
import {Timestamp, ArtifactServiceClientJSON} from '../src/generated'
|
import {ArtifactServiceClientJSON} from '../src/generated'
|
||||||
import * as blobUpload from '../src/internal/upload/blob-upload'
|
import * as blobUpload from '../src/internal/upload/blob-upload'
|
||||||
import {uploadArtifact} from '../src/internal/upload/upload-artifact'
|
import {uploadArtifact} from '../src/internal/upload/upload-artifact'
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common'
|
||||||
import {FilesNotFoundError} from '../src/internal/shared/errors'
|
import {FilesNotFoundError} from '../src/internal/shared/errors'
|
||||||
|
import {BlockBlobUploadStreamOptions} from '@azure/storage-blob'
|
||||||
|
import * as fs from 'fs'
|
||||||
|
import * as path from 'path'
|
||||||
|
|
||||||
|
const uploadStreamMock = jest.fn()
|
||||||
|
const blockBlobClientMock = jest.fn().mockImplementation(() => ({
|
||||||
|
uploadStream: uploadStreamMock
|
||||||
|
}))
|
||||||
|
|
||||||
|
jest.mock('@azure/storage-blob', () => ({
|
||||||
|
BlobClient: jest.fn().mockImplementation(() => {
|
||||||
|
return {
|
||||||
|
getBlockBlobClient: blockBlobClientMock
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}))
|
||||||
|
|
||||||
|
const fixtures = {
|
||||||
|
uploadDirectory: path.join(__dirname, '_temp', 'plz-upload'),
|
||||||
|
files: [
|
||||||
|
['file1.txt', 'test 1 file content'],
|
||||||
|
['file2.txt', 'test 2 file content'],
|
||||||
|
['file3.txt', 'test 3 file content']
|
||||||
|
],
|
||||||
|
backendIDs: {
|
||||||
|
workflowRunBackendId: '67dbcc20-e851-4452-a7c3-2cc0d2e0ec67',
|
||||||
|
workflowJobRunBackendId: '5f49179d-3386-4c38-85f7-00f8138facd0'
|
||||||
|
},
|
||||||
|
runtimeToken: 'test-token',
|
||||||
|
resultsServiceURL: 'http://results.local',
|
||||||
|
inputs: {
|
||||||
|
artifactName: 'test-artifact',
|
||||||
|
files: [
|
||||||
|
'/home/user/files/plz-upload/file1.txt',
|
||||||
|
'/home/user/files/plz-upload/file2.txt',
|
||||||
|
'/home/user/files/plz-upload/dir/file3.txt'
|
||||||
|
],
|
||||||
|
rootDirectory: '/home/user/files/plz-upload'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
describe('upload-artifact', () => {
|
describe('upload-artifact', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
if (!fs.existsSync(fixtures.uploadDirectory)) {
|
||||||
|
fs.mkdirSync(fixtures.uploadDirectory, {recursive: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [file, content] of fixtures.files) {
|
||||||
|
fs.writeFileSync(path.join(fixtures.uploadDirectory, file), content)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
noopLogs()
|
noopLogs()
|
||||||
|
jest
|
||||||
|
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
||||||
|
.mockReturnValue()
|
||||||
|
jest
|
||||||
|
.spyOn(util, 'getBackendIdsFromToken')
|
||||||
|
.mockReturnValue(fixtures.backendIDs)
|
||||||
|
jest
|
||||||
|
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
||||||
|
.mockReturnValue(
|
||||||
|
fixtures.files.map(file => ({
|
||||||
|
sourcePath: path.join(fixtures.uploadDirectory, file[0]),
|
||||||
|
destinationPath: file[0]
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
jest.spyOn(config, 'getRuntimeToken').mockReturnValue(fixtures.runtimeToken)
|
||||||
|
jest
|
||||||
|
.spyOn(config, 'getResultsServiceUrl')
|
||||||
|
.mockReturnValue(fixtures.resultsServiceURL)
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
jest.restoreAllMocks()
|
jest.restoreAllMocks()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should successfully upload an artifact', () => {
|
it('should reject if there are no files to upload', async () => {
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
|
||||||
.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
ok: true,
|
|
||||||
signedUploadUrl: 'https://signed-upload-url.com'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest.spyOn(blobUpload, 'uploadZipToBlobStorage').mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
uploadSize: 1234,
|
|
||||||
sha256Hash: 'test-sha256-hash'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
|
||||||
.mockReturnValue(Promise.resolve({ok: true, artifactId: '1'}))
|
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).resolves.toEqual({size: 1234, id: 1})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should throw an error if the root directory is invalid', () => {
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockImplementation(() => {
|
|
||||||
throw new Error('Invalid root directory')
|
|
||||||
})
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow('Invalid root directory')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should reject if there are no files to upload', () => {
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
jest
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
||||||
|
.mockClear()
|
||||||
.mockReturnValue([])
|
.mockReturnValue([])
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
expect(uploadResp).rejects.toThrowError(FilesNotFoundError)
|
await expect(uploadResp).rejects.toThrowError(FilesNotFoundError)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should reject if no backend IDs are found', () => {
|
it('should reject if no backend IDs are found', async () => {
|
||||||
jest
|
jest.spyOn(util, 'getBackendIdsFromToken').mockRestore()
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow()
|
await expect(uploadResp).rejects.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return false if the creation request fails', () => {
|
it('should return false if the creation request fails', async () => {
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
.spyOn(zip, 'createZipUploadStream')
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
jest
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
.mockReturnValue(Promise.resolve({ok: false, signedUploadUrl: ''}))
|
.mockReturnValue(Promise.resolve({ok: false, signedUploadUrl: ''}))
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow()
|
await expect(uploadResp).rejects.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return false if blob storage upload is unsuccessful', () => {
|
it('should return false if blob storage upload is unsuccessful', async () => {
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
.spyOn(zip, 'createZipUploadStream')
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
jest
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
.mockReturnValue(
|
.mockReturnValue(
|
||||||
@@ -264,57 +144,19 @@ describe('upload-artifact', () => {
|
|||||||
.spyOn(blobUpload, 'uploadZipToBlobStorage')
|
.spyOn(blobUpload, 'uploadZipToBlobStorage')
|
||||||
.mockReturnValue(Promise.reject(new Error('boom')))
|
.mockReturnValue(Promise.reject(new Error('boom')))
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow()
|
await expect(uploadResp).rejects.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should reject if finalize artifact fails', () => {
|
it('should reject if finalize artifact fails', async () => {
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
.spyOn(zip, 'createZipUploadStream')
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
jest
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
.mockReturnValue(
|
.mockReturnValue(
|
||||||
@@ -333,22 +175,113 @@ describe('upload-artifact', () => {
|
|||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
||||||
.mockReturnValue(Promise.resolve({ok: false, artifactId: ''}))
|
.mockReturnValue(Promise.resolve({ok: false, artifactId: ''}))
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow()
|
await expect(uploadResp).rejects.toThrow()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should successfully upload an artifact', async () => {
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
|
.mockReturnValue(
|
||||||
|
Promise.resolve({
|
||||||
|
ok: true,
|
||||||
|
signedUploadUrl: 'https://signed-upload-url.local'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
||||||
|
.mockReturnValue(
|
||||||
|
Promise.resolve({
|
||||||
|
ok: true,
|
||||||
|
artifactId: '1'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
uploadStreamMock.mockImplementation(
|
||||||
|
async (
|
||||||
|
stream: NodeJS.ReadableStream,
|
||||||
|
bufferSize?: number,
|
||||||
|
maxConcurrency?: number,
|
||||||
|
options?: BlockBlobUploadStreamOptions
|
||||||
|
) => {
|
||||||
|
const {onProgress, abortSignal} = options || {}
|
||||||
|
|
||||||
|
onProgress?.({loadedBytes: 0})
|
||||||
|
|
||||||
|
return new Promise(resolve => {
|
||||||
|
const timerId = setTimeout(() => {
|
||||||
|
onProgress?.({loadedBytes: 256})
|
||||||
|
resolve({})
|
||||||
|
}, 1_000)
|
||||||
|
abortSignal?.addEventListener('abort', () => {
|
||||||
|
clearTimeout(timerId)
|
||||||
|
resolve({})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const {id, size} = await uploadArtifact(
|
||||||
|
fixtures.inputs.artifactName,
|
||||||
|
fixtures.inputs.files,
|
||||||
|
fixtures.inputs.rootDirectory
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(id).toBe(1)
|
||||||
|
expect(size).toBe(256)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw an error uploading blob chunks get delayed', async () => {
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
|
.mockReturnValue(
|
||||||
|
Promise.resolve({
|
||||||
|
ok: true,
|
||||||
|
signedUploadUrl: 'https://signed-upload-url.local'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
||||||
|
.mockReturnValue(
|
||||||
|
Promise.resolve({
|
||||||
|
ok: true,
|
||||||
|
artifactId: '1'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
jest
|
||||||
|
.spyOn(config, 'getResultsServiceUrl')
|
||||||
|
.mockReturnValue('https://results.local')
|
||||||
|
|
||||||
|
jest.spyOn(config, 'getUploadChunkTimeout').mockReturnValue(2_000)
|
||||||
|
|
||||||
|
uploadStreamMock.mockImplementation(
|
||||||
|
async (
|
||||||
|
stream: NodeJS.ReadableStream,
|
||||||
|
bufferSize?: number,
|
||||||
|
maxConcurrency?: number,
|
||||||
|
options?: BlockBlobUploadStreamOptions
|
||||||
|
) => {
|
||||||
|
const {onProgress, abortSignal} = options || {}
|
||||||
|
onProgress?.({loadedBytes: 0})
|
||||||
|
return new Promise(resolve => {
|
||||||
|
abortSignal?.addEventListener('abort', () => {
|
||||||
|
resolve({})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const uploadResp = uploadArtifact(
|
||||||
|
fixtures.inputs.artifactName,
|
||||||
|
fixtures.inputs.files,
|
||||||
|
fixtures.inputs.rootDirectory
|
||||||
|
)
|
||||||
|
|
||||||
|
await expect(uploadResp).rejects.toThrow('Upload progress stalled.')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Generated
+551
-139
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.1.4",
|
"version": "2.1.9",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.1.4",
|
"version": "2.1.9",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^3.0.9",
|
||||||
"@octokit/request-error": "^5.0.0",
|
"@octokit/request-error": "^5.0.0",
|
||||||
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^7.0.1",
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"twirp-ts": "^2.5.0",
|
"twirp-ts": "^2.5.0",
|
||||||
@@ -186,6 +186,22 @@
|
|||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@isaacs/cliui": {
|
||||||
|
"version": "8.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||||
|
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": "^5.1.2",
|
||||||
|
"string-width-cjs": "npm:string-width@^4.2.0",
|
||||||
|
"strip-ansi": "^7.0.1",
|
||||||
|
"strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
|
||||||
|
"wrap-ansi": "^8.1.0",
|
||||||
|
"wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@octokit/auth-token": {
|
"node_modules/@octokit/auth-token": {
|
||||||
"version": "2.5.0",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz",
|
||||||
@@ -348,6 +364,15 @@
|
|||||||
"node": ">=8.0.0"
|
"node": ">=8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@pkgjs/parseargs": {
|
||||||
|
"version": "0.11.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
|
||||||
|
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
|
||||||
|
"optional": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@protobuf-ts/plugin": {
|
"node_modules/@protobuf-ts/plugin": {
|
||||||
"version": "2.9.1",
|
"version": "2.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.1.tgz",
|
||||||
@@ -480,74 +505,120 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/abort-controller": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||||
|
"dependencies": {
|
||||||
|
"event-target-shim": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ansi-regex": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ansi-sequence-parser": {
|
"node_modules/ansi-sequence-parser": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz",
|
||||||
"integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==",
|
"integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/ansi-styles": {
|
||||||
|
"version": "6.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
|
||||||
|
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/archiver": {
|
"node_modules/archiver": {
|
||||||
"version": "5.3.1",
|
"version": "7.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz",
|
||||||
"integrity": "sha512-8KyabkmbYrH+9ibcTScQ1xCJC/CGcugdVIwB+53f5sZziXgwUh3iXlAlANMxcZyDEfTHMe6+Z5FofV8nopXP7w==",
|
"integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"archiver-utils": "^2.1.0",
|
"archiver-utils": "^5.0.2",
|
||||||
"async": "^3.2.3",
|
"async": "^3.2.4",
|
||||||
"buffer-crc32": "^0.2.1",
|
"buffer-crc32": "^1.0.0",
|
||||||
"readable-stream": "^3.6.0",
|
"readable-stream": "^4.0.0",
|
||||||
"readdir-glob": "^1.0.0",
|
"readdir-glob": "^1.1.2",
|
||||||
"tar-stream": "^2.2.0",
|
"tar-stream": "^3.0.0",
|
||||||
"zip-stream": "^4.1.0"
|
"zip-stream": "^6.0.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/archiver-utils": {
|
"node_modules/archiver-utils": {
|
||||||
"version": "2.1.0",
|
"version": "5.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz",
|
||||||
"integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==",
|
"integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"glob": "^7.1.4",
|
"glob": "^10.0.0",
|
||||||
"graceful-fs": "^4.2.0",
|
"graceful-fs": "^4.2.0",
|
||||||
|
"is-stream": "^2.0.1",
|
||||||
"lazystream": "^1.0.0",
|
"lazystream": "^1.0.0",
|
||||||
"lodash.defaults": "^4.2.0",
|
"lodash": "^4.17.15",
|
||||||
"lodash.difference": "^4.5.0",
|
|
||||||
"lodash.flatten": "^4.4.0",
|
|
||||||
"lodash.isplainobject": "^4.0.6",
|
|
||||||
"lodash.union": "^4.6.0",
|
|
||||||
"normalize-path": "^3.0.0",
|
"normalize-path": "^3.0.0",
|
||||||
"readable-stream": "^2.0.0"
|
"readable-stream": "^4.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 6"
|
"node": ">= 14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/archiver-utils/node_modules/readable-stream": {
|
"node_modules/archiver-utils/node_modules/brace-expansion": {
|
||||||
"version": "2.3.8",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||||
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
|
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-util-is": "~1.0.0",
|
"balanced-match": "^1.0.0"
|
||||||
"inherits": "~2.0.3",
|
|
||||||
"isarray": "~1.0.0",
|
|
||||||
"process-nextick-args": "~2.0.0",
|
|
||||||
"safe-buffer": "~5.1.1",
|
|
||||||
"string_decoder": "~1.1.1",
|
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/archiver-utils/node_modules/safe-buffer": {
|
"node_modules/archiver-utils/node_modules/glob": {
|
||||||
"version": "5.1.2",
|
"version": "10.3.12",
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz",
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==",
|
||||||
},
|
|
||||||
"node_modules/archiver-utils/node_modules/string_decoder": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"safe-buffer": "~5.1.0"
|
"foreground-child": "^3.1.0",
|
||||||
|
"jackspeak": "^2.3.6",
|
||||||
|
"minimatch": "^9.0.1",
|
||||||
|
"minipass": "^7.0.4",
|
||||||
|
"path-scurry": "^1.10.2"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"glob": "dist/esm/bin.mjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.17"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/archiver-utils/node_modules/minimatch": {
|
||||||
|
"version": "9.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
|
||||||
|
"integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.17"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/async": {
|
"node_modules/async": {
|
||||||
@@ -560,11 +631,22 @@
|
|||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
},
|
},
|
||||||
|
"node_modules/b4a": {
|
||||||
|
"version": "1.6.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz",
|
||||||
|
"integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg=="
|
||||||
|
},
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/bare-events": {
|
||||||
|
"version": "2.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.2.2.tgz",
|
||||||
|
"integrity": "sha512-h7z00dWdG0PYOQEvChhOSWvOfkIKsdZGkWr083FgN/HyoQuebSew/cgirYqh9SCuy/hRvxc5Vy6Fw8xAmYHLkQ==",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"node_modules/base64-js": {
|
"node_modules/base64-js": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||||
@@ -601,16 +683,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/bl": {
|
|
||||||
"version": "4.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
|
|
||||||
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
|
|
||||||
"dependencies": {
|
|
||||||
"buffer": "^5.5.0",
|
|
||||||
"inherits": "^2.0.4",
|
|
||||||
"readable-stream": "^3.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/bottleneck": {
|
"node_modules/bottleneck": {
|
||||||
"version": "2.19.5",
|
"version": "2.19.5",
|
||||||
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
||||||
@@ -626,9 +698,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/buffer": {
|
"node_modules/buffer": {
|
||||||
"version": "5.7.1",
|
"version": "6.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
|
||||||
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
|
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -645,15 +717,15 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"base64-js": "^1.3.1",
|
"base64-js": "^1.3.1",
|
||||||
"ieee754": "^1.1.13"
|
"ieee754": "^1.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/buffer-crc32": {
|
"node_modules/buffer-crc32": {
|
||||||
"version": "0.2.13",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
|
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz",
|
||||||
"integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",
|
"integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": ">=8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/buffers": {
|
"node_modules/buffers": {
|
||||||
@@ -684,6 +756,22 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/color-convert": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"color-name": "~1.1.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/color-name": {
|
||||||
|
"version": "1.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||||
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||||
|
},
|
||||||
"node_modules/combined-stream": {
|
"node_modules/combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
@@ -704,17 +792,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/compress-commons": {
|
"node_modules/compress-commons": {
|
||||||
"version": "4.1.1",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz",
|
||||||
"integrity": "sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ==",
|
"integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"buffer-crc32": "^0.2.13",
|
"crc-32": "^1.2.0",
|
||||||
"crc32-stream": "^4.0.2",
|
"crc32-stream": "^6.0.0",
|
||||||
|
"is-stream": "^2.0.1",
|
||||||
"normalize-path": "^3.0.0",
|
"normalize-path": "^3.0.0",
|
||||||
"readable-stream": "^3.6.0"
|
"readable-stream": "^4.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/concat-map": {
|
"node_modules/concat-map": {
|
||||||
@@ -739,15 +828,28 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/crc32-stream": {
|
"node_modules/crc32-stream": {
|
||||||
"version": "4.0.2",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz",
|
||||||
"integrity": "sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w==",
|
"integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"crc-32": "^1.2.0",
|
"crc-32": "^1.2.0",
|
||||||
"readable-stream": "^3.4.0"
|
"readable-stream": "^4.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 14"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cross-spawn": {
|
||||||
|
"version": "7.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
|
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||||
|
"dependencies": {
|
||||||
|
"path-key": "^3.1.0",
|
||||||
|
"shebang-command": "^2.0.0",
|
||||||
|
"which": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/crypto": {
|
"node_modules/crypto": {
|
||||||
@@ -781,12 +883,22 @@
|
|||||||
"dot-object": "bin/dot-object"
|
"dot-object": "bin/dot-object"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/end-of-stream": {
|
"node_modules/eastasianwidth": {
|
||||||
"version": "1.4.4",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
|
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
|
||||||
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
|
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
|
||||||
"dependencies": {
|
},
|
||||||
"once": "^1.4.0"
|
"node_modules/emoji-regex": {
|
||||||
|
"version": "9.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
|
||||||
|
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
|
||||||
|
},
|
||||||
|
"node_modules/event-target-shim": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/events": {
|
"node_modules/events": {
|
||||||
@@ -797,6 +909,26 @@
|
|||||||
"node": ">=0.8.x"
|
"node": ">=0.8.x"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/fast-fifo": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
|
||||||
|
"integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ=="
|
||||||
|
},
|
||||||
|
"node_modules/foreground-child": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",
|
||||||
|
"dependencies": {
|
||||||
|
"cross-spawn": "^7.0.0",
|
||||||
|
"signal-exit": "^4.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/form-data": {
|
"node_modules/form-data": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||||
@@ -810,11 +942,6 @@
|
|||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fs-constants": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
|
|
||||||
},
|
|
||||||
"node_modules/fs.realpath": {
|
"node_modules/fs.realpath": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
@@ -898,6 +1025,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/is-fullwidth-code-point": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-plain-object": {
|
"node_modules/is-plain-object": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||||
@@ -906,11 +1041,44 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-stream": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/isarray": {
|
"node_modules/isarray": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||||
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
|
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/isexe": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
|
||||||
|
},
|
||||||
|
"node_modules/jackspeak": {
|
||||||
|
"version": "2.3.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz",
|
||||||
|
"integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@isaacs/cliui": "^8.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@pkgjs/parseargs": "^0.11.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/jsonc-parser": {
|
"node_modules/jsonc-parser": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
||||||
@@ -965,31 +1133,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
},
|
},
|
||||||
"node_modules/lodash.defaults": {
|
|
||||||
"version": "4.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
|
|
||||||
"integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ=="
|
|
||||||
},
|
|
||||||
"node_modules/lodash.difference": {
|
|
||||||
"version": "4.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
|
|
||||||
"integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA=="
|
|
||||||
},
|
|
||||||
"node_modules/lodash.flatten": {
|
|
||||||
"version": "4.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
|
|
||||||
"integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g=="
|
|
||||||
},
|
|
||||||
"node_modules/lodash.isplainobject": {
|
|
||||||
"version": "4.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
|
|
||||||
"integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA=="
|
|
||||||
},
|
|
||||||
"node_modules/lodash.union": {
|
|
||||||
"version": "4.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz",
|
|
||||||
"integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw=="
|
|
||||||
},
|
|
||||||
"node_modules/lower-case": {
|
"node_modules/lower-case": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
|
||||||
@@ -998,6 +1141,14 @@
|
|||||||
"tslib": "^2.0.3"
|
"tslib": "^2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/lru-cache": {
|
||||||
|
"version": "10.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz",
|
||||||
|
"integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==",
|
||||||
|
"engines": {
|
||||||
|
"node": "14 || >=16.14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/lunr": {
|
"node_modules/lunr": {
|
||||||
"version": "2.3.9",
|
"version": "2.3.9",
|
||||||
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
|
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
|
||||||
@@ -1054,6 +1205,14 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/minipass": {
|
||||||
|
"version": "7.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
|
||||||
|
"integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/mkdirp": {
|
"node_modules/mkdirp": {
|
||||||
"version": "0.5.6",
|
"version": "0.5.6",
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||||
@@ -1132,6 +1291,29 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/path-key": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-scurry": {
|
||||||
|
"version": "1.10.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz",
|
||||||
|
"integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==",
|
||||||
|
"dependencies": {
|
||||||
|
"lru-cache": "^10.2.0",
|
||||||
|
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.17"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/path-to-regexp": {
|
"node_modules/path-to-regexp": {
|
||||||
"version": "6.2.1",
|
"version": "6.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz",
|
||||||
@@ -1164,17 +1346,24 @@
|
|||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||||
},
|
},
|
||||||
|
"node_modules/queue-tick": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag=="
|
||||||
|
},
|
||||||
"node_modules/readable-stream": {
|
"node_modules/readable-stream": {
|
||||||
"version": "3.6.2",
|
"version": "4.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
|
||||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
"integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"inherits": "^2.0.3",
|
"abort-controller": "^3.0.0",
|
||||||
"string_decoder": "^1.1.1",
|
"buffer": "^6.0.3",
|
||||||
"util-deprecate": "^1.0.1"
|
"events": "^3.3.0",
|
||||||
|
"process": "^0.11.10",
|
||||||
|
"string_decoder": "^1.3.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 6"
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/readdir-glob": {
|
"node_modules/readdir-glob": {
|
||||||
@@ -1228,6 +1417,25 @@
|
|||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/shebang-command": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
||||||
|
"dependencies": {
|
||||||
|
"shebang-regex": "^3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/shebang-regex": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/shiki": {
|
"node_modules/shiki": {
|
||||||
"version": "0.14.5",
|
"version": "0.14.5",
|
||||||
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz",
|
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz",
|
||||||
@@ -1240,6 +1448,17 @@
|
|||||||
"vscode-textmate": "^8.0.0"
|
"vscode-textmate": "^8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/signal-exit": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/source-map": {
|
"node_modules/source-map": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
@@ -1249,6 +1468,18 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/streamx": {
|
||||||
|
"version": "2.16.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.1.tgz",
|
||||||
|
"integrity": "sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"fast-fifo": "^1.1.0",
|
||||||
|
"queue-tick": "^1.0.1"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"bare-events": "^2.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/string_decoder": {
|
"node_modules/string_decoder": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||||
@@ -1257,19 +1488,102 @@
|
|||||||
"safe-buffer": "~5.2.0"
|
"safe-buffer": "~5.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tar-stream": {
|
"node_modules/string-width": {
|
||||||
"version": "2.2.0",
|
"version": "5.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
|
||||||
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
|
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bl": "^4.0.3",
|
"eastasianwidth": "^0.2.0",
|
||||||
"end-of-stream": "^1.4.1",
|
"emoji-regex": "^9.2.2",
|
||||||
"fs-constants": "^1.0.0",
|
"strip-ansi": "^7.0.1"
|
||||||
"inherits": "^2.0.3",
|
|
||||||
"readable-stream": "^3.1.1"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/string-width-cjs": {
|
||||||
|
"name": "string-width",
|
||||||
|
"version": "4.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||||
|
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||||
|
"dependencies": {
|
||||||
|
"emoji-regex": "^8.0.0",
|
||||||
|
"is-fullwidth-code-point": "^3.0.0",
|
||||||
|
"strip-ansi": "^6.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/string-width-cjs/node_modules/ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/string-width-cjs/node_modules/emoji-regex": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
|
||||||
|
},
|
||||||
|
"node_modules/string-width-cjs/node_modules/strip-ansi": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/strip-ansi": {
|
||||||
|
"version": "7.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
|
||||||
|
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^6.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/strip-ansi-cjs": {
|
||||||
|
"name": "strip-ansi",
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tar-stream": {
|
||||||
|
"version": "3.1.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz",
|
||||||
|
"integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"b4a": "^1.6.4",
|
||||||
|
"fast-fifo": "^1.2.0",
|
||||||
|
"streamx": "^2.15.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tr46": {
|
"node_modules/tr46": {
|
||||||
@@ -1424,9 +1738,9 @@
|
|||||||
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
||||||
},
|
},
|
||||||
"node_modules/unzip-stream": {
|
"node_modules/unzip-stream": {
|
||||||
"version": "0.3.1",
|
"version": "0.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.4.tgz",
|
||||||
"integrity": "sha512-RzaGXLNt+CW+T41h1zl6pGz3EaeVhYlK+rdAap+7DxW5kqsqePO8kRtWPaCiVqdhZc86EctSPVYNix30YOMzmw==",
|
"integrity": "sha512-PyofABPVv+d7fL7GOpusx7eRT9YETY2X04PhwbSipdj6bMxVCFJrr+nm0Mxqbf9hUiTin/UsnuFWBXlDZFy0Cw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"binary": "^0.3.0",
|
"binary": "^0.3.0",
|
||||||
"mkdirp": "^0.5.1"
|
"mkdirp": "^0.5.1"
|
||||||
@@ -1471,12 +1785,110 @@
|
|||||||
"webidl-conversions": "^3.0.0"
|
"webidl-conversions": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/which": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||||
|
"dependencies": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"node-which": "bin/node-which"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/wordwrap": {
|
"node_modules/wordwrap": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/wrap-ansi": {
|
||||||
|
"version": "8.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
|
||||||
|
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^6.1.0",
|
||||||
|
"string-width": "^5.0.1",
|
||||||
|
"strip-ansi": "^7.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi-cjs": {
|
||||||
|
"name": "wrap-ansi",
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^4.0.0",
|
||||||
|
"string-width": "^4.1.0",
|
||||||
|
"strip-ansi": "^6.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi-cjs/node_modules/ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi-cjs/node_modules/ansi-styles": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||||
|
"dependencies": {
|
||||||
|
"color-convert": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi-cjs/node_modules/string-width": {
|
||||||
|
"version": "4.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||||
|
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||||
|
"dependencies": {
|
||||||
|
"emoji-regex": "^8.0.0",
|
||||||
|
"is-fullwidth-code-point": "^3.0.0",
|
||||||
|
"strip-ansi": "^6.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/wrappy": {
|
"node_modules/wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
@@ -1511,16 +1923,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/zip-stream": {
|
"node_modules/zip-stream": {
|
||||||
"version": "4.1.0",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz",
|
||||||
"integrity": "sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A==",
|
"integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"archiver-utils": "^2.1.0",
|
"archiver-utils": "^5.0.0",
|
||||||
"compress-commons": "^4.1.0",
|
"compress-commons": "^6.0.2",
|
||||||
"readable-stream": "^3.6.0"
|
"readable-stream": "^4.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.1.4",
|
"version": "2.1.9",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions artifact lib",
|
"description": "Actions artifact lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^3.0.9",
|
||||||
"@octokit/request-error": "^5.0.0",
|
"@octokit/request-error": "^5.0.0",
|
||||||
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^7.0.1",
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"twirp-ts": "^2.5.0",
|
"twirp-ts": "^2.5.0",
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import fs from 'fs/promises'
|
import fs from 'fs/promises'
|
||||||
import * as stream from 'stream'
|
|
||||||
import {createWriteStream} from 'fs'
|
|
||||||
import * as path from 'path'
|
|
||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as httpClient from '@actions/http-client'
|
import * as httpClient from '@actions/http-client'
|
||||||
@@ -47,11 +44,6 @@ async function streamExtract(url: string, directory: string): Promise<void> {
|
|||||||
await streamExtractExternal(url, directory)
|
await streamExtractExternal(url, directory)
|
||||||
return
|
return
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message.includes('Malformed extraction path')) {
|
|
||||||
throw new Error(
|
|
||||||
`Artifact download failed with unretryable error: ${error.message}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
retryCount++
|
retryCount++
|
||||||
core.debug(
|
core.debug(
|
||||||
`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`
|
`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`
|
||||||
@@ -86,8 +78,6 @@ export async function streamExtractExternal(
|
|||||||
}
|
}
|
||||||
const timer = setTimeout(timerFn, timeout)
|
const timer = setTimeout(timerFn, timeout)
|
||||||
|
|
||||||
const createdDirectories = new Set<string>()
|
|
||||||
createdDirectories.add(directory)
|
|
||||||
response.message
|
response.message
|
||||||
.on('data', () => {
|
.on('data', () => {
|
||||||
timer.refresh()
|
timer.refresh()
|
||||||
@@ -99,46 +89,8 @@ export async function streamExtractExternal(
|
|||||||
clearTimeout(timer)
|
clearTimeout(timer)
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
.pipe(unzip.Parse())
|
.pipe(unzip.Extract({path: directory}))
|
||||||
.pipe(
|
.on('close', () => {
|
||||||
new stream.Transform({
|
|
||||||
objectMode: true,
|
|
||||||
transform: async (entry, _, callback) => {
|
|
||||||
const fullPath = path.normalize(path.join(directory, entry.path))
|
|
||||||
if (!directory.endsWith(path.sep)) {
|
|
||||||
directory += path.sep
|
|
||||||
}
|
|
||||||
if (!fullPath.startsWith(directory)) {
|
|
||||||
reject(new Error(`Malformed extraction path: ${fullPath}`))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entry.type === 'Directory') {
|
|
||||||
if (!createdDirectories.has(fullPath)) {
|
|
||||||
createdDirectories.add(fullPath)
|
|
||||||
await resolveOrCreateDirectory(fullPath).then(() => {
|
|
||||||
entry.autodrain()
|
|
||||||
callback()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
entry.autodrain()
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
core.info(`Extracting artifact entry: ${fullPath}`)
|
|
||||||
if (!createdDirectories.has(path.dirname(fullPath))) {
|
|
||||||
createdDirectories.add(path.dirname(fullPath))
|
|
||||||
await resolveOrCreateDirectory(path.dirname(fullPath))
|
|
||||||
}
|
|
||||||
|
|
||||||
const writeStream = createWriteStream(fullPath)
|
|
||||||
writeStream.on('finish', callback)
|
|
||||||
writeStream.on('error', reject)
|
|
||||||
entry.pipe(writeStream)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.on('finish', async () => {
|
|
||||||
clearTimeout(timer)
|
clearTimeout(timer)
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ class ArtifactHttpClient implements Rpc {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof SyntaxError) {
|
if (error instanceof SyntaxError) {
|
||||||
debug(`Raw Body: ${rawBody}`)
|
debug(`Raw Body: ${rawBody}`)
|
||||||
throw error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error instanceof UsageError) {
|
if (error instanceof UsageError) {
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ export function isGhes(): boolean {
|
|||||||
|
|
||||||
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
||||||
const isGitHubHost = hostname === 'GITHUB.COM'
|
const isGitHubHost = hostname === 'GITHUB.COM'
|
||||||
const isGheHost =
|
const isGheHost = hostname.endsWith('.GHE.COM')
|
||||||
hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')
|
const isLocalHost = hostname.endsWith('.LOCALHOST')
|
||||||
|
|
||||||
return !isGitHubHost && !isGheHost
|
return !isGitHubHost && !isGheHost && !isLocalHost
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getGitHubWorkspaceDir(): string {
|
export function getGitHubWorkspaceDir(): string {
|
||||||
@@ -57,3 +57,7 @@ export function getConcurrency(): number {
|
|||||||
const concurrency = 16 * numCPUs
|
const concurrency = 16 * numCPUs
|
||||||
return concurrency > 300 ? 300 : concurrency
|
return concurrency > 300 ? 300 : concurrency
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getUploadChunkTimeout(): number {
|
||||||
|
return 300_000 // 5 minutes
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import {BlobClient, BlockBlobUploadStreamOptions} from '@azure/storage-blob'
|
import {BlobClient, BlockBlobUploadStreamOptions} from '@azure/storage-blob'
|
||||||
import {TransferProgressEvent} from '@azure/core-http'
|
import {TransferProgressEvent} from '@azure/core-http'
|
||||||
import {ZipUploadStream} from './zip'
|
import {ZipUploadStream} from './zip'
|
||||||
import {getUploadChunkSize, getConcurrency} from '../shared/config'
|
import {
|
||||||
|
getUploadChunkSize,
|
||||||
|
getConcurrency,
|
||||||
|
getUploadChunkTimeout
|
||||||
|
} from '../shared/config'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as crypto from 'crypto'
|
import * as crypto from 'crypto'
|
||||||
import * as stream from 'stream'
|
import * as stream from 'stream'
|
||||||
@@ -24,6 +28,22 @@ export async function uploadZipToBlobStorage(
|
|||||||
zipUploadStream: ZipUploadStream
|
zipUploadStream: ZipUploadStream
|
||||||
): Promise<BlobUploadResponse> {
|
): Promise<BlobUploadResponse> {
|
||||||
let uploadByteCount = 0
|
let uploadByteCount = 0
|
||||||
|
let lastProgressTime = Date.now()
|
||||||
|
const abortController = new AbortController()
|
||||||
|
|
||||||
|
const chunkTimer = async (interval: number): Promise<void> =>
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
if (Date.now() - lastProgressTime > interval) {
|
||||||
|
reject(new Error('Upload progress stalled.'))
|
||||||
|
}
|
||||||
|
}, interval)
|
||||||
|
|
||||||
|
abortController.signal.addEventListener('abort', () => {
|
||||||
|
clearInterval(timer)
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const maxConcurrency = getConcurrency()
|
const maxConcurrency = getConcurrency()
|
||||||
const bufferSize = getUploadChunkSize()
|
const bufferSize = getUploadChunkSize()
|
||||||
@@ -37,11 +57,13 @@ export async function uploadZipToBlobStorage(
|
|||||||
const uploadCallback = (progress: TransferProgressEvent): void => {
|
const uploadCallback = (progress: TransferProgressEvent): void => {
|
||||||
core.info(`Uploaded bytes ${progress.loadedBytes}`)
|
core.info(`Uploaded bytes ${progress.loadedBytes}`)
|
||||||
uploadByteCount = progress.loadedBytes
|
uploadByteCount = progress.loadedBytes
|
||||||
|
lastProgressTime = Date.now()
|
||||||
}
|
}
|
||||||
|
|
||||||
const options: BlockBlobUploadStreamOptions = {
|
const options: BlockBlobUploadStreamOptions = {
|
||||||
blobHTTPHeaders: {blobContentType: 'zip'},
|
blobHTTPHeaders: {blobContentType: 'zip'},
|
||||||
onProgress: uploadCallback
|
onProgress: uploadCallback,
|
||||||
|
abortSignal: abortController.signal
|
||||||
}
|
}
|
||||||
|
|
||||||
let sha256Hash: string | undefined = undefined
|
let sha256Hash: string | undefined = undefined
|
||||||
@@ -54,18 +76,22 @@ export async function uploadZipToBlobStorage(
|
|||||||
core.info('Beginning upload of artifact content to blob storage')
|
core.info('Beginning upload of artifact content to blob storage')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await blockBlobClient.uploadStream(
|
await Promise.race([
|
||||||
|
blockBlobClient.uploadStream(
|
||||||
uploadStream,
|
uploadStream,
|
||||||
bufferSize,
|
bufferSize,
|
||||||
maxConcurrency,
|
maxConcurrency,
|
||||||
options
|
options
|
||||||
)
|
),
|
||||||
|
chunkTimer(getUploadChunkTimeout())
|
||||||
|
])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (NetworkError.isNetworkErrorCode(error?.code)) {
|
if (NetworkError.isNetworkErrorCode(error?.code)) {
|
||||||
throw new NetworkError(error?.code)
|
throw new NetworkError(error?.code)
|
||||||
}
|
}
|
||||||
|
|
||||||
throw error
|
throw error
|
||||||
|
} finally {
|
||||||
|
abortController.abort()
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info('Finished uploading artifact content to blob storage!')
|
core.info('Finished uploading artifact content to blob storage!')
|
||||||
@@ -79,7 +105,6 @@ export async function uploadZipToBlobStorage(
|
|||||||
`No data was uploaded to blob storage. Reported upload byte count is 0.`
|
`No data was uploaded to blob storage. Reported upload byte count is 0.`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
uploadSize: uploadByteCount,
|
uploadSize: uploadByteCount,
|
||||||
sha256Hash
|
sha256Hash
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import * as stream from 'stream'
|
import * as stream from 'stream'
|
||||||
import * as archiver from 'archiver'
|
import * as archiver from 'archiver'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {createReadStream} from 'fs'
|
|
||||||
import {UploadZipSpecification} from './upload-zip-specification'
|
import {UploadZipSpecification} from './upload-zip-specification'
|
||||||
import {getUploadChunkSize} from '../shared/config'
|
import {getUploadChunkSize} from '../shared/config'
|
||||||
|
|
||||||
@@ -44,7 +43,7 @@ export async function createZipUploadStream(
|
|||||||
for (const file of uploadSpecification) {
|
for (const file of uploadSpecification) {
|
||||||
if (file.sourcePath !== null) {
|
if (file.sourcePath !== null) {
|
||||||
// Add a normal file to the zip
|
// Add a normal file to the zip
|
||||||
zip.append(createReadStream(file.sourcePath), {
|
zip.file(file.sourcePath, {
|
||||||
name: file.destinationPath
|
name: file.destinationPath
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ Once the attestation has been created and signed, it will be uploaded to the GH
|
|||||||
attestations API and associated with the repository from which the workflow was
|
attestations API and associated with the repository from which the workflow was
|
||||||
initiated.
|
initiated.
|
||||||
|
|
||||||
|
See [Using artifact attestations to establish provenance for builds](https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)
|
||||||
|
for more information on artifact attestations.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### `attest`
|
### `attest`
|
||||||
@@ -60,6 +63,8 @@ export type AttestOptions = {
|
|||||||
// Sigstore instance to use for signing. Must be one of "public-good" or
|
// Sigstore instance to use for signing. Must be one of "public-good" or
|
||||||
// "github".
|
// "github".
|
||||||
sigstore?: 'public-good' | 'github'
|
sigstore?: 'public-good' | 'github'
|
||||||
|
// HTTP headers to include in request to attestations API.
|
||||||
|
headers?: {[header: string]: string | number | undefined}
|
||||||
// Whether to skip writing the attestation to the GH attestations API.
|
// Whether to skip writing the attestation to the GH attestations API.
|
||||||
skipWrite?: boolean
|
skipWrite?: boolean
|
||||||
}
|
}
|
||||||
@@ -110,8 +115,14 @@ export type AttestProvenanceOptions = {
|
|||||||
// Sigstore instance to use for signing. Must be one of "public-good" or
|
// Sigstore instance to use for signing. Must be one of "public-good" or
|
||||||
// "github".
|
// "github".
|
||||||
sigstore?: 'public-good' | 'github'
|
sigstore?: 'public-good' | 'github'
|
||||||
|
// HTTP headers to include in request to attestations API.
|
||||||
|
headers?: {[header: string]: string | number | undefined}
|
||||||
// Whether to skip writing the attestation to the GH attestations API.
|
// Whether to skip writing the attestation to the GH attestations API.
|
||||||
skipWrite?: boolean
|
skipWrite?: boolean
|
||||||
|
// Issuer URL responsible for minting the OIDC token from which the
|
||||||
|
// provenance data is read. Defaults to
|
||||||
|
// 'https://token.actions.githubusercontent.com".
|
||||||
|
issuer?: string
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# @actions/attest Releases
|
# @actions/attest Releases
|
||||||
|
|
||||||
|
### 1.4.1
|
||||||
|
|
||||||
|
- Bump @actions/http-client from 2.2.1 to 2.2.3 [#1805](https://github.com/actions/toolkit/pull/1805)
|
||||||
|
|
||||||
|
### 1.4.0
|
||||||
|
|
||||||
|
- Add new `headers` parameter to the `attest` and `attestProvenance` functions [#1790](https://github.com/actions/toolkit/pull/1790)
|
||||||
|
- Update `buildSLSAProvenancePredicate`/`attestProvenance` to automatically derive default OIDC issuer URL from current execution context [#1796](https://github.com/actions/toolkit/pull/1796)
|
||||||
|
|
||||||
|
### 1.3.1
|
||||||
|
|
||||||
|
- Fix bug with proxy support when retrieving JWKS for OIDC issuer [#1776](https://github.com/actions/toolkit/pull/1776)
|
||||||
|
|
||||||
|
### 1.3.0
|
||||||
|
|
||||||
|
- Dynamic construction of Sigstore API URLs [#1735](https://github.com/actions/toolkit/pull/1735)
|
||||||
|
- Switch to new GH provenance build type [#1745](https://github.com/actions/toolkit/pull/1745)
|
||||||
|
- Fetch existing Rekor entry on 409 conflict error [#1759](https://github.com/actions/toolkit/pull/1759)
|
||||||
|
- Bump @sigstore/bundle from 2.3.0 to 2.3.2 [#1738](https://github.com/actions/toolkit/pull/1738)
|
||||||
|
- Bump @sigstore/sign from 2.3.0 to 2.3.2 [#1738](https://github.com/actions/toolkit/pull/1738)
|
||||||
|
|
||||||
|
### 1.2.1
|
||||||
|
|
||||||
|
- Retry request on attestation persistence failure [#1725](https://github.com/actions/toolkit/pull/1725)
|
||||||
|
|
||||||
|
### 1.2.0
|
||||||
|
|
||||||
|
- Generate attestations using the v0.3 Sigstore bundle format [#1701](https://github.com/actions/toolkit/pull/1701)
|
||||||
|
- Bump @sigstore/bundle from 2.2.0 to 2.3.0 [#1701](https://github.com/actions/toolkit/pull/1701)
|
||||||
|
- Bump @sigstore/sign from 2.2.3 to 2.3.0 [#1701](https://github.com/actions/toolkit/pull/1701)
|
||||||
|
- Remove dependency on make-fetch-happen [#1714](https://github.com/actions/toolkit/pull/1714)
|
||||||
|
|
||||||
|
### 1.1.0
|
||||||
|
|
||||||
|
- Updates the `attestProvenance` function to retrieve a token from the GitHub OIDC provider and use the token claims to populate the provenance statement [#1693](https://github.com/actions/toolkit/pull/1693)
|
||||||
|
|
||||||
### 1.0.0
|
### 1.0.0
|
||||||
|
|
||||||
- Initial release
|
- Initial release
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`buildIntotoStatement returns a provenance hydrated from env vars 1`] = `
|
exports[`buildIntotoStatement returns an intoto statement 1`] = `
|
||||||
{
|
{
|
||||||
"_type": "https://in-toto.io/Statement/v1",
|
"_type": "https://in-toto.io/Statement/v1",
|
||||||
"predicate": {
|
"predicate": {
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`buildSLSAProvenancePredicate returns a provenance hydrated from env vars 1`] = `
|
exports[`provenance functions buildSLSAProvenancePredicate returns a provenance hydrated from an OIDC token 1`] = `
|
||||||
{
|
{
|
||||||
"params": {
|
"params": {
|
||||||
"buildDefinition": {
|
"buildDefinition": {
|
||||||
"buildType": "https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1",
|
"buildType": "https://actions.github.io/buildtypes/workflow/v1",
|
||||||
"externalParameters": {
|
"externalParameters": {
|
||||||
"workflow": {
|
"workflow": {
|
||||||
"path": ".github/workflows/main.yml",
|
"path": ".github/workflows/main.yml",
|
||||||
"ref": "main",
|
"ref": "main",
|
||||||
"repository": "https://github.com/owner/repo",
|
"repository": "https://foo.ghe.com/owner/repo",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"internalParameters": {
|
"internalParameters": {
|
||||||
@@ -17,6 +17,7 @@ exports[`buildSLSAProvenancePredicate returns a provenance hydrated from env var
|
|||||||
"event_name": "push",
|
"event_name": "push",
|
||||||
"repository_id": "repo-id",
|
"repository_id": "repo-id",
|
||||||
"repository_owner_id": "owner-id",
|
"repository_owner_id": "owner-id",
|
||||||
|
"runner_environment": "github-hosted",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"resolvedDependencies": [
|
"resolvedDependencies": [
|
||||||
@@ -24,16 +25,16 @@ exports[`buildSLSAProvenancePredicate returns a provenance hydrated from env var
|
|||||||
"digest": {
|
"digest": {
|
||||||
"gitCommit": "babca52ab0c93ae16539e5923cb0d7403b9a093b",
|
"gitCommit": "babca52ab0c93ae16539e5923cb0d7403b9a093b",
|
||||||
},
|
},
|
||||||
"uri": "git+https://github.com/owner/repo@refs/heads/main",
|
"uri": "git+https://foo.ghe.com/owner/repo@refs/heads/main",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"runDetails": {
|
"runDetails": {
|
||||||
"builder": {
|
"builder": {
|
||||||
"id": "https://github.com/actions/runner/github-hosted",
|
"id": "https://foo.ghe.com/owner/workflows/.github/workflows/publish.yml@main",
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"invocationId": "https://github.com/owner/repo/actions/runs/run-id/attempts/run-attempt",
|
"invocationId": "https://foo.ghe.com/owner/repo/actions/runs/run-id/attempts/run-attempt",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import {signingEndpoints} from '../src/endpoints'
|
||||||
|
|
||||||
|
describe('signingEndpoints', () => {
|
||||||
|
const originalEnv = process.env
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
process.env = originalEnv
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when using github.com', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
process.env = {
|
||||||
|
...originalEnv,
|
||||||
|
GITHUB_SERVER_URL: 'https://github.com'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns expected endpoints', async () => {
|
||||||
|
const endpoints = signingEndpoints('github')
|
||||||
|
|
||||||
|
expect(endpoints.fulcioURL).toEqual('https://fulcio.githubapp.com')
|
||||||
|
expect(endpoints.tsaServerURL).toEqual('https://timestamp.githubapp.com')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when using custom domain', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
process.env = {
|
||||||
|
...originalEnv,
|
||||||
|
GITHUB_SERVER_URL: 'https://foo.bar.com'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns a expected endpoints', async () => {
|
||||||
|
const endpoints = signingEndpoints('github')
|
||||||
|
|
||||||
|
expect(endpoints.fulcioURL).toEqual('https://fulcio.foo.bar.com')
|
||||||
|
expect(endpoints.tsaServerURL).toEqual('https://timestamp.foo.bar.com')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -16,7 +16,7 @@ describe('buildIntotoStatement', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
it('returns a provenance hydrated from env vars', () => {
|
it('returns an intoto statement', () => {
|
||||||
const statement = buildIntotoStatement(subject, predicate)
|
const statement = buildIntotoStatement(subject, predicate)
|
||||||
expect(statement).toMatchSnapshot()
|
expect(statement).toMatchSnapshot()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
import * as jose from 'jose'
|
||||||
|
import nock from 'nock'
|
||||||
|
import {getIDTokenClaims} from '../src/oidc'
|
||||||
|
|
||||||
|
describe('getIDTokenClaims', () => {
|
||||||
|
const originalEnv = process.env
|
||||||
|
const issuer = 'https://example.com'
|
||||||
|
const audience = 'nobody'
|
||||||
|
const requestToken = 'token'
|
||||||
|
const openidConfigPath = '/.well-known/openid-configuration'
|
||||||
|
const jwksPath = '/.well-known/jwks.json'
|
||||||
|
const tokenPath = '/token'
|
||||||
|
const openIDConfig = {jwks_uri: `${issuer}${jwksPath}`}
|
||||||
|
|
||||||
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||||
|
let key: any
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
process.env = {
|
||||||
|
...originalEnv,
|
||||||
|
ACTIONS_ID_TOKEN_REQUEST_URL: `${issuer}${tokenPath}?`,
|
||||||
|
ACTIONS_ID_TOKEN_REQUEST_TOKEN: requestToken
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate JWT signing key
|
||||||
|
key = await jose.generateKeyPair('PS256')
|
||||||
|
|
||||||
|
// Create JWK and JWKS
|
||||||
|
const jwk = await jose.exportJWK(key.publicKey)
|
||||||
|
const jwks = {keys: [jwk]}
|
||||||
|
|
||||||
|
nock(issuer).get(openidConfigPath).reply(200, openIDConfig)
|
||||||
|
nock(issuer).get(jwksPath).reply(200, jwks)
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
process.env = originalEnv
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when ID token is valid', () => {
|
||||||
|
const claims = {
|
||||||
|
iss: issuer,
|
||||||
|
aud: audience,
|
||||||
|
ref: 'ref',
|
||||||
|
sha: 'sha',
|
||||||
|
repository: 'repo',
|
||||||
|
event_name: 'push',
|
||||||
|
job_workflow_ref: 'job_workflow_ref',
|
||||||
|
workflow_ref: 'workflow',
|
||||||
|
repository_id: '1',
|
||||||
|
repository_owner_id: '1',
|
||||||
|
runner_environment: 'github-hosted',
|
||||||
|
run_id: '1',
|
||||||
|
run_attempt: '1'
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const jwt = await new jose.SignJWT(claims)
|
||||||
|
.setProtectedHeader({alg: 'PS256'})
|
||||||
|
.sign(key.privateKey)
|
||||||
|
|
||||||
|
nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns the ID token claims', async () => {
|
||||||
|
const result = await getIDTokenClaims(issuer)
|
||||||
|
expect(result).toEqual(claims)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when ID token is missing required claims', () => {
|
||||||
|
const claims = {
|
||||||
|
iss: issuer,
|
||||||
|
aud: audience
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const jwt = await new jose.SignJWT(claims)
|
||||||
|
.setProtectedHeader({alg: 'PS256'})
|
||||||
|
.sign(key.privateKey)
|
||||||
|
|
||||||
|
nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('throws an error', async () => {
|
||||||
|
await expect(getIDTokenClaims(issuer)).rejects.toThrow(/missing claims/i)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when ID has the wrong issuer', () => {
|
||||||
|
const claims = {foo: 'bar', iss: 'foo', aud: 'nobody'}
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const jwt = await new jose.SignJWT(claims)
|
||||||
|
.setProtectedHeader({alg: 'PS256'})
|
||||||
|
.sign(key.privateKey)
|
||||||
|
|
||||||
|
nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('throws an error', async () => {
|
||||||
|
await expect(getIDTokenClaims(issuer)).rejects.toThrow(/unexpected "iss"/)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when ID has the wrong audience', () => {
|
||||||
|
const claims = {foo: 'bar', iss: issuer, aud: 'bar'}
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const jwt = await new jose.SignJWT(claims)
|
||||||
|
.setProtectedHeader({alg: 'PS256'})
|
||||||
|
.sign(key.privateKey)
|
||||||
|
|
||||||
|
nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('throw an error', async () => {
|
||||||
|
await expect(getIDTokenClaims(issuer)).rejects.toThrow(/unexpected "aud"/)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when openid config cannot be retrieved', () => {
|
||||||
|
const claims = {foo: 'bar', iss: issuer, aud: 'nobody'}
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const jwt = await new jose.SignJWT(claims)
|
||||||
|
.setProtectedHeader({alg: 'PS256'})
|
||||||
|
.sign(key.privateKey)
|
||||||
|
|
||||||
|
nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt})
|
||||||
|
|
||||||
|
// Disable the openid config endpoint
|
||||||
|
nock.removeInterceptor({
|
||||||
|
proto: 'https',
|
||||||
|
hostname: 'example.com',
|
||||||
|
port: '443',
|
||||||
|
method: 'GET',
|
||||||
|
path: openidConfigPath
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('throws an error', async () => {
|
||||||
|
await expect(getIDTokenClaims(issuer)).rejects.toThrow(
|
||||||
|
/failed to get id/i
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -1,36 +1,79 @@
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import {mockFulcio, mockRekor, mockTSA} from '@sigstore/mock'
|
import {mockFulcio, mockRekor, mockTSA} from '@sigstore/mock'
|
||||||
|
import * as jose from 'jose'
|
||||||
import nock from 'nock'
|
import nock from 'nock'
|
||||||
import {SIGSTORE_GITHUB, SIGSTORE_PUBLIC_GOOD} from '../src/endpoints'
|
import {MockAgent, setGlobalDispatcher} from 'undici'
|
||||||
|
import {SIGSTORE_PUBLIC_GOOD, signingEndpoints} from '../src/endpoints'
|
||||||
import {attestProvenance, buildSLSAProvenancePredicate} from '../src/provenance'
|
import {attestProvenance, buildSLSAProvenancePredicate} from '../src/provenance'
|
||||||
|
|
||||||
// Dummy workflow environment
|
describe('provenance functions', () => {
|
||||||
const env = {
|
const originalEnv = process.env
|
||||||
GITHUB_REPOSITORY: 'owner/repo',
|
const issuer = 'https://token.actions.foo.ghe.com'
|
||||||
GITHUB_REF: 'refs/heads/main',
|
const audience = 'nobody'
|
||||||
GITHUB_SHA: 'babca52ab0c93ae16539e5923cb0d7403b9a093b',
|
const jwksPath = '/.well-known/jwks.json'
|
||||||
GITHUB_WORKFLOW_REF: 'owner/repo/.github/workflows/main.yml@main',
|
const tokenPath = '/token'
|
||||||
GITHUB_SERVER_URL: 'https://github.com',
|
|
||||||
GITHUB_EVENT_NAME: 'push',
|
// MockAgent for mocking @actions/github
|
||||||
GITHUB_REPOSITORY_ID: 'repo-id',
|
const mockAgent = new MockAgent()
|
||||||
GITHUB_REPOSITORY_OWNER_ID: 'owner-id',
|
setGlobalDispatcher(mockAgent)
|
||||||
GITHUB_RUN_ID: 'run-id',
|
|
||||||
GITHUB_RUN_ATTEMPT: 'run-attempt',
|
const claims = {
|
||||||
RUNNER_ENVIRONMENT: 'github-hosted'
|
iss: issuer,
|
||||||
|
aud: 'nobody',
|
||||||
|
repository: 'owner/repo',
|
||||||
|
ref: 'refs/heads/main',
|
||||||
|
sha: 'babca52ab0c93ae16539e5923cb0d7403b9a093b',
|
||||||
|
job_workflow_ref: 'owner/workflows/.github/workflows/publish.yml@main',
|
||||||
|
workflow_ref: 'owner/repo/.github/workflows/main.yml@main',
|
||||||
|
event_name: 'push',
|
||||||
|
repository_id: 'repo-id',
|
||||||
|
repository_owner_id: 'owner-id',
|
||||||
|
run_id: 'run-id',
|
||||||
|
run_attempt: 'run-attempt',
|
||||||
|
runner_environment: 'github-hosted'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
process.env = {
|
||||||
|
...originalEnv,
|
||||||
|
ACTIONS_ID_TOKEN_REQUEST_URL: `${issuer}${tokenPath}?`,
|
||||||
|
ACTIONS_ID_TOKEN_REQUEST_TOKEN: 'token',
|
||||||
|
GITHUB_SERVER_URL: 'https://foo.ghe.com',
|
||||||
|
GITHUB_REPOSITORY: claims.repository
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate JWT signing key
|
||||||
|
const key = await jose.generateKeyPair('PS256')
|
||||||
|
|
||||||
|
// Create JWK, JWKS, and JWT
|
||||||
|
const jwk = await jose.exportJWK(key.publicKey)
|
||||||
|
const jwks = {keys: [jwk]}
|
||||||
|
const jwt = await new jose.SignJWT(claims)
|
||||||
|
.setProtectedHeader({alg: 'PS256'})
|
||||||
|
.sign(key.privateKey)
|
||||||
|
|
||||||
|
// Mock OpenID configuration and JWKS endpoints
|
||||||
|
nock(issuer)
|
||||||
|
.get('/.well-known/openid-configuration')
|
||||||
|
.reply(200, {jwks_uri: `${issuer}${jwksPath}`})
|
||||||
|
nock(issuer).get(jwksPath).reply(200, jwks)
|
||||||
|
|
||||||
|
// Mock OIDC token endpoint for populating the provenance
|
||||||
|
nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt})
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
process.env = originalEnv
|
||||||
|
})
|
||||||
|
|
||||||
describe('buildSLSAProvenancePredicate', () => {
|
describe('buildSLSAProvenancePredicate', () => {
|
||||||
it('returns a provenance hydrated from env vars', () => {
|
it('returns a provenance hydrated from an OIDC token', async () => {
|
||||||
const predicate = buildSLSAProvenancePredicate(env)
|
const predicate = await buildSLSAProvenancePredicate()
|
||||||
expect(predicate).toMatchSnapshot()
|
expect(predicate).toMatchSnapshot()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('attestProvenance', () => {
|
describe('attestProvenance', () => {
|
||||||
// Capture original environment variables so we can restore them after each
|
|
||||||
// test
|
|
||||||
const originalEnv = process.env
|
|
||||||
|
|
||||||
// Subject to attest
|
// Subject to attest
|
||||||
const subjectName = 'subjective'
|
const subjectName = 'subjective'
|
||||||
const subjectDigest = {
|
const subjectDigest = {
|
||||||
@@ -43,42 +86,29 @@ describe('attestProvenance', () => {
|
|||||||
'base64'
|
'base64'
|
||||||
)}.}`
|
)}.}`
|
||||||
|
|
||||||
const tokenURL = 'https://token.url'
|
|
||||||
const attestationID = '1234567890'
|
const attestationID = '1234567890'
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
jest.clearAllMocks()
|
nock(issuer)
|
||||||
|
.get(tokenPath)
|
||||||
nock(tokenURL)
|
|
||||||
.get('/')
|
|
||||||
.query({audience: 'sigstore'})
|
.query({audience: 'sigstore'})
|
||||||
.reply(200, {value: oidcToken})
|
.reply(200, {value: oidcToken})
|
||||||
|
|
||||||
// Set-up GHA environment variables
|
|
||||||
process.env = {
|
|
||||||
...originalEnv,
|
|
||||||
...env,
|
|
||||||
ACTIONS_ID_TOKEN_REQUEST_URL: tokenURL,
|
|
||||||
ACTIONS_ID_TOKEN_REQUEST_TOKEN: 'token'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
// Restore the original environment
|
|
||||||
process.env = originalEnv
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('when using the github Sigstore instance', () => {
|
describe('when using the github Sigstore instance', () => {
|
||||||
const {fulcioURL, tsaServerURL} = SIGSTORE_GITHUB
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
const {fulcioURL, tsaServerURL} = signingEndpoints('github')
|
||||||
|
|
||||||
// Mock Sigstore
|
// Mock Sigstore
|
||||||
await mockFulcio({baseURL: fulcioURL, strict: false})
|
await mockFulcio({baseURL: fulcioURL, strict: false})
|
||||||
await mockTSA({baseURL: tsaServerURL})
|
await mockTSA({baseURL: tsaServerURL})
|
||||||
|
|
||||||
// Mock GH attestations API
|
mockAgent
|
||||||
nock('https://api.github.com')
|
.get('https://api.github.com')
|
||||||
.post(/^\/repos\/.*\/.*\/attestations$/)
|
.intercept({
|
||||||
|
path: /^\/repos\/.*\/.*\/attestations$/,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
.reply(201, {id: attestationID})
|
.reply(201, {id: attestationID})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -136,8 +166,12 @@ describe('attestProvenance', () => {
|
|||||||
await mockRekor({baseURL: rekorURL})
|
await mockRekor({baseURL: rekorURL})
|
||||||
|
|
||||||
// Mock GH attestations API
|
// Mock GH attestations API
|
||||||
nock('https://api.github.com')
|
mockAgent
|
||||||
.post(/^\/repos\/.*\/.*\/attestations$/)
|
.get('https://api.github.com')
|
||||||
|
.intercept({
|
||||||
|
path: /^\/repos\/.*\/.*\/attestations$/,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
.reply(201, {id: attestationID})
|
.reply(201, {id: attestationID})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -211,3 +245,4 @@ describe('attestProvenance', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|||||||
@@ -64,13 +64,11 @@ describe('signProvenance', () => {
|
|||||||
|
|
||||||
expect(att).toBeDefined()
|
expect(att).toBeDefined()
|
||||||
expect(att.mediaType).toEqual(
|
expect(att.mediaType).toEqual(
|
||||||
'application/vnd.dev.sigstore.bundle+json;version=0.2'
|
'application/vnd.dev.sigstore.bundle.v0.3+json'
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(att.content.$case).toEqual('dsseEnvelope')
|
expect(att.content.$case).toEqual('dsseEnvelope')
|
||||||
expect(att.verificationMaterial.content.$case).toEqual(
|
expect(att.verificationMaterial.content.$case).toEqual('certificate')
|
||||||
'x509CertificateChain'
|
|
||||||
)
|
|
||||||
expect(att.verificationMaterial.tlogEntries).toHaveLength(1)
|
expect(att.verificationMaterial.tlogEntries).toHaveLength(1)
|
||||||
expect(
|
expect(
|
||||||
att.verificationMaterial.timestampVerificationData?.rfc3161Timestamps
|
att.verificationMaterial.timestampVerificationData?.rfc3161Timestamps
|
||||||
@@ -89,13 +87,11 @@ describe('signProvenance', () => {
|
|||||||
|
|
||||||
expect(att).toBeDefined()
|
expect(att).toBeDefined()
|
||||||
expect(att.mediaType).toEqual(
|
expect(att.mediaType).toEqual(
|
||||||
'application/vnd.dev.sigstore.bundle+json;version=0.2'
|
'application/vnd.dev.sigstore.bundle.v0.3+json'
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(att.content.$case).toEqual('dsseEnvelope')
|
expect(att.content.$case).toEqual('dsseEnvelope')
|
||||||
expect(att.verificationMaterial.content.$case).toEqual(
|
expect(att.verificationMaterial.content.$case).toEqual('certificate')
|
||||||
'x509CertificateChain'
|
|
||||||
)
|
|
||||||
expect(att.verificationMaterial.tlogEntries).toHaveLength(0)
|
expect(att.verificationMaterial.tlogEntries).toHaveLength(0)
|
||||||
expect(
|
expect(
|
||||||
att.verificationMaterial.timestampVerificationData?.rfc3161Timestamps
|
att.verificationMaterial.timestampVerificationData?.rfc3161Timestamps
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
import nock from 'nock'
|
import {MockAgent, setGlobalDispatcher} from 'undici'
|
||||||
import {writeAttestation} from '../src/store'
|
import {writeAttestation} from '../src/store'
|
||||||
|
|
||||||
describe('writeAttestation', () => {
|
describe('writeAttestation', () => {
|
||||||
const originalEnv = process.env
|
const originalEnv = process.env
|
||||||
const attestation = {foo: 'bar '}
|
const attestation = {foo: 'bar '}
|
||||||
const token = 'token'
|
const token = 'token'
|
||||||
|
const headers = {'X-GitHub-Foo': 'true'}
|
||||||
|
|
||||||
|
const mockAgent = new MockAgent()
|
||||||
|
setGlobalDispatcher(mockAgent)
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
process.env = {
|
process.env = {
|
||||||
@@ -19,27 +23,71 @@ describe('writeAttestation', () => {
|
|||||||
|
|
||||||
describe('when the api call is successful', () => {
|
describe('when the api call is successful', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
nock('https://api.github.com')
|
mockAgent
|
||||||
.matchHeader('authorization', `token ${token}`)
|
.get('https://api.github.com')
|
||||||
.post('/repos/foo/bar/attestations', {bundle: attestation})
|
.intercept({
|
||||||
|
path: '/repos/foo/bar/attestations',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {authorization: `token ${token}`, ...headers},
|
||||||
|
body: JSON.stringify({bundle: attestation})
|
||||||
|
})
|
||||||
.reply(201, {id: '123'})
|
.reply(201, {id: '123'})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('persists the attestation', async () => {
|
||||||
|
await expect(
|
||||||
|
writeAttestation(attestation, token, {headers})
|
||||||
|
).resolves.toEqual('123')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when the api call fails', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
mockAgent
|
||||||
|
.get('https://api.github.com')
|
||||||
|
.intercept({
|
||||||
|
path: '/repos/foo/bar/attestations',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {authorization: `token ${token}`},
|
||||||
|
body: JSON.stringify({bundle: attestation})
|
||||||
|
})
|
||||||
|
.reply(500, 'oops')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('throws an error', async () => {
|
||||||
|
await expect(
|
||||||
|
writeAttestation(attestation, token, {retry: 0})
|
||||||
|
).rejects.toThrow(/oops/)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when the api call fails but succeeds on retry', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
const pool = mockAgent.get('https://api.github.com')
|
||||||
|
|
||||||
|
pool
|
||||||
|
.intercept({
|
||||||
|
path: '/repos/foo/bar/attestations',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {authorization: `token ${token}`},
|
||||||
|
body: JSON.stringify({bundle: attestation})
|
||||||
|
})
|
||||||
|
.reply(500, 'oops')
|
||||||
|
.times(1)
|
||||||
|
|
||||||
|
pool
|
||||||
|
.intercept({
|
||||||
|
path: '/repos/foo/bar/attestations',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {authorization: `token ${token}`},
|
||||||
|
body: JSON.stringify({bundle: attestation})
|
||||||
|
})
|
||||||
|
.reply(201, {id: '123'})
|
||||||
|
.times(1)
|
||||||
|
})
|
||||||
|
|
||||||
it('persists the attestation', async () => {
|
it('persists the attestation', async () => {
|
||||||
await expect(writeAttestation(attestation, token)).resolves.toEqual('123')
|
await expect(writeAttestation(attestation, token)).resolves.toEqual('123')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('when the api call fails', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
nock('https://api.github.com')
|
|
||||||
.matchHeader('authorization', `token ${token}`)
|
|
||||||
.post('/repos/foo/bar/attestations', {bundle: attestation})
|
|
||||||
.reply(500, 'oops')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('persists the attestation', async () => {
|
|
||||||
await expect(writeAttestation(attestation, token)).rejects.toThrow(/oops/)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|||||||
Generated
+497
-432
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/attest",
|
"name": "@actions/attest",
|
||||||
"version": "1.0.0",
|
"version": "1.4.1",
|
||||||
"description": "Actions attestation lib",
|
"description": "Actions attestation lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
@@ -35,15 +35,24 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sigstore/mock": "^0.6.5",
|
"@sigstore/mock": "^0.7.4",
|
||||||
"@sigstore/rekor-types": "^2.0.0",
|
"@sigstore/rekor-types": "^2.0.0",
|
||||||
"@types/make-fetch-happen": "^10.0.4",
|
"@types/jsonwebtoken": "^9.0.6",
|
||||||
"nock": "^13.5.1"
|
"nock": "^13.5.1",
|
||||||
|
"undici": "^5.28.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@actions/core": "^1.10.1",
|
||||||
"@actions/github": "^6.0.0",
|
"@actions/github": "^6.0.0",
|
||||||
"@sigstore/bundle": "^2.2.0",
|
"@actions/http-client": "^2.2.3",
|
||||||
"@sigstore/sign": "^2.2.3",
|
"@octokit/plugin-retry": "^6.0.1",
|
||||||
"make-fetch-happen": "^13.0.0"
|
"@sigstore/bundle": "^2.3.2",
|
||||||
|
"@sigstore/sign": "^2.3.2",
|
||||||
|
"jose": "^5.2.3"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"@octokit/plugin-retry": {
|
||||||
|
"@octokit/core": "^5.2.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import {Bundle, bundleToJSON} from '@sigstore/bundle'
|
import {bundleToJSON} from '@sigstore/bundle'
|
||||||
import {X509Certificate} from 'crypto'
|
import {X509Certificate} from 'crypto'
|
||||||
import {SigstoreInstance, signingEndpoints} from './endpoints'
|
import {SigstoreInstance, signingEndpoints} from './endpoints'
|
||||||
import {buildIntotoStatement} from './intoto'
|
import {buildIntotoStatement} from './intoto'
|
||||||
import {Payload, signPayload} from './sign'
|
import {Payload, signPayload} from './sign'
|
||||||
import {writeAttestation} from './store'
|
import {writeAttestation} from './store'
|
||||||
|
|
||||||
|
import type {Bundle} from '@sigstore/sign'
|
||||||
import type {Attestation, Predicate, Subject} from './shared.types'
|
import type {Attestation, Predicate, Subject} from './shared.types'
|
||||||
|
|
||||||
const INTOTO_PAYLOAD_TYPE = 'application/vnd.in-toto+json'
|
const INTOTO_PAYLOAD_TYPE = 'application/vnd.in-toto+json'
|
||||||
@@ -27,6 +28,8 @@ export type AttestOptions = {
|
|||||||
// Sigstore instance to use for signing. Must be one of "public-good" or
|
// Sigstore instance to use for signing. Must be one of "public-good" or
|
||||||
// "github".
|
// "github".
|
||||||
sigstore?: SigstoreInstance
|
sigstore?: SigstoreInstance
|
||||||
|
// HTTP headers to include in request to attestations API.
|
||||||
|
headers?: {[header: string]: string | number | undefined}
|
||||||
// Whether to skip writing the attestation to the GH attestations API.
|
// Whether to skip writing the attestation to the GH attestations API.
|
||||||
skipWrite?: boolean
|
skipWrite?: boolean
|
||||||
}
|
}
|
||||||
@@ -60,7 +63,11 @@ export async function attest(options: AttestOptions): Promise<Attestation> {
|
|||||||
// Store the attestation
|
// Store the attestation
|
||||||
let attestationID: string | undefined
|
let attestationID: string | undefined
|
||||||
if (options.skipWrite !== true) {
|
if (options.skipWrite !== true) {
|
||||||
attestationID = await writeAttestation(bundleToJSON(bundle), options.token)
|
attestationID = await writeAttestation(
|
||||||
|
bundleToJSON(bundle),
|
||||||
|
options.token,
|
||||||
|
{headers: options.headers}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return toAttestation(bundle, attestationID)
|
return toAttestation(bundle, attestationID)
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ const GITHUB_ID = 'github'
|
|||||||
const FULCIO_PUBLIC_GOOD_URL = 'https://fulcio.sigstore.dev'
|
const FULCIO_PUBLIC_GOOD_URL = 'https://fulcio.sigstore.dev'
|
||||||
const REKOR_PUBLIC_GOOD_URL = 'https://rekor.sigstore.dev'
|
const REKOR_PUBLIC_GOOD_URL = 'https://rekor.sigstore.dev'
|
||||||
|
|
||||||
const FULCIO_INTERNAL_URL = 'https://fulcio.githubapp.com'
|
|
||||||
const TSA_INTERNAL_URL = 'https://timestamp.githubapp.com'
|
|
||||||
|
|
||||||
export type SigstoreInstance = typeof PUBLIC_GOOD_ID | typeof GITHUB_ID
|
export type SigstoreInstance = typeof PUBLIC_GOOD_ID | typeof GITHUB_ID
|
||||||
|
|
||||||
export type Endpoints = {
|
export type Endpoints = {
|
||||||
@@ -22,11 +19,6 @@ export const SIGSTORE_PUBLIC_GOOD: Endpoints = {
|
|||||||
rekorURL: REKOR_PUBLIC_GOOD_URL
|
rekorURL: REKOR_PUBLIC_GOOD_URL
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SIGSTORE_GITHUB: Endpoints = {
|
|
||||||
fulcioURL: FULCIO_INTERNAL_URL,
|
|
||||||
tsaServerURL: TSA_INTERNAL_URL
|
|
||||||
}
|
|
||||||
|
|
||||||
export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => {
|
export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => {
|
||||||
let instance: SigstoreInstance
|
let instance: SigstoreInstance
|
||||||
|
|
||||||
@@ -45,6 +37,19 @@ export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => {
|
|||||||
case PUBLIC_GOOD_ID:
|
case PUBLIC_GOOD_ID:
|
||||||
return SIGSTORE_PUBLIC_GOOD
|
return SIGSTORE_PUBLIC_GOOD
|
||||||
case GITHUB_ID:
|
case GITHUB_ID:
|
||||||
return SIGSTORE_GITHUB
|
return buildGitHubEndpoints()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildGitHubEndpoints(): Endpoints {
|
||||||
|
const serverURL = process.env.GITHUB_SERVER_URL || 'https://github.com'
|
||||||
|
let host = new URL(serverURL).hostname
|
||||||
|
|
||||||
|
if (host === 'github.com') {
|
||||||
|
host = 'githubapp.com'
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
fulcioURL: `https://fulcio.${host}`,
|
||||||
|
tsaServerURL: `https://timestamp.${host}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,108 @@
|
|||||||
|
import {getIDToken} from '@actions/core'
|
||||||
|
import {HttpClient} from '@actions/http-client'
|
||||||
|
import * as jose from 'jose'
|
||||||
|
|
||||||
|
const OIDC_AUDIENCE = 'nobody'
|
||||||
|
|
||||||
|
const VALID_SERVER_URLS = [
|
||||||
|
'https://github.com',
|
||||||
|
new RegExp('^https://[a-z0-9-]+\\.ghe\\.com$')
|
||||||
|
] as const
|
||||||
|
|
||||||
|
const REQUIRED_CLAIMS = [
|
||||||
|
'iss',
|
||||||
|
'ref',
|
||||||
|
'sha',
|
||||||
|
'repository',
|
||||||
|
'event_name',
|
||||||
|
'job_workflow_ref',
|
||||||
|
'workflow_ref',
|
||||||
|
'repository_id',
|
||||||
|
'repository_owner_id',
|
||||||
|
'runner_environment',
|
||||||
|
'run_id',
|
||||||
|
'run_attempt'
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export type ClaimSet = {[K in (typeof REQUIRED_CLAIMS)[number]]: string}
|
||||||
|
|
||||||
|
type OIDCConfig = {
|
||||||
|
jwks_uri: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getIDTokenClaims = async (issuer?: string): Promise<ClaimSet> => {
|
||||||
|
issuer = issuer || getIssuer()
|
||||||
|
try {
|
||||||
|
const token = await getIDToken(OIDC_AUDIENCE)
|
||||||
|
const claims = await decodeOIDCToken(token, issuer)
|
||||||
|
assertClaimSet(claims)
|
||||||
|
return claims
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`Failed to get ID token: ${error.message}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const decodeOIDCToken = async (
|
||||||
|
token: string,
|
||||||
|
issuer: string
|
||||||
|
): Promise<jose.JWTPayload> => {
|
||||||
|
// Verify and decode token
|
||||||
|
const jwks = jose.createLocalJWKSet(await getJWKS(issuer))
|
||||||
|
const {payload} = await jose.jwtVerify(token, jwks, {
|
||||||
|
audience: OIDC_AUDIENCE,
|
||||||
|
issuer
|
||||||
|
})
|
||||||
|
|
||||||
|
return payload
|
||||||
|
}
|
||||||
|
|
||||||
|
const getJWKS = async (issuer: string): Promise<jose.JSONWebKeySet> => {
|
||||||
|
const client = new HttpClient('@actions/attest')
|
||||||
|
const config = await client.getJson<OIDCConfig>(
|
||||||
|
`${issuer}/.well-known/openid-configuration`
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!config.result) {
|
||||||
|
throw new Error('No OpenID configuration found')
|
||||||
|
}
|
||||||
|
|
||||||
|
const jwks = await client.getJson<jose.JSONWebKeySet>(config.result.jwks_uri)
|
||||||
|
|
||||||
|
if (!jwks.result) {
|
||||||
|
throw new Error('No JWKS found for issuer')
|
||||||
|
}
|
||||||
|
|
||||||
|
return jwks.result
|
||||||
|
}
|
||||||
|
|
||||||
|
function assertClaimSet(claims: jose.JWTPayload): asserts claims is ClaimSet {
|
||||||
|
const missingClaims: string[] = []
|
||||||
|
|
||||||
|
for (const claim of REQUIRED_CLAIMS) {
|
||||||
|
if (!(claim in claims)) {
|
||||||
|
missingClaims.push(claim)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missingClaims.length > 0) {
|
||||||
|
throw new Error(`Missing claims: ${missingClaims.join(', ')}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Derive the current OIDC issuer based on the server URL
|
||||||
|
function getIssuer(): string {
|
||||||
|
const serverURL = process.env.GITHUB_SERVER_URL || 'https://github.com'
|
||||||
|
|
||||||
|
// Ensure the server URL is a valid GitHub server URL
|
||||||
|
if (!VALID_SERVER_URLS.some(valid_url => serverURL.match(valid_url))) {
|
||||||
|
throw new Error(`Invalid server URL: ${serverURL}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
let host = new URL(serverURL).hostname
|
||||||
|
|
||||||
|
if (host === 'github.com') {
|
||||||
|
host = 'githubusercontent.com'
|
||||||
|
}
|
||||||
|
|
||||||
|
return `https://token.actions.${host}`
|
||||||
|
}
|
||||||
@@ -1,36 +1,37 @@
|
|||||||
import {attest, AttestOptions} from './attest'
|
import {attest, AttestOptions} from './attest'
|
||||||
|
import {getIDTokenClaims} from './oidc'
|
||||||
import type {Attestation, Predicate} from './shared.types'
|
import type {Attestation, Predicate} from './shared.types'
|
||||||
|
|
||||||
const SLSA_PREDICATE_V1_TYPE = 'https://slsa.dev/provenance/v1'
|
const SLSA_PREDICATE_V1_TYPE = 'https://slsa.dev/provenance/v1'
|
||||||
|
const GITHUB_BUILD_TYPE = 'https://actions.github.io/buildtypes/workflow/v1'
|
||||||
const GITHUB_BUILDER_ID_PREFIX = 'https://github.com/actions/runner'
|
|
||||||
const GITHUB_BUILD_TYPE =
|
|
||||||
'https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1'
|
|
||||||
|
|
||||||
export type AttestProvenanceOptions = Omit<
|
export type AttestProvenanceOptions = Omit<
|
||||||
AttestOptions,
|
AttestOptions,
|
||||||
'predicate' | 'predicateType'
|
'predicate' | 'predicateType'
|
||||||
>
|
> & {
|
||||||
|
issuer?: string
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds an SLSA (Supply Chain Levels for Software Artifacts) provenance
|
* Builds an SLSA (Supply Chain Levels for Software Artifacts) provenance
|
||||||
* predicate using the GitHub Actions Workflow build type.
|
* predicate using the GitHub Actions Workflow build type.
|
||||||
* https://slsa.dev/spec/v1.0/provenance
|
* https://slsa.dev/spec/v1.0/provenance
|
||||||
* https://github.com/slsa-framework/github-actions-buildtypes/tree/main/workflow/v1
|
* https://github.com/slsa-framework/github-actions-buildtypes/tree/main/workflow/v1
|
||||||
* @param env - The Node.js process environment variables. Defaults to
|
* @param issuer - URL for the OIDC issuer. Defaults to the GitHub Actions token
|
||||||
* `process.env`.
|
* issuer.
|
||||||
* @returns The SLSA provenance predicate.
|
* @returns The SLSA provenance predicate.
|
||||||
*/
|
*/
|
||||||
export const buildSLSAProvenancePredicate = (
|
export const buildSLSAProvenancePredicate = async (
|
||||||
env: NodeJS.ProcessEnv = process.env
|
issuer?: string
|
||||||
): Predicate => {
|
): Promise<Predicate> => {
|
||||||
const workflow = env.GITHUB_WORKFLOW_REF || ''
|
const serverURL = process.env.GITHUB_SERVER_URL
|
||||||
|
const claims = await getIDTokenClaims(issuer)
|
||||||
|
|
||||||
// Split just the path and ref from the workflow string.
|
// Split just the path and ref from the workflow string.
|
||||||
// owner/repo/.github/workflows/main.yml@main =>
|
// owner/repo/.github/workflows/main.yml@main =>
|
||||||
// .github/workflows/main.yml, main
|
// .github/workflows/main.yml, main
|
||||||
const [workflowPath, workflowRef] = workflow
|
const [workflowPath, workflowRef] = claims.workflow_ref
|
||||||
.replace(`${env.GITHUB_REPOSITORY}/`, '')
|
.replace(`${claims.repository}/`, '')
|
||||||
.split('@')
|
.split('@')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -41,32 +42,33 @@ export const buildSLSAProvenancePredicate = (
|
|||||||
externalParameters: {
|
externalParameters: {
|
||||||
workflow: {
|
workflow: {
|
||||||
ref: workflowRef,
|
ref: workflowRef,
|
||||||
repository: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}`,
|
repository: `${serverURL}/${claims.repository}`,
|
||||||
path: workflowPath
|
path: workflowPath
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
internalParameters: {
|
internalParameters: {
|
||||||
github: {
|
github: {
|
||||||
event_name: env.GITHUB_EVENT_NAME,
|
event_name: claims.event_name,
|
||||||
repository_id: env.GITHUB_REPOSITORY_ID,
|
repository_id: claims.repository_id,
|
||||||
repository_owner_id: env.GITHUB_REPOSITORY_OWNER_ID
|
repository_owner_id: claims.repository_owner_id,
|
||||||
|
runner_environment: claims.runner_environment
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resolvedDependencies: [
|
resolvedDependencies: [
|
||||||
{
|
{
|
||||||
uri: `git+${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}@${env.GITHUB_REF}`,
|
uri: `git+${serverURL}/${claims.repository}@${claims.ref}`,
|
||||||
digest: {
|
digest: {
|
||||||
gitCommit: env.GITHUB_SHA
|
gitCommit: claims.sha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
runDetails: {
|
runDetails: {
|
||||||
builder: {
|
builder: {
|
||||||
id: `${GITHUB_BUILDER_ID_PREFIX}/${env.RUNNER_ENVIRONMENT}`
|
id: `${serverURL}/${claims.job_workflow_ref}`
|
||||||
},
|
},
|
||||||
metadata: {
|
metadata: {
|
||||||
invocationId: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}/attempts/${env.GITHUB_RUN_ATTEMPT}`
|
invocationId: `${serverURL}/${claims.repository}/actions/runs/${claims.run_id}/attempts/${claims.run_attempt}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,7 +86,7 @@ export const buildSLSAProvenancePredicate = (
|
|||||||
export async function attestProvenance(
|
export async function attestProvenance(
|
||||||
options: AttestProvenanceOptions
|
options: AttestProvenanceOptions
|
||||||
): Promise<Attestation> {
|
): Promise<Attestation> {
|
||||||
const predicate = buildSLSAProvenancePredicate(process.env)
|
const predicate = await buildSLSAProvenancePredicate(options.issuer)
|
||||||
return attest({
|
return attest({
|
||||||
...options,
|
...options,
|
||||||
predicateType: predicate.type,
|
predicateType: predicate.type,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Bundle} from '@sigstore/bundle'
|
|
||||||
import {
|
import {
|
||||||
|
Bundle,
|
||||||
BundleBuilder,
|
BundleBuilder,
|
||||||
CIContextProvider,
|
CIContextProvider,
|
||||||
DSSEBundleBuilder,
|
DSSEBundleBuilder,
|
||||||
@@ -87,6 +87,7 @@ const initBundleBuilder = (opts: SignOptions): BundleBuilder => {
|
|||||||
new RekorWitness({
|
new RekorWitness({
|
||||||
rekorBaseURL: opts.rekorURL,
|
rekorBaseURL: opts.rekorURL,
|
||||||
entryType: 'dsse',
|
entryType: 'dsse',
|
||||||
|
fetchOnConflict: true,
|
||||||
timeout,
|
timeout,
|
||||||
retry
|
retry
|
||||||
})
|
})
|
||||||
@@ -103,5 +104,7 @@ const initBundleBuilder = (opts: SignOptions): BundleBuilder => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DSSEBundleBuilder({signer, witnesses})
|
// Build the bundle with the singleCertificate option which will
|
||||||
|
// trigger the creation of v0.3 DSSE bundles
|
||||||
|
return new DSSEBundleBuilder({signer, witnesses, singleCertificate: true})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import fetch from 'make-fetch-happen'
|
import {retry} from '@octokit/plugin-retry'
|
||||||
|
import {RequestHeaders} from '@octokit/types'
|
||||||
|
|
||||||
const CREATE_ATTESTATION_REQUEST = 'POST /repos/{owner}/{repo}/attestations'
|
const CREATE_ATTESTATION_REQUEST = 'POST /repos/{owner}/{repo}/attestations'
|
||||||
|
const DEFAULT_RETRY_COUNT = 5
|
||||||
|
|
||||||
|
export type WriteOptions = {
|
||||||
|
retry?: number
|
||||||
|
headers?: RequestHeaders
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Writes an attestation to the repository's attestations endpoint.
|
* Writes an attestation to the repository's attestations endpoint.
|
||||||
* @param attestation - The attestation to write.
|
* @param attestation - The attestation to write.
|
||||||
@@ -12,18 +18,25 @@ const CREATE_ATTESTATION_REQUEST = 'POST /repos/{owner}/{repo}/attestations'
|
|||||||
*/
|
*/
|
||||||
export const writeAttestation = async (
|
export const writeAttestation = async (
|
||||||
attestation: unknown,
|
attestation: unknown,
|
||||||
token: string
|
token: string,
|
||||||
|
options: WriteOptions = {}
|
||||||
): Promise<string> => {
|
): Promise<string> => {
|
||||||
const octokit = github.getOctokit(token, {request: {fetch}})
|
const retries = options.retry ?? DEFAULT_RETRY_COUNT
|
||||||
|
const octokit = github.getOctokit(token, {retry: {retries}}, retry)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await octokit.request(CREATE_ATTESTATION_REQUEST, {
|
const response = await octokit.request(CREATE_ATTESTATION_REQUEST, {
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
|
headers: options.headers,
|
||||||
data: {bundle: attestation}
|
data: {bundle: attestation}
|
||||||
})
|
})
|
||||||
|
|
||||||
return response.data?.id
|
const data =
|
||||||
|
typeof response.data == 'string'
|
||||||
|
? JSON.parse(response.data)
|
||||||
|
: response.data
|
||||||
|
return data?.id
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const message = err instanceof Error ? err.message : err
|
const message = err instanceof Error ? err.message : err
|
||||||
throw new Error(`Failed to persist attestation: ${message}`)
|
throw new Error(`Failed to persist attestation: ${message}`)
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ import {DownloadOptions, getDownloadOptions} from '../src/options'
|
|||||||
|
|
||||||
jest.mock('../src/internal/downloadUtils')
|
jest.mock('../src/internal/downloadUtils')
|
||||||
|
|
||||||
|
test('getCacheVersion does not mutate arguments', async () => {
|
||||||
|
const paths = ['node_modules']
|
||||||
|
getCacheVersion(paths, undefined, true)
|
||||||
|
expect(paths).toEqual(['node_modules'])
|
||||||
|
})
|
||||||
|
|
||||||
test('getCacheVersion with one path returns version', async () => {
|
test('getCacheVersion with one path returns version', async () => {
|
||||||
const paths = ['node_modules']
|
const paths = ['node_modules']
|
||||||
const result = getCacheVersion(paths, undefined, true)
|
const result = getCacheVersion(paths, undefined, true)
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# @actions/glob Releases
|
# @actions/glob Releases
|
||||||
|
|
||||||
|
### 0.5.0
|
||||||
|
- Added `excludeHiddenFiles` option, which is disabled by default to preserve existing behavior [#1791: Add glob option to ignore hidden files](https://github.com/actions/toolkit/pull/1791)
|
||||||
|
|
||||||
### 0.4.0
|
### 0.4.0
|
||||||
- Pass in the current workspace as a parameter to HashFiles [#1318](https://github.com/actions/toolkit/pull/1318)
|
- Pass in the current workspace as a parameter to HashFiles [#1318](https://github.com/actions/toolkit/pull/1318)
|
||||||
|
|
||||||
|
|||||||
@@ -708,7 +708,7 @@ describe('globber', () => {
|
|||||||
expect(itemPaths).toEqual([])
|
expect(itemPaths).toEqual([])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns hidden files', async () => {
|
it('returns hidden files by default', async () => {
|
||||||
// Create the following layout:
|
// Create the following layout:
|
||||||
// <root>
|
// <root>
|
||||||
// <root>/.emptyFolder
|
// <root>/.emptyFolder
|
||||||
@@ -734,6 +734,26 @@ describe('globber', () => {
|
|||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('ignores hidden files when excludeHiddenFiles is set', async () => {
|
||||||
|
// Create the following layout:
|
||||||
|
// <root>
|
||||||
|
// <root>/.emptyFolder
|
||||||
|
// <root>/.file
|
||||||
|
// <root>/.folder
|
||||||
|
// <root>/.folder/file
|
||||||
|
const root = path.join(getTestTemp(), 'ignores-hidden-files')
|
||||||
|
await createHiddenDirectory(path.join(root, '.emptyFolder'))
|
||||||
|
await createHiddenDirectory(path.join(root, '.folder'))
|
||||||
|
await createHiddenFile(path.join(root, '.file'), 'test .file content')
|
||||||
|
await fs.writeFile(
|
||||||
|
path.join(root, '.folder', 'file'),
|
||||||
|
'test .folder/file content'
|
||||||
|
)
|
||||||
|
|
||||||
|
const itemPaths = await glob(root, {excludeHiddenFiles: true})
|
||||||
|
expect(itemPaths).toEqual([root])
|
||||||
|
})
|
||||||
|
|
||||||
it('returns normalized paths', async () => {
|
it('returns normalized paths', async () => {
|
||||||
// Create the following layout:
|
// Create the following layout:
|
||||||
// <root>/hello/world.txt
|
// <root>/hello/world.txt
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/glob",
|
"name": "@actions/glob",
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"description": "Actions glob lib",
|
"description": "Actions glob lib",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/glob",
|
"name": "@actions/glob",
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions glob lib",
|
"description": "Actions glob lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ export function getOptions(copy?: GlobOptions): GlobOptions {
|
|||||||
followSymbolicLinks: true,
|
followSymbolicLinks: true,
|
||||||
implicitDescendants: true,
|
implicitDescendants: true,
|
||||||
matchDirectories: true,
|
matchDirectories: true,
|
||||||
omitBrokenSymbolicLinks: true
|
omitBrokenSymbolicLinks: true,
|
||||||
|
excludeHiddenFiles: false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copy) {
|
if (copy) {
|
||||||
@@ -32,6 +33,11 @@ export function getOptions(copy?: GlobOptions): GlobOptions {
|
|||||||
result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks
|
result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks
|
||||||
core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`)
|
core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof copy.excludeHiddenFiles === 'boolean') {
|
||||||
|
result.excludeHiddenFiles = copy.excludeHiddenFiles
|
||||||
|
core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -36,4 +36,13 @@ export interface GlobOptions {
|
|||||||
* @default true
|
* @default true
|
||||||
*/
|
*/
|
||||||
omitBrokenSymbolicLinks?: boolean
|
omitBrokenSymbolicLinks?: boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether to exclude hidden files (files and directories starting with a `.`).
|
||||||
|
* This does not apply to Windows files and directories with the hidden attribute unless
|
||||||
|
* they are also prefixed with a `.`.
|
||||||
|
*
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
excludeHiddenFiles?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,6 +128,11 @@ export class DefaultGlobber implements Globber {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hidden file or directory?
|
||||||
|
if (options.excludeHiddenFiles && path.basename(item.path).match(/^\./)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Directory
|
// Directory
|
||||||
if (stats.isDirectory()) {
|
if (stats.isDirectory()) {
|
||||||
// Matched
|
// Matched
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
## Releases
|
## Releases
|
||||||
|
|
||||||
|
## 2.2.3
|
||||||
|
- Fixed an issue where proxy username and password were not handled correctly [#1799](https://github.com/actions/toolkit/pull/1799)
|
||||||
|
|
||||||
|
## 2.2.2
|
||||||
|
- Better handling of url encoded usernames and passwords in proxy config [#1782](https://github.com/actions/toolkit/pull/1782)
|
||||||
|
|
||||||
|
## 2.2.1
|
||||||
|
- Make sure RequestOptions.keepAlive is applied properly on node20 runtime [#1572](https://github.com/actions/toolkit/pull/1572)
|
||||||
|
|
||||||
## 2.2.0
|
## 2.2.0
|
||||||
- Add function to return proxy agent dispatcher for compatibility with latest octokit packages [#1547](https://github.com/actions/toolkit/pull/1547)
|
- Add function to return proxy agent dispatcher for compatibility with latest octokit packages [#1547](https://github.com/actions/toolkit/pull/1547)
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ describe('basics', () => {
|
|||||||
// "user-agent": "typed-test-client-tests"
|
// "user-agent": "typed-test-client-tests"
|
||||||
// },
|
// },
|
||||||
// "origin": "173.95.152.44",
|
// "origin": "173.95.152.44",
|
||||||
// "url": "https://postman-echo.com/get"
|
// "url": "http://postman-echo.com/get"
|
||||||
// }
|
// }
|
||||||
|
|
||||||
it('does basic http get request', async () => {
|
it('does basic http get request', async () => {
|
||||||
@@ -63,16 +63,17 @@ describe('basics', () => {
|
|||||||
expect(obj.headers['user-agent']).toBeFalsy()
|
expect(obj.headers['user-agent']).toBeFalsy()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/* TODO write a mock rather then relying on a third party
|
||||||
it('does basic https get request', async () => {
|
it('does basic https get request', async () => {
|
||||||
const res: httpm.HttpClientResponse = await _http.get(
|
const res: httpm.HttpClientResponse = await _http.get(
|
||||||
'https://postman-echo.com/get'
|
'http://postman-echo.com/get'
|
||||||
)
|
)
|
||||||
expect(res.message.statusCode).toBe(200)
|
expect(res.message.statusCode).toBe(200)
|
||||||
const body: string = await res.readBody()
|
const body: string = await res.readBody()
|
||||||
const obj = JSON.parse(body)
|
const obj = JSON.parse(body)
|
||||||
expect(obj.url).toBe('https://postman-echo.com/get')
|
expect(obj.url).toBe('http://postman-echo.com/get')
|
||||||
})
|
})
|
||||||
|
*/
|
||||||
it('does basic http get request with default headers', async () => {
|
it('does basic http get request with default headers', async () => {
|
||||||
const http: httpm.HttpClient = new httpm.HttpClient(
|
const http: httpm.HttpClient = new httpm.HttpClient(
|
||||||
'http-client-tests',
|
'http-client-tests',
|
||||||
@@ -125,12 +126,12 @@ describe('basics', () => {
|
|||||||
it('pipes a get request', async () => {
|
it('pipes a get request', async () => {
|
||||||
return new Promise<void>(async resolve => {
|
return new Promise<void>(async resolve => {
|
||||||
const file = fs.createWriteStream(sampleFilePath)
|
const file = fs.createWriteStream(sampleFilePath)
|
||||||
;(await _http.get('https://postman-echo.com/get')).message
|
;(await _http.get('http://postman-echo.com/get')).message
|
||||||
.pipe(file)
|
.pipe(file)
|
||||||
.on('close', () => {
|
.on('close', () => {
|
||||||
const body: string = fs.readFileSync(sampleFilePath).toString()
|
const body: string = fs.readFileSync(sampleFilePath).toString()
|
||||||
const obj = JSON.parse(body)
|
const obj = JSON.parse(body)
|
||||||
expect(obj.url).toBe('https://postman-echo.com/get')
|
expect(obj.url).toBe('http://postman-echo.com/get')
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -138,32 +139,32 @@ describe('basics', () => {
|
|||||||
|
|
||||||
it('does basic get request with redirects', async () => {
|
it('does basic get request with redirects', async () => {
|
||||||
const res: httpm.HttpClientResponse = await _http.get(
|
const res: httpm.HttpClientResponse = await _http.get(
|
||||||
`https://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
`http://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
||||||
'https://postman-echo.com/get'
|
'http://postman-echo.com/get'
|
||||||
)}`
|
)}`
|
||||||
)
|
)
|
||||||
expect(res.message.statusCode).toBe(200)
|
expect(res.message.statusCode).toBe(200)
|
||||||
const body: string = await res.readBody()
|
const body: string = await res.readBody()
|
||||||
const obj = JSON.parse(body)
|
const obj = JSON.parse(body)
|
||||||
expect(obj.url).toBe('https://postman-echo.com/get')
|
expect(obj.url).toBe('http://postman-echo.com/get')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('does basic get request with redirects (303)', async () => {
|
it('does basic get request with redirects (303)', async () => {
|
||||||
const res: httpm.HttpClientResponse = await _http.get(
|
const res: httpm.HttpClientResponse = await _http.get(
|
||||||
`https://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
`http://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
||||||
'https://postman-echo.com/get'
|
'http://postman-echo.com/get'
|
||||||
)}&status_code=303`
|
)}&status_code=303`
|
||||||
)
|
)
|
||||||
expect(res.message.statusCode).toBe(200)
|
expect(res.message.statusCode).toBe(200)
|
||||||
const body: string = await res.readBody()
|
const body: string = await res.readBody()
|
||||||
const obj = JSON.parse(body)
|
const obj = JSON.parse(body)
|
||||||
expect(obj.url).toBe('https://postman-echo.com/get')
|
expect(obj.url).toBe('http://postman-echo.com/get')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns 404 for not found get request on redirect', async () => {
|
it('returns 404 for not found get request on redirect', async () => {
|
||||||
const res: httpm.HttpClientResponse = await _http.get(
|
const res: httpm.HttpClientResponse = await _http.get(
|
||||||
`https://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
`http://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
||||||
'https://postman-echo.com/status/404'
|
'http://postman-echo.com/status/404'
|
||||||
)}&status_code=303`
|
)}&status_code=303`
|
||||||
)
|
)
|
||||||
expect(res.message.statusCode).toBe(404)
|
expect(res.message.statusCode).toBe(404)
|
||||||
@@ -177,8 +178,8 @@ describe('basics', () => {
|
|||||||
{allowRedirects: false}
|
{allowRedirects: false}
|
||||||
)
|
)
|
||||||
const res: httpm.HttpClientResponse = await http.get(
|
const res: httpm.HttpClientResponse = await http.get(
|
||||||
`https://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
`http://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
||||||
'https://postman-echo.com/get'
|
'http://postman-echo.com/get'
|
||||||
)}`
|
)}`
|
||||||
)
|
)
|
||||||
expect(res.message.statusCode).toBe(302)
|
expect(res.message.statusCode).toBe(302)
|
||||||
@@ -191,8 +192,8 @@ describe('basics', () => {
|
|||||||
authorization: 'shhh'
|
authorization: 'shhh'
|
||||||
}
|
}
|
||||||
const res: httpm.HttpClientResponse = await _http.get(
|
const res: httpm.HttpClientResponse = await _http.get(
|
||||||
`https://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
`http://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
||||||
'https://www.postman-echo.com/get'
|
'http://www.postman-echo.com/get'
|
||||||
)}`,
|
)}`,
|
||||||
headers
|
headers
|
||||||
)
|
)
|
||||||
@@ -204,7 +205,7 @@ describe('basics', () => {
|
|||||||
expect(obj.headers[httpm.Headers.Accept]).toBe('application/json')
|
expect(obj.headers[httpm.Headers.Accept]).toBe('application/json')
|
||||||
expect(obj.headers['Authorization']).toBeUndefined()
|
expect(obj.headers['Authorization']).toBeUndefined()
|
||||||
expect(obj.headers['authorization']).toBeUndefined()
|
expect(obj.headers['authorization']).toBeUndefined()
|
||||||
expect(obj.url).toBe('https://www.postman-echo.com/get')
|
expect(obj.url).toBe('http://www.postman-echo.com/get')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('does not pass Auth with diff hostname redirects', async () => {
|
it('does not pass Auth with diff hostname redirects', async () => {
|
||||||
@@ -213,8 +214,8 @@ describe('basics', () => {
|
|||||||
Authorization: 'shhh'
|
Authorization: 'shhh'
|
||||||
}
|
}
|
||||||
const res: httpm.HttpClientResponse = await _http.get(
|
const res: httpm.HttpClientResponse = await _http.get(
|
||||||
`https://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
`http://postman-echo.com/redirect-to?url=${encodeURIComponent(
|
||||||
'https://www.postman-echo.com/get'
|
'http://www.postman-echo.com/get'
|
||||||
)}`,
|
)}`,
|
||||||
headers
|
headers
|
||||||
)
|
)
|
||||||
@@ -226,7 +227,7 @@ describe('basics', () => {
|
|||||||
expect(obj.headers[httpm.Headers.Accept]).toBe('application/json')
|
expect(obj.headers[httpm.Headers.Accept]).toBe('application/json')
|
||||||
expect(obj.headers['Authorization']).toBeUndefined()
|
expect(obj.headers['Authorization']).toBeUndefined()
|
||||||
expect(obj.headers['authorization']).toBeUndefined()
|
expect(obj.headers['authorization']).toBeUndefined()
|
||||||
expect(obj.url).toBe('https://www.postman-echo.com/get')
|
expect(obj.url).toBe('http://www.postman-echo.com/get')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('does basic head request', async () => {
|
it('does basic head request', async () => {
|
||||||
@@ -289,11 +290,11 @@ describe('basics', () => {
|
|||||||
|
|
||||||
it('gets a json object', async () => {
|
it('gets a json object', async () => {
|
||||||
const jsonObj = await _http.getJson<HttpBinData>(
|
const jsonObj = await _http.getJson<HttpBinData>(
|
||||||
'https://postman-echo.com/get'
|
'http://postman-echo.com/get'
|
||||||
)
|
)
|
||||||
expect(jsonObj.statusCode).toBe(200)
|
expect(jsonObj.statusCode).toBe(200)
|
||||||
expect(jsonObj.result).toBeDefined()
|
expect(jsonObj.result).toBeDefined()
|
||||||
expect(jsonObj.result?.url).toBe('https://postman-echo.com/get')
|
expect(jsonObj.result?.url).toBe('http://postman-echo.com/get')
|
||||||
expect(jsonObj.result?.headers[httpm.Headers.Accept]).toBe(
|
expect(jsonObj.result?.headers[httpm.Headers.Accept]).toBe(
|
||||||
httpm.MediaTypes.ApplicationJson
|
httpm.MediaTypes.ApplicationJson
|
||||||
)
|
)
|
||||||
@@ -304,7 +305,7 @@ describe('basics', () => {
|
|||||||
|
|
||||||
it('getting a non existent json object returns null', async () => {
|
it('getting a non existent json object returns null', async () => {
|
||||||
const jsonObj = await _http.getJson<HttpBinData>(
|
const jsonObj = await _http.getJson<HttpBinData>(
|
||||||
'https://postman-echo.com/status/404'
|
'http://postman-echo.com/status/404'
|
||||||
)
|
)
|
||||||
expect(jsonObj.statusCode).toBe(404)
|
expect(jsonObj.statusCode).toBe(404)
|
||||||
expect(jsonObj.result).toBeNull()
|
expect(jsonObj.result).toBeNull()
|
||||||
@@ -313,12 +314,12 @@ describe('basics', () => {
|
|||||||
it('posts a json object', async () => {
|
it('posts a json object', async () => {
|
||||||
const res = {name: 'foo'}
|
const res = {name: 'foo'}
|
||||||
const restRes = await _http.postJson<HttpBinData>(
|
const restRes = await _http.postJson<HttpBinData>(
|
||||||
'https://postman-echo.com/post',
|
'http://postman-echo.com/post',
|
||||||
res
|
res
|
||||||
)
|
)
|
||||||
expect(restRes.statusCode).toBe(200)
|
expect(restRes.statusCode).toBe(200)
|
||||||
expect(restRes.result).toBeDefined()
|
expect(restRes.result).toBeDefined()
|
||||||
expect(restRes.result?.url).toBe('https://postman-echo.com/post')
|
expect(restRes.result?.url).toBe('http://postman-echo.com/post')
|
||||||
expect(restRes.result?.json.name).toBe('foo')
|
expect(restRes.result?.json.name).toBe('foo')
|
||||||
expect(restRes.result?.headers[httpm.Headers.Accept]).toBe(
|
expect(restRes.result?.headers[httpm.Headers.Accept]).toBe(
|
||||||
httpm.MediaTypes.ApplicationJson
|
httpm.MediaTypes.ApplicationJson
|
||||||
@@ -334,12 +335,12 @@ describe('basics', () => {
|
|||||||
it('puts a json object', async () => {
|
it('puts a json object', async () => {
|
||||||
const res = {name: 'foo'}
|
const res = {name: 'foo'}
|
||||||
const restRes = await _http.putJson<HttpBinData>(
|
const restRes = await _http.putJson<HttpBinData>(
|
||||||
'https://postman-echo.com/put',
|
'http://postman-echo.com/put',
|
||||||
res
|
res
|
||||||
)
|
)
|
||||||
expect(restRes.statusCode).toBe(200)
|
expect(restRes.statusCode).toBe(200)
|
||||||
expect(restRes.result).toBeDefined()
|
expect(restRes.result).toBeDefined()
|
||||||
expect(restRes.result?.url).toBe('https://postman-echo.com/put')
|
expect(restRes.result?.url).toBe('http://postman-echo.com/put')
|
||||||
expect(restRes.result?.json.name).toBe('foo')
|
expect(restRes.result?.json.name).toBe('foo')
|
||||||
|
|
||||||
expect(restRes.result?.headers[httpm.Headers.Accept]).toBe(
|
expect(restRes.result?.headers[httpm.Headers.Accept]).toBe(
|
||||||
@@ -356,12 +357,12 @@ describe('basics', () => {
|
|||||||
it('patch a json object', async () => {
|
it('patch a json object', async () => {
|
||||||
const res = {name: 'foo'}
|
const res = {name: 'foo'}
|
||||||
const restRes = await _http.patchJson<HttpBinData>(
|
const restRes = await _http.patchJson<HttpBinData>(
|
||||||
'https://postman-echo.com/patch',
|
'http://postman-echo.com/patch',
|
||||||
res
|
res
|
||||||
)
|
)
|
||||||
expect(restRes.statusCode).toBe(200)
|
expect(restRes.statusCode).toBe(200)
|
||||||
expect(restRes.result).toBeDefined()
|
expect(restRes.result).toBeDefined()
|
||||||
expect(restRes.result?.url).toBe('https://postman-echo.com/patch')
|
expect(restRes.result?.url).toBe('http://postman-echo.com/patch')
|
||||||
expect(restRes.result?.json.name).toBe('foo')
|
expect(restRes.result?.json.name).toBe('foo')
|
||||||
expect(restRes.result?.headers[httpm.Headers.Accept]).toBe(
|
expect(restRes.result?.headers[httpm.Headers.Accept]).toBe(
|
||||||
httpm.MediaTypes.ApplicationJson
|
httpm.MediaTypes.ApplicationJson
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ describe('headers', () => {
|
|||||||
it('preserves existing headers on getJson', async () => {
|
it('preserves existing headers on getJson', async () => {
|
||||||
const additionalHeaders = {[httpm.Headers.Accept]: 'foo'}
|
const additionalHeaders = {[httpm.Headers.Accept]: 'foo'}
|
||||||
let jsonObj = await _http.getJson<any>(
|
let jsonObj = await _http.getJson<any>(
|
||||||
'https://postman-echo.com/get',
|
'http://postman-echo.com/get',
|
||||||
additionalHeaders
|
additionalHeaders
|
||||||
)
|
)
|
||||||
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('foo')
|
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('foo')
|
||||||
@@ -26,7 +26,7 @@ describe('headers', () => {
|
|||||||
[httpm.Headers.Accept]: 'baz'
|
[httpm.Headers.Accept]: 'baz'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jsonObj = await httpWithHeaders.getJson<any>('https://postman-echo.com/get')
|
jsonObj = await httpWithHeaders.getJson<any>('http://postman-echo.com/get')
|
||||||
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('baz')
|
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('baz')
|
||||||
expect(jsonObj.headers[httpm.Headers.ContentType]).toContain(
|
expect(jsonObj.headers[httpm.Headers.ContentType]).toContain(
|
||||||
httpm.MediaTypes.ApplicationJson
|
httpm.MediaTypes.ApplicationJson
|
||||||
@@ -36,7 +36,7 @@ describe('headers', () => {
|
|||||||
it('preserves existing headers on postJson', async () => {
|
it('preserves existing headers on postJson', async () => {
|
||||||
const additionalHeaders = {[httpm.Headers.Accept]: 'foo'}
|
const additionalHeaders = {[httpm.Headers.Accept]: 'foo'}
|
||||||
let jsonObj = await _http.postJson<any>(
|
let jsonObj = await _http.postJson<any>(
|
||||||
'https://postman-echo.com/post',
|
'http://postman-echo.com/post',
|
||||||
{},
|
{},
|
||||||
additionalHeaders
|
additionalHeaders
|
||||||
)
|
)
|
||||||
@@ -52,7 +52,7 @@ describe('headers', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
jsonObj = await httpWithHeaders.postJson<any>(
|
jsonObj = await httpWithHeaders.postJson<any>(
|
||||||
'https://postman-echo.com/post',
|
'http://postman-echo.com/post',
|
||||||
{}
|
{}
|
||||||
)
|
)
|
||||||
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('baz')
|
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('baz')
|
||||||
@@ -64,7 +64,7 @@ describe('headers', () => {
|
|||||||
it('preserves existing headers on putJson', async () => {
|
it('preserves existing headers on putJson', async () => {
|
||||||
const additionalHeaders = {[httpm.Headers.Accept]: 'foo'}
|
const additionalHeaders = {[httpm.Headers.Accept]: 'foo'}
|
||||||
let jsonObj = await _http.putJson<any>(
|
let jsonObj = await _http.putJson<any>(
|
||||||
'https://postman-echo.com/put',
|
'http://postman-echo.com/put',
|
||||||
{},
|
{},
|
||||||
additionalHeaders
|
additionalHeaders
|
||||||
)
|
)
|
||||||
@@ -80,7 +80,7 @@ describe('headers', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
jsonObj = await httpWithHeaders.putJson<any>(
|
jsonObj = await httpWithHeaders.putJson<any>(
|
||||||
'https://postman-echo.com/put',
|
'http://postman-echo.com/put',
|
||||||
{}
|
{}
|
||||||
)
|
)
|
||||||
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('baz')
|
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('baz')
|
||||||
@@ -92,7 +92,7 @@ describe('headers', () => {
|
|||||||
it('preserves existing headers on patchJson', async () => {
|
it('preserves existing headers on patchJson', async () => {
|
||||||
const additionalHeaders = {[httpm.Headers.Accept]: 'foo'}
|
const additionalHeaders = {[httpm.Headers.Accept]: 'foo'}
|
||||||
let jsonObj = await _http.patchJson<any>(
|
let jsonObj = await _http.patchJson<any>(
|
||||||
'https://postman-echo.com/patch',
|
'http://postman-echo.com/patch',
|
||||||
{},
|
{},
|
||||||
additionalHeaders
|
additionalHeaders
|
||||||
)
|
)
|
||||||
@@ -108,7 +108,7 @@ describe('headers', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
jsonObj = await httpWithHeaders.patchJson<any>(
|
jsonObj = await httpWithHeaders.patchJson<any>(
|
||||||
'https://postman-echo.com/patch',
|
'http://postman-echo.com/patch',
|
||||||
{}
|
{}
|
||||||
)
|
)
|
||||||
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('baz')
|
expect(jsonObj.result.headers[httpm.Headers.Accept]).toBe('baz')
|
||||||
|
|||||||
@@ -222,30 +222,33 @@ describe('proxy', () => {
|
|||||||
expect(_proxyConnects).toHaveLength(0)
|
expect(_proxyConnects).toHaveLength(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// TODO mock this out so we don't rely on a third party
|
||||||
|
/*
|
||||||
it('HttpClient does basic https get request through proxy', async () => {
|
it('HttpClient does basic https get request through proxy', async () => {
|
||||||
process.env['https_proxy'] = _proxyUrl
|
process.env['https_proxy'] = _proxyUrl
|
||||||
const httpClient = new httpm.HttpClient()
|
const httpClient = new httpm.HttpClient()
|
||||||
const res: httpm.HttpClientResponse = await httpClient.get(
|
const res: httpm.HttpClientResponse = await httpClient.get(
|
||||||
'https://postman-echo.com/get'
|
'http://postman-echo.com/get'
|
||||||
)
|
)
|
||||||
expect(res.message.statusCode).toBe(200)
|
expect(res.message.statusCode).toBe(200)
|
||||||
const body: string = await res.readBody()
|
const body: string = await res.readBody()
|
||||||
const obj = JSON.parse(body)
|
const obj = JSON.parse(body)
|
||||||
expect(obj.url).toBe('https://postman-echo.com/get')
|
expect(obj.url).toBe('http://postman-echo.com/get')
|
||||||
expect(_proxyConnects).toEqual(['postman-echo.com:443'])
|
expect(_proxyConnects).toEqual(['postman-echo.com:443'])
|
||||||
})
|
})
|
||||||
|
*/
|
||||||
|
|
||||||
it('HttpClient does basic https get request when bypass proxy', async () => {
|
it('HttpClient does basic http get request when bypass proxy', async () => {
|
||||||
process.env['https_proxy'] = _proxyUrl
|
process.env['http_proxy'] = _proxyUrl
|
||||||
process.env['no_proxy'] = 'postman-echo.com'
|
process.env['no_proxy'] = 'postman-echo.com'
|
||||||
const httpClient = new httpm.HttpClient()
|
const httpClient = new httpm.HttpClient()
|
||||||
const res: httpm.HttpClientResponse = await httpClient.get(
|
const res: httpm.HttpClientResponse = await httpClient.get(
|
||||||
'https://postman-echo.com/get'
|
'http://postman-echo.com/get'
|
||||||
)
|
)
|
||||||
expect(res.message.statusCode).toBe(200)
|
expect(res.message.statusCode).toBe(200)
|
||||||
const body: string = await res.readBody()
|
const body: string = await res.readBody()
|
||||||
const obj = JSON.parse(body)
|
const obj = JSON.parse(body)
|
||||||
expect(obj.url).toBe('https://postman-echo.com/get')
|
expect(obj.url).toBe('http://postman-echo.com/get')
|
||||||
expect(_proxyConnects).toHaveLength(0)
|
expect(_proxyConnects).toHaveLength(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -304,6 +307,18 @@ describe('proxy', () => {
|
|||||||
console.log(agent)
|
console.log(agent)
|
||||||
expect(agent instanceof ProxyAgent).toBe(true)
|
expect(agent instanceof ProxyAgent).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('proxyAuth is set in tunnel agent when authentication is provided with URIencoding', async () => {
|
||||||
|
process.env['https_proxy'] =
|
||||||
|
'http://user%40github.com:p%[email protected]:8080'
|
||||||
|
const httpClient = new httpm.HttpClient()
|
||||||
|
const agent: any = httpClient.getAgent('https://some-url')
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(agent)
|
||||||
|
expect(agent.proxyOptions.host).toBe('127.0.0.1')
|
||||||
|
expect(agent.proxyOptions.port).toBe('8080')
|
||||||
|
expect(agent.proxyOptions.proxyAuth).toBe('[email protected]:p@ssword')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
function _clearVars(): void {
|
function _clearVars(): void {
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.2.0",
|
"version": "2.2.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6",
|
"tunnel": "^0.0.6",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.2.0",
|
"version": "2.2.3",
|
||||||
"description": "Actions Http Client",
|
"description": "Actions Http Client",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
|
|||||||
@@ -726,7 +726,9 @@ export class HttpClient {
|
|||||||
uri: proxyUrl.href,
|
uri: proxyUrl.href,
|
||||||
pipelining: !this._keepAlive ? 0 : 1,
|
pipelining: !this._keepAlive ? 0 : 1,
|
||||||
...((proxyUrl.username || proxyUrl.password) && {
|
...((proxyUrl.username || proxyUrl.password) && {
|
||||||
token: `${proxyUrl.username}:${proxyUrl.password}`
|
token: `Basic ${Buffer.from(
|
||||||
|
`${proxyUrl.username}:${proxyUrl.password}`
|
||||||
|
).toString('base64')}`
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this._proxyAgentDispatcher = proxyAgent
|
this._proxyAgentDispatcher = proxyAgent
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ export function getProxyUrl(reqUrl: URL): URL | undefined {
|
|||||||
|
|
||||||
if (proxyVar) {
|
if (proxyVar) {
|
||||||
try {
|
try {
|
||||||
return new URL(proxyVar)
|
return new DecodedURL(proxyVar)
|
||||||
} catch {
|
} catch {
|
||||||
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
|
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
|
||||||
return new URL(`http://${proxyVar}`)
|
return new DecodedURL(`http://${proxyVar}`)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return undefined
|
return undefined
|
||||||
@@ -87,3 +87,22 @@ function isLoopbackAddress(host: string): boolean {
|
|||||||
hostLower.startsWith('[0:0:0:0:0:0:0:1]')
|
hostLower.startsWith('[0:0:0:0:0:0:0:1]')
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class DecodedURL extends URL {
|
||||||
|
private _decodedUsername: string
|
||||||
|
private _decodedPassword: string
|
||||||
|
|
||||||
|
constructor(url: string | URL, base?: string | URL) {
|
||||||
|
super(url, base)
|
||||||
|
this._decodedUsername = decodeURIComponent(super.username)
|
||||||
|
this._decodedPassword = decodeURIComponent(super.password)
|
||||||
|
}
|
||||||
|
|
||||||
|
get username(): string {
|
||||||
|
return this._decodedUsername
|
||||||
|
}
|
||||||
|
|
||||||
|
get password(): string {
|
||||||
|
return this._decodedPassword
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user