-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into otaviom/renaming-warning
- Loading branch information
Showing
1,794 changed files
with
357,259 additions
and
198,584 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: P1 Bug Prioritization | ||
on: | ||
issues: | ||
types: | ||
- labeled | ||
|
||
jobs: | ||
prioritize: | ||
if: github.repository == 'aws/aws-cdk' && contains(github.event.issue.labels.*.name, 'bug') && contains(github.event.issue.labels.*.name, 'p1') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Add P1 Bug to project | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }} | ||
script: | | ||
const script = require('./scripts/prioritization/assign-bug-priority.js') | ||
await script({github, context}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { promises as fs } from 'fs'; | ||
import * as querystring from 'node:querystring'; | ||
import * as os from 'os'; | ||
import * as path from 'path'; | ||
import * as mockttp from 'mockttp'; | ||
import { CompletedRequest } from 'mockttp'; | ||
|
||
export async function startProxyServer(certDirRoot?: string): Promise<ProxyServer> { | ||
const certDir = await fs.mkdtemp(path.join(certDirRoot ?? os.tmpdir(), 'cdk-')); | ||
const certPath = path.join(certDir, 'cert.pem'); | ||
const keyPath = path.join(certDir, 'key.pem'); | ||
|
||
// Set up key and certificate | ||
const { key, cert } = await mockttp.generateCACertificate(); | ||
await fs.writeFile(keyPath, key); | ||
await fs.writeFile(certPath, cert); | ||
|
||
const server = mockttp.getLocal({ | ||
https: { keyPath: keyPath, certPath: certPath }, | ||
}); | ||
|
||
// We don't need to modify any request, so the proxy | ||
// passes through all requests to the target host. | ||
const endpoint = await server | ||
.forAnyRequest() | ||
.thenPassThrough(); | ||
|
||
const port = 9000 + Math.floor(Math.random() * 10000); | ||
|
||
// server.enableDebug(); | ||
await server.start(port); | ||
|
||
return { | ||
certPath, | ||
keyPath, | ||
server, | ||
url: server.url, | ||
port: server.port, | ||
getSeenRequests: () => endpoint.getSeenRequests(), | ||
async stop() { | ||
await server.stop(); | ||
await fs.rm(certDir, { recursive: true, force: true }); | ||
}, | ||
}; | ||
} | ||
|
||
export interface ProxyServer { | ||
readonly certPath: string; | ||
readonly keyPath: string; | ||
readonly server: mockttp.Mockttp; | ||
readonly url: string; | ||
readonly port: number; | ||
|
||
getSeenRequests(): Promise<CompletedRequest[]>; | ||
stop(): Promise<void>; | ||
} | ||
|
||
export function awsActionsFromRequests(requests: CompletedRequest[]): string[] { | ||
return [...new Set(requests | ||
.map(req => req.body.buffer.toString('utf-8')) | ||
.map(body => querystring.decode(body)) | ||
.map(x => x.Action as string) | ||
.filter(action => action != null))]; | ||
} |
Oops, something went wrong.