cdk-ecr-deployment 2.2.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,103 @@
1
+ 'use strict'
2
+
3
+ const needle = require('needle')
4
+ const test = require('ava')
5
+ const {
6
+ createServer,
7
+ createSecureServer,
8
+ createProxy,
9
+ createSecureProxy
10
+ } = require('./utils')
11
+ const { HttpProxyAgent, HttpsProxyAgent } = require('../')
12
+
13
+ test('http to http', async t => {
14
+ const server = await createServer()
15
+ const proxy = await createProxy()
16
+ server.on('request', (req, res) => res.end('ok'))
17
+
18
+ const response = await needle('get', `http://${server.address().address}:${server.address().port}`, {
19
+ agent: new HttpProxyAgent({
20
+ keepAlive: true,
21
+ keepAliveMsecs: 1000,
22
+ maxSockets: 256,
23
+ maxFreeSockets: 256,
24
+ scheduling: 'lifo',
25
+ proxy: `http://${proxy.address().address}:${proxy.address().port}`
26
+ })
27
+ })
28
+
29
+ t.is(response.body.toString(), 'ok')
30
+ t.is(response.statusCode, 200)
31
+
32
+ server.close()
33
+ proxy.close()
34
+ })
35
+
36
+ test('https to http', async t => {
37
+ const server = await createServer()
38
+ const proxy = await createSecureProxy()
39
+ server.on('request', (req, res) => res.end('ok'))
40
+
41
+ const response = await needle('get', `http://${server.address().address}:${server.address().port}`, {
42
+ agent: new HttpProxyAgent({
43
+ keepAlive: true,
44
+ keepAliveMsecs: 1000,
45
+ maxSockets: 256,
46
+ maxFreeSockets: 256,
47
+ scheduling: 'lifo',
48
+ proxy: `https://${proxy.address().address}:${proxy.address().port}`
49
+ })
50
+ })
51
+
52
+ t.is(response.body.toString(), 'ok')
53
+ t.is(response.statusCode, 200)
54
+
55
+ server.close()
56
+ proxy.close()
57
+ })
58
+
59
+ test('http to https', async t => {
60
+ const server = await createSecureServer()
61
+ const proxy = await createProxy()
62
+ server.on('request', (req, res) => res.end('ok'))
63
+
64
+ const response = await needle('get', `https://${server.address().address}:${server.address().port}`, {
65
+ agent: new HttpsProxyAgent({
66
+ keepAlive: true,
67
+ keepAliveMsecs: 1000,
68
+ maxSockets: 256,
69
+ maxFreeSockets: 256,
70
+ scheduling: 'lifo',
71
+ proxy: `http://${proxy.address().address}:${proxy.address().port}`
72
+ })
73
+ })
74
+
75
+ t.is(response.body.toString(), 'ok')
76
+ t.is(response.statusCode, 200)
77
+
78
+ server.close()
79
+ proxy.close()
80
+ })
81
+
82
+ test('https to https', async t => {
83
+ const server = await createSecureServer()
84
+ const proxy = await createSecureProxy()
85
+ server.on('request', (req, res) => res.end('ok'))
86
+
87
+ const response = await needle('get', `https://${server.address().address}:${server.address().port}`, {
88
+ agent: new HttpsProxyAgent({
89
+ keepAlive: true,
90
+ keepAliveMsecs: 1000,
91
+ maxSockets: 256,
92
+ maxFreeSockets: 256,
93
+ scheduling: 'lifo',
94
+ proxy: `https://${proxy.address().address}:${proxy.address().port}`
95
+ })
96
+ })
97
+
98
+ t.is(response.body.toString(), 'ok')
99
+ t.is(response.statusCode, 200)
100
+
101
+ server.close()
102
+ proxy.close()
103
+ })
@@ -0,0 +1,103 @@
1
+ 'use strict'
2
+
3
+ const fetch = require('node-fetch')
4
+ const test = require('ava')
5
+ const {
6
+ createServer,
7
+ createSecureServer,
8
+ createProxy,
9
+ createSecureProxy
10
+ } = require('./utils')
11
+ const { HttpProxyAgent, HttpsProxyAgent } = require('../')
12
+
13
+ test('http to http', async t => {
14
+ const server = await createServer()
15
+ const proxy = await createProxy()
16
+ server.on('request', (req, res) => res.end('ok'))
17
+
18
+ const response = await fetch(`http://${server.address().address}:${server.address().port}`, {
19
+ agent: new HttpProxyAgent({
20
+ keepAlive: true,
21
+ keepAliveMsecs: 1000,
22
+ maxSockets: 256,
23
+ maxFreeSockets: 256,
24
+ scheduling: 'lifo',
25
+ proxy: `http://${proxy.address().address}:${proxy.address().port}`
26
+ })
27
+ })
28
+
29
+ t.is(await response.text(), 'ok')
30
+ t.is(response.status, 200)
31
+
32
+ server.close()
33
+ proxy.close()
34
+ })
35
+
36
+ test('https to http', async t => {
37
+ const server = await createServer()
38
+ const proxy = await createSecureProxy()
39
+ server.on('request', (req, res) => res.end('ok'))
40
+
41
+ const response = await fetch(`http://${server.address().address}:${server.address().port}`, {
42
+ agent: new HttpProxyAgent({
43
+ keepAlive: true,
44
+ keepAliveMsecs: 1000,
45
+ maxSockets: 256,
46
+ maxFreeSockets: 256,
47
+ scheduling: 'lifo',
48
+ proxy: `https://${proxy.address().address}:${proxy.address().port}`
49
+ })
50
+ })
51
+
52
+ t.is(await response.text(), 'ok')
53
+ t.is(response.status, 200)
54
+
55
+ server.close()
56
+ proxy.close()
57
+ })
58
+
59
+ test('http to https', async t => {
60
+ const server = await createSecureServer()
61
+ const proxy = await createProxy()
62
+ server.on('request', (req, res) => res.end('ok'))
63
+
64
+ const response = await fetch(`https://${server.address().address}:${server.address().port}`, {
65
+ agent: new HttpsProxyAgent({
66
+ keepAlive: true,
67
+ keepAliveMsecs: 1000,
68
+ maxSockets: 256,
69
+ maxFreeSockets: 256,
70
+ scheduling: 'lifo',
71
+ proxy: `http://${proxy.address().address}:${proxy.address().port}`
72
+ })
73
+ })
74
+
75
+ t.is(await response.text(), 'ok')
76
+ t.is(response.status, 200)
77
+
78
+ server.close()
79
+ proxy.close()
80
+ })
81
+
82
+ test('https to https', async t => {
83
+ const server = await createSecureServer()
84
+ const proxy = await createSecureProxy()
85
+ server.on('request', (req, res) => res.end('ok'))
86
+
87
+ const response = await fetch(`https://${server.address().address}:${server.address().port}`, {
88
+ agent: new HttpsProxyAgent({
89
+ keepAlive: true,
90
+ keepAliveMsecs: 1000,
91
+ maxSockets: 256,
92
+ maxFreeSockets: 256,
93
+ scheduling: 'lifo',
94
+ proxy: `https://${proxy.address().address}:${proxy.address().port}`
95
+ })
96
+ })
97
+
98
+ t.is(await response.text(), 'ok')
99
+ t.is(response.status, 200)
100
+
101
+ server.close()
102
+ proxy.close()
103
+ })
@@ -0,0 +1,139 @@
1
+ 'use strict'
2
+
3
+ const sget = require('simple-get')
4
+ const test = require('ava')
5
+ const {
6
+ createServer,
7
+ createSecureServer,
8
+ createProxy,
9
+ createSecureProxy
10
+ } = require('./utils')
11
+ const { HttpProxyAgent, HttpsProxyAgent } = require('..')
12
+
13
+ test('http to http', async t => {
14
+ const server = await createServer()
15
+ const proxy = await createProxy()
16
+ server.on('request', (req, res) => res.end('ok'))
17
+
18
+ const response = await new Promise((resolve, reject) => {
19
+ sget.concat({
20
+ url: `http://${server.address().address}:${server.address().port}`,
21
+ agent: new HttpProxyAgent({
22
+ keepAlive: true,
23
+ keepAliveMsecs: 1000,
24
+ maxSockets: 256,
25
+ maxFreeSockets: 256,
26
+ scheduling: 'lifo',
27
+ proxy: `http://${proxy.address().address}:${proxy.address().port}`
28
+ })
29
+ }, function (err, response, data) {
30
+ if (err) {
31
+ return reject(err)
32
+ }
33
+ t.is(data.toString(), 'ok')
34
+
35
+ return resolve(response)
36
+ })
37
+ })
38
+
39
+ t.is(response.statusCode, 200)
40
+
41
+ server.close()
42
+ proxy.close()
43
+ })
44
+
45
+ test('https to http', async t => {
46
+ const server = await createServer()
47
+ const proxy = await createSecureProxy()
48
+ server.on('request', (req, res) => res.end('ok'))
49
+
50
+ const response = await new Promise((resolve, reject) => {
51
+ sget.concat({
52
+ url: `http://${server.address().address}:${server.address().port}`,
53
+ agent: new HttpProxyAgent({
54
+ keepAlive: true,
55
+ keepAliveMsecs: 1000,
56
+ maxSockets: 256,
57
+ maxFreeSockets: 256,
58
+ scheduling: 'lifo',
59
+ proxy: `https://${proxy.address().address}:${proxy.address().port}`
60
+ })
61
+ }, function (err, response, data) {
62
+ if (err) {
63
+ return reject(err)
64
+ }
65
+ t.is(data.toString(), 'ok')
66
+
67
+ return resolve(response)
68
+ })
69
+ })
70
+
71
+ t.is(response.statusCode, 200)
72
+
73
+ server.close()
74
+ proxy.close()
75
+ })
76
+
77
+ test('http to https', async t => {
78
+ const server = await createSecureServer()
79
+ const proxy = await createProxy()
80
+ server.on('request', (req, res) => res.end('ok'))
81
+
82
+ const response = await new Promise((resolve, reject) => {
83
+ sget.concat({
84
+ url: `https://${server.address().address}:${server.address().port}`,
85
+ agent: new HttpsProxyAgent({
86
+ keepAlive: true,
87
+ keepAliveMsecs: 1000,
88
+ maxSockets: 256,
89
+ maxFreeSockets: 256,
90
+ scheduling: 'lifo',
91
+ proxy: `http://${proxy.address().address}:${proxy.address().port}`
92
+ })
93
+ }, function (err, response, data) {
94
+ if (err) {
95
+ return reject(err)
96
+ }
97
+ t.is(data.toString(), 'ok')
98
+
99
+ return resolve(response)
100
+ })
101
+ })
102
+
103
+ t.is(response.statusCode, 200)
104
+
105
+ server.close()
106
+ proxy.close()
107
+ })
108
+
109
+ test('https to https', async t => {
110
+ const server = await createSecureServer()
111
+ const proxy = await createSecureProxy()
112
+ server.on('request', (req, res) => res.end('ok'))
113
+
114
+ const response = await new Promise((resolve, reject) => {
115
+ sget.concat({
116
+ url: `https://${server.address().address}:${server.address().port}`,
117
+ agent: new HttpsProxyAgent({
118
+ keepAlive: true,
119
+ keepAliveMsecs: 1000,
120
+ maxSockets: 256,
121
+ maxFreeSockets: 256,
122
+ scheduling: 'lifo',
123
+ proxy: `https://${proxy.address().address}:${proxy.address().port}`
124
+ })
125
+ }, function (err, response, data) {
126
+ if (err) {
127
+ return reject(err)
128
+ }
129
+ t.is(data.toString(), 'ok')
130
+
131
+ return resolve(response)
132
+ })
133
+ })
134
+
135
+ t.is(response.statusCode, 200)
136
+
137
+ server.close()
138
+ proxy.close()
139
+ })
@@ -0,0 +1,19 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDBzCCAe+gAwIBAgIJALbQMeb7k/WqMA0GCSqGSIb3DQEBBQUAMBoxGDAWBgNV
3
+ BAMMD3d3dy5mYXN0aWZ5Lm9yZzAeFw0xNzAyMDcyMDE5NDJaFw0yNzAyMDUyMDE5
4
+ NDJaMBoxGDAWBgNVBAMMD3d3dy5mYXN0aWZ5Lm9yZzCCASIwDQYJK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Ia8OOo4z5oe/
19
+ kg2m2GQWUphEKXeatQbEaUwquQvPTsmEJUzDMr+xPkkAiAwDpbdGijkSyh/Bmh2H
20
+ nGpFwbf5CzMaxI6ZihK3P1SAdNO5koAQBcytjJW0eCtt4rDK2E+5pDgcBGVia5Y8
21
+ to78BYfLDlhnaIF7mtR/CRUCgYEAvGCuzvOcUv4F/eirk5NMaQb9QqYZZD2XWVTU
22
+ O2T2b7yvX9J+M1t1cESESe4X6cbwlp1T0JSCdGIZhLXWL8Om80/52zfX07VLxP6w
23
+ FCy6G7SeEDxVNRh+6E5qzOO65YP17vDoUacxBZJgyBWKiUkkaW9dzd+sgsgj0yYZ
24
+ xz+QlyUCgYEAxdNWQnz0pR5Rt2dbIedPs7wmiZ7eAe0VjCdhMa52IyJpejdeB6Bn
25
+ Es+3lkHr0Xzty8XlQZcpbswhM8UZRgPVoBvvwQdQbv5yV+LdUu69pLM7InsdZy8u
26
+ opPY/+q9lRdJt4Pbep3pOWYeLP7k5l4vei2vOEMHRjHnoqM5etSb6RU=
27
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1,59 @@
1
+ 'use strict'
2
+
3
+ // We are using self-signed certificates
4
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0
5
+
6
+ const proxy = require('proxy')
7
+ const { readFileSync } = require('fs')
8
+ const { join } = require('path')
9
+ const http = require('http')
10
+ const https = require('https')
11
+
12
+ const ssl = {
13
+ key: readFileSync(join(__dirname, 'ssl.key')),
14
+ cert: readFileSync(join(__dirname, 'ssl.cert'))
15
+ }
16
+
17
+ function createProxy () {
18
+ return new Promise((resolve, reject) => {
19
+ const server = proxy(http.createServer())
20
+ server.listen(0, '127.0.0.1', () => {
21
+ resolve(server)
22
+ })
23
+ })
24
+ }
25
+
26
+ function createSecureProxy () {
27
+ return new Promise((resolve, reject) => {
28
+ const server = proxy(https.createServer(ssl))
29
+ server.listen(0, '127.0.0.1', () => {
30
+ resolve(server)
31
+ })
32
+ })
33
+ }
34
+
35
+ function createServer (handler, callback) {
36
+ return new Promise((resolve, reject) => {
37
+ const server = http.createServer()
38
+ server.listen(0, '127.0.0.1', () => {
39
+ resolve(server)
40
+ })
41
+ })
42
+ }
43
+
44
+ function createSecureServer (handler, callback) {
45
+ return new Promise((resolve, reject) => {
46
+ const server = https.createServer(ssl)
47
+ server.listen(0, '127.0.0.1', () => {
48
+ resolve(server)
49
+ })
50
+ })
51
+ }
52
+
53
+ module.exports = {
54
+ ssl,
55
+ createProxy,
56
+ createSecureProxy,
57
+ createServer,
58
+ createSecureServer
59
+ }
package/package.json CHANGED
@@ -63,17 +63,19 @@
63
63
  "dependencies": {
64
64
  "aws-cdk-lib": "^2.0.0",
65
65
  "constructs": "^10.0.5",
66
- "got": "^11.8.3"
66
+ "got": "^11.8.3",
67
+ "hpagent": "^0.1.2"
67
68
  },
68
69
  "bundledDependencies": [
69
- "got"
70
+ "got",
71
+ "hpagent"
70
72
  ],
71
73
  "keywords": [
72
74
  "cdk"
73
75
  ],
74
76
  "main": "lib/index.js",
75
77
  "license": "Apache-2.0",
76
- "version": "2.2.0",
78
+ "version": "2.3.2",
77
79
  "jest": {
78
80
  "testMatch": [
79
81
  "<rootDir>/src/**/__tests__/**/*.ts?(x)",
package/releasetag.txt CHANGED
@@ -1 +1 @@
1
- v2.2.0
1
+ v2.3.2
package/version.txt CHANGED
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.3.2