@quiltdata/benchling-webhook 0.4.13 → 0.5.0
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.
- package/dist/bin/benchling-webhook.d.ts +50 -0
- package/dist/bin/benchling-webhook.d.ts.map +1 -0
- package/dist/bin/benchling-webhook.js +268 -0
- package/dist/bin/benchling-webhook.js.map +1 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +83 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/bin/commands/deploy.d.ts +7 -0
- package/dist/bin/commands/deploy.d.ts.map +1 -0
- package/dist/bin/commands/deploy.js +154 -0
- package/dist/bin/commands/deploy.js.map +1 -0
- package/dist/bin/commands/init.d.ts +9 -0
- package/dist/bin/commands/init.d.ts.map +1 -0
- package/dist/bin/commands/init.js +155 -0
- package/dist/bin/commands/init.js.map +1 -0
- package/dist/bin/commands/validate.d.ts +5 -0
- package/dist/bin/commands/validate.d.ts.map +1 -0
- package/dist/bin/commands/validate.js +135 -0
- package/dist/bin/commands/validate.js.map +1 -0
- package/dist/bin/get-env.js +180 -0
- package/dist/bin/publish.js +327 -0
- package/{bin → dist/bin}/version.js +73 -37
- package/dist/lib/alb-api-gateway.d.ts +17 -0
- package/dist/lib/alb-api-gateway.d.ts.map +1 -0
- package/dist/lib/alb-api-gateway.js +191 -0
- package/dist/lib/alb-api-gateway.js.map +1 -0
- package/dist/lib/benchling-webhook-stack.d.ts +25 -0
- package/dist/lib/benchling-webhook-stack.d.ts.map +1 -0
- package/dist/lib/benchling-webhook-stack.js +165 -0
- package/dist/lib/benchling-webhook-stack.js.map +1 -0
- package/dist/lib/constants.d.ts +28 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +31 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/ecr-repository.d.ts +16 -0
- package/dist/lib/ecr-repository.d.ts.map +1 -0
- package/dist/lib/ecr-repository.js +90 -0
- package/dist/lib/ecr-repository.js.map +1 -0
- package/dist/lib/fargate-service.d.ts +32 -0
- package/dist/lib/fargate-service.d.ts.map +1 -0
- package/dist/lib/fargate-service.js +294 -0
- package/dist/lib/fargate-service.js.map +1 -0
- package/{lib/index.ts → dist/lib/index.d.ts} +5 -5
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +38 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/templates/base-template.d.ts +14 -0
- package/dist/lib/templates/base-template.d.ts.map +1 -0
- package/dist/lib/templates/base-template.js +68 -0
- package/dist/lib/templates/base-template.js.map +1 -0
- package/dist/lib/templates/readme.d.ts +11 -0
- package/dist/lib/templates/readme.d.ts.map +1 -0
- package/dist/lib/templates/readme.js +105 -0
- package/dist/lib/templates/readme.js.map +1 -0
- package/dist/lib/utils/config.d.ts +68 -0
- package/dist/lib/utils/config.d.ts.map +1 -0
- package/dist/lib/utils/config.js +195 -0
- package/dist/lib/utils/config.js.map +1 -0
- package/dist/lib/utils/stack-inference.d.ts +73 -0
- package/dist/lib/utils/stack-inference.d.ts.map +1 -0
- package/dist/lib/utils/stack-inference.js +410 -0
- package/dist/lib/utils/stack-inference.js.map +1 -0
- package/dist/package.json +90 -0
- package/package.json +32 -21
- package/AGENTS.md +0 -226
- package/CHANGELOG.md +0 -91
- package/bin/benchling-webhook.ts +0 -172
- package/bin/cli-auth.sh +0 -74
- package/bin/get-env.js +0 -564
- package/bin/publish-manual.js +0 -211
- package/bin/release-notes.sh +0 -82
- package/bin/sync-version.js +0 -72
- package/cdk.context.json +0 -58
- package/cdk.json +0 -85
- package/doc/NPM_OIDC_SETUP.md +0 -95
- package/doc/PARAMETERS.md +0 -203
- package/doc/RELEASE.md +0 -297
- package/doc/RELEASE_NOTES.md +0 -64
- package/jest.config.js +0 -14
- package/lib/README.md +0 -50
- package/lib/oauth-tester.json +0 -35
- package/tsconfig.json +0 -34
- /package/{bin → dist/bin}/check-logs.js +0 -0
- /package/{bin → dist/bin}/release.js +0 -0
- /package/{bin → dist/bin}/send-event.js +0 -0
- /package/{bin → dist/bin}/test-invalid-signature.js +0 -0
package/bin/publish-manual.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Manual NPM publish script using access token
|
|
5
|
-
*
|
|
6
|
-
* This script allows manual publishing to npmjs.org using an NPM access token.
|
|
7
|
-
* It's useful for:
|
|
8
|
-
* - Local testing of the publish process
|
|
9
|
-
* - Manual releases when CI/CD is unavailable
|
|
10
|
-
* - Emergency hotfix releases
|
|
11
|
-
*
|
|
12
|
-
* Prerequisites:
|
|
13
|
-
* 1. You must have an NPM access token with publish permissions
|
|
14
|
-
* 2. Set the token as environment variable: NPM_TOKEN=your_token_here
|
|
15
|
-
*
|
|
16
|
-
* Usage:
|
|
17
|
-
* NPM_TOKEN=your_token npm run publish:manual
|
|
18
|
-
* NPM_TOKEN=your_token npm run publish:manual -- --dry-run
|
|
19
|
-
* NPM_TOKEN=your_token npm run publish:manual -- --tag beta
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
const fs = require('fs');
|
|
23
|
-
const path = require('path');
|
|
24
|
-
const { execSync } = require('child_process');
|
|
25
|
-
|
|
26
|
-
const NPMRC_PATH = path.join(__dirname, '..', '.npmrc');
|
|
27
|
-
const NPMRC_BACKUP_PATH = path.join(__dirname, '..', '.npmrc.backup');
|
|
28
|
-
|
|
29
|
-
function validateToken() {
|
|
30
|
-
const token = process.env.NPM_TOKEN;
|
|
31
|
-
|
|
32
|
-
if (!token) {
|
|
33
|
-
console.error('❌ Error: NPM_TOKEN environment variable is not set');
|
|
34
|
-
console.error('');
|
|
35
|
-
console.error('Usage:');
|
|
36
|
-
console.error(' NPM_TOKEN=your_token_here npm run publish:manual');
|
|
37
|
-
console.error('');
|
|
38
|
-
console.error('To get an NPM access token:');
|
|
39
|
-
console.error(' 1. Go to https://www.npmjs.com/settings/[your-username]/tokens');
|
|
40
|
-
console.error(' 2. Click "Generate New Token"');
|
|
41
|
-
console.error(' 3. Select "Automation" type for CI/CD or "Publish" for manual use');
|
|
42
|
-
console.error(' 4. Copy the token and use it with this script');
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return token;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function validateGitState() {
|
|
50
|
-
// Check for uncommitted changes
|
|
51
|
-
try {
|
|
52
|
-
execSync('git diff-index --quiet HEAD --', { stdio: 'ignore' });
|
|
53
|
-
} catch (e) {
|
|
54
|
-
console.error('⚠️ Warning: You have uncommitted changes');
|
|
55
|
-
console.error(' It is recommended to commit changes before publishing');
|
|
56
|
-
console.error('');
|
|
57
|
-
|
|
58
|
-
const readline = require('readline').createInterface({
|
|
59
|
-
input: process.stdin,
|
|
60
|
-
output: process.stdout
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
return new Promise((resolve) => {
|
|
64
|
-
readline.question('Continue anyway? (y/N): ', (answer) => {
|
|
65
|
-
readline.close();
|
|
66
|
-
if (answer.toLowerCase() !== 'y') {
|
|
67
|
-
console.log('Aborted');
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
resolve();
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function createNpmrc(token) {
|
|
77
|
-
// Backup existing .npmrc if it exists
|
|
78
|
-
if (fs.existsSync(NPMRC_PATH)) {
|
|
79
|
-
console.log('📋 Backing up existing .npmrc');
|
|
80
|
-
fs.copyFileSync(NPMRC_PATH, NPMRC_BACKUP_PATH);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Create .npmrc with token
|
|
84
|
-
const npmrcContent = `//registry.npmjs.org/:_authToken=${token}\nregistry=https://registry.npmjs.org/\n`;
|
|
85
|
-
fs.writeFileSync(NPMRC_PATH, npmrcContent, { mode: 0o600 });
|
|
86
|
-
console.log('✅ Created .npmrc with authentication token');
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function restoreNpmrc() {
|
|
90
|
-
// Remove the temporary .npmrc
|
|
91
|
-
if (fs.existsSync(NPMRC_PATH)) {
|
|
92
|
-
fs.unlinkSync(NPMRC_PATH);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Restore backup if it exists
|
|
96
|
-
if (fs.existsSync(NPMRC_BACKUP_PATH)) {
|
|
97
|
-
console.log('📋 Restoring original .npmrc');
|
|
98
|
-
fs.renameSync(NPMRC_BACKUP_PATH, NPMRC_PATH);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function publishPackage(isDryRun, tag) {
|
|
103
|
-
const packagePath = path.join(__dirname, '..', 'package.json');
|
|
104
|
-
const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
105
|
-
|
|
106
|
-
console.log('');
|
|
107
|
-
console.log('📦 Publishing package: ' + pkg.name);
|
|
108
|
-
console.log('📌 Version: ' + pkg.version);
|
|
109
|
-
if (tag) {
|
|
110
|
-
console.log('🏷️ Tag: ' + tag);
|
|
111
|
-
}
|
|
112
|
-
console.log('');
|
|
113
|
-
|
|
114
|
-
let publishCmd = 'npm publish --access public';
|
|
115
|
-
|
|
116
|
-
if (isDryRun) {
|
|
117
|
-
publishCmd += ' --dry-run';
|
|
118
|
-
console.log('🔍 Running in dry-run mode (no actual publish)');
|
|
119
|
-
console.log('');
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (tag) {
|
|
123
|
-
publishCmd += ` --tag ${tag}`;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
try {
|
|
127
|
-
execSync(publishCmd, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
|
|
128
|
-
|
|
129
|
-
if (isDryRun) {
|
|
130
|
-
console.log('');
|
|
131
|
-
console.log('✅ Dry run completed successfully');
|
|
132
|
-
console.log(' Remove --dry-run to publish for real');
|
|
133
|
-
} else {
|
|
134
|
-
console.log('');
|
|
135
|
-
console.log('✅ Package published successfully!');
|
|
136
|
-
console.log(` View at: https://www.npmjs.com/package/${pkg.name}/v/${pkg.version}`);
|
|
137
|
-
}
|
|
138
|
-
} catch (error) {
|
|
139
|
-
console.error('');
|
|
140
|
-
console.error('❌ Failed to publish package');
|
|
141
|
-
throw error;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
async function main() {
|
|
146
|
-
const args = process.argv.slice(2);
|
|
147
|
-
|
|
148
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
149
|
-
const packagePath = path.join(__dirname, '..', 'package.json');
|
|
150
|
-
const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
151
|
-
|
|
152
|
-
console.log('📦 Manual NPM Publish');
|
|
153
|
-
console.log('');
|
|
154
|
-
console.log('Current package:', pkg.name);
|
|
155
|
-
console.log('Current version:', pkg.version);
|
|
156
|
-
console.log('');
|
|
157
|
-
console.log('Usage:');
|
|
158
|
-
console.log(' NPM_TOKEN=token npm run publish:manual [options]');
|
|
159
|
-
console.log('');
|
|
160
|
-
console.log('Options:');
|
|
161
|
-
console.log(' --dry-run Test the publish process without actually publishing');
|
|
162
|
-
console.log(' --tag TAG Publish with a specific dist-tag (e.g., beta, next, latest)');
|
|
163
|
-
console.log(' --help, -h Show this help message');
|
|
164
|
-
console.log('');
|
|
165
|
-
console.log('Examples:');
|
|
166
|
-
console.log(' NPM_TOKEN=npm_xxx npm run publish:manual');
|
|
167
|
-
console.log(' NPM_TOKEN=npm_xxx npm run publish:manual -- --dry-run');
|
|
168
|
-
console.log(' NPM_TOKEN=npm_xxx npm run publish:manual -- --tag beta');
|
|
169
|
-
console.log('');
|
|
170
|
-
console.log('Getting an NPM token:');
|
|
171
|
-
console.log(' 1. Visit: https://www.npmjs.com/settings/[your-username]/tokens');
|
|
172
|
-
console.log(' 2. Click "Generate New Token"');
|
|
173
|
-
console.log(' 3. Choose "Automation" (for CI/CD) or "Publish" (for manual use)');
|
|
174
|
-
console.log(' 4. Copy the token (it starts with "npm_")');
|
|
175
|
-
process.exit(0);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const isDryRun = args.includes('--dry-run');
|
|
179
|
-
const tagIndex = args.indexOf('--tag');
|
|
180
|
-
const tag = tagIndex !== -1 && args[tagIndex + 1] ? args[tagIndex + 1] : null;
|
|
181
|
-
|
|
182
|
-
console.log('🚀 Manual NPM Publish Script');
|
|
183
|
-
console.log('═'.repeat(50));
|
|
184
|
-
|
|
185
|
-
// Validate token
|
|
186
|
-
const token = validateToken();
|
|
187
|
-
|
|
188
|
-
// Validate git state
|
|
189
|
-
await validateGitState();
|
|
190
|
-
|
|
191
|
-
try {
|
|
192
|
-
// Create .npmrc with token
|
|
193
|
-
createNpmrc(token);
|
|
194
|
-
|
|
195
|
-
// Publish package
|
|
196
|
-
publishPackage(isDryRun, tag);
|
|
197
|
-
} catch (error) {
|
|
198
|
-
console.error('');
|
|
199
|
-
console.error('Publishing failed');
|
|
200
|
-
process.exit(1);
|
|
201
|
-
} finally {
|
|
202
|
-
// Always restore the original .npmrc
|
|
203
|
-
restoreNpmrc();
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
main().catch((error) => {
|
|
208
|
-
console.error('Unexpected error:', error);
|
|
209
|
-
restoreNpmrc();
|
|
210
|
-
process.exit(1);
|
|
211
|
-
});
|
package/bin/release-notes.sh
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Generate release notes for GitHub releases
|
|
3
|
-
# Usage: ./bin/release-notes.sh VERSION IMAGE_URI [IS_PRERELEASE]
|
|
4
|
-
|
|
5
|
-
set -e
|
|
6
|
-
|
|
7
|
-
VERSION="${1}"
|
|
8
|
-
IMAGE_URI="${2}"
|
|
9
|
-
IS_PRERELEASE="${3:-false}"
|
|
10
|
-
|
|
11
|
-
if [ -z "$VERSION" ] || [ -z "$IMAGE_URI" ]; then
|
|
12
|
-
echo "Usage: $0 VERSION IMAGE_URI [IS_PRERELEASE]"
|
|
13
|
-
echo "Example: $0 0.4.12 123456.dkr.ecr.us-west-2.amazonaws.com/quiltdata/benchling:0.4.12 false"
|
|
14
|
-
exit 1
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
# Extract changelog notes if available
|
|
18
|
-
CHANGELOG_NOTES=""
|
|
19
|
-
if [ -f CHANGELOG.md ]; then
|
|
20
|
-
CHANGELOG_NOTES=$(sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d' | sed '1d')
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
# Generate release notes
|
|
24
|
-
cat << EOFNOTES
|
|
25
|
-
## Quick Start
|
|
26
|
-
|
|
27
|
-
# 1. Configure
|
|
28
|
-
cp env.template .env
|
|
29
|
-
# Edit .env with AWS account, Benchling credentials, S3/SQS settings
|
|
30
|
-
|
|
31
|
-
# 2. Install app-manifest.yaml as a Benchling app
|
|
32
|
-
|
|
33
|
-
# 3. Deploy
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
set -a; source .env; set +a
|
|
37
|
-
npx cdk bootstrap aws://\$CDK_DEFAULT_ACCOUNT/\$CDK_DEFAULT_REGION
|
|
38
|
-
npm run check
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
# 4. Set Benchling webhook URL in the app overview page
|
|
42
|
-
|
|
43
|
-
# 5. Insert a canvas into a notebook entry and click "Create"
|
|
44
|
-
|
|
45
|
-
# 6. Set `experiment_id` in a package's metadata to link it to a notebook'
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
\`\`\`
|
|
49
|
-
|
|
50
|
-
## Docker Image
|
|
51
|
-
|
|
52
|
-
For custom deployments, use the following Docker image:
|
|
53
|
-
|
|
54
|
-
\`\`\`
|
|
55
|
-
${IMAGE_URI}
|
|
56
|
-
\`\`\`
|
|
57
|
-
|
|
58
|
-
Pull and run:
|
|
59
|
-
\`\`\`bash
|
|
60
|
-
docker pull ${IMAGE_URI}
|
|
61
|
-
\`\`\`
|
|
62
|
-
|
|
63
|
-
EOFNOTES
|
|
64
|
-
|
|
65
|
-
# Add changelog notes if available
|
|
66
|
-
if [ -n "$CHANGELOG_NOTES" ]; then
|
|
67
|
-
echo ""
|
|
68
|
-
echo "## Changes"
|
|
69
|
-
echo ""
|
|
70
|
-
echo "$CHANGELOG_NOTES"
|
|
71
|
-
fi
|
|
72
|
-
|
|
73
|
-
# Add resources
|
|
74
|
-
cat << EOFRESOURCES
|
|
75
|
-
|
|
76
|
-
## Resources
|
|
77
|
-
|
|
78
|
-
- [Installation Guide](https://github.com/quiltdata/benchling-webhook#installation)
|
|
79
|
-
- [Configuration Guide](https://github.com/quiltdata/benchling-webhook#configuration)
|
|
80
|
-
- [Development Guide](https://github.com/quiltdata/benchling-webhook/tree/main/docker)
|
|
81
|
-
- [Release Process](https://github.com/quiltdata/benchling-webhook/blob/main/doc/RELEASE.md)
|
|
82
|
-
EOFRESOURCES
|
package/bin/sync-version.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Synchronize version between package.json, docker/pyproject.toml, and docker/app-manifest.yaml
|
|
4
|
-
* The source of truth is docker/pyproject.toml
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const fs = require('fs');
|
|
8
|
-
const path = require('path');
|
|
9
|
-
|
|
10
|
-
const PYPROJECT_PATH = path.join(__dirname, '..', 'docker', 'pyproject.toml');
|
|
11
|
-
const PACKAGE_JSON_PATH = path.join(__dirname, '..', 'package.json');
|
|
12
|
-
const APP_MANIFEST_PATH = path.join(__dirname, '..', 'docker', 'app-manifest.yaml');
|
|
13
|
-
|
|
14
|
-
function extractVersionFromPyproject(content) {
|
|
15
|
-
const match = content.match(/^version\s*=\s*"([^"]+)"/m);
|
|
16
|
-
if (!match) {
|
|
17
|
-
throw new Error('Could not find version in pyproject.toml');
|
|
18
|
-
}
|
|
19
|
-
return match[1];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function updateAppManifest(version) {
|
|
23
|
-
const content = fs.readFileSync(APP_MANIFEST_PATH, 'utf-8');
|
|
24
|
-
const updatedContent = content.replace(
|
|
25
|
-
/^version:\s*.+$/m,
|
|
26
|
-
`version: ${version}`
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
if (content !== updatedContent) {
|
|
30
|
-
fs.writeFileSync(APP_MANIFEST_PATH, updatedContent);
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function main() {
|
|
37
|
-
// Read pyproject.toml
|
|
38
|
-
const pyprojectContent = fs.readFileSync(PYPROJECT_PATH, 'utf-8');
|
|
39
|
-
const version = extractVersionFromPyproject(pyprojectContent);
|
|
40
|
-
|
|
41
|
-
console.log(`Version from docker/pyproject.toml: ${version}`);
|
|
42
|
-
|
|
43
|
-
// Update package.json
|
|
44
|
-
const packageJson = JSON.parse(fs.readFileSync(PACKAGE_JSON_PATH, 'utf-8'));
|
|
45
|
-
const oldVersion = packageJson.version;
|
|
46
|
-
|
|
47
|
-
if (oldVersion !== version) {
|
|
48
|
-
packageJson.version = version;
|
|
49
|
-
fs.writeFileSync(PACKAGE_JSON_PATH, JSON.stringify(packageJson, null, 2) + '\n');
|
|
50
|
-
console.log(`✓ Updated package.json version: ${oldVersion} → ${version}`);
|
|
51
|
-
} else {
|
|
52
|
-
console.log(`✓ package.json version already matches: ${version}`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Update app-manifest.yaml
|
|
56
|
-
if (updateAppManifest(version)) {
|
|
57
|
-
console.log(`✓ Updated app-manifest.yaml version to: ${version}`);
|
|
58
|
-
} else {
|
|
59
|
-
console.log(`✓ app-manifest.yaml version already matches: ${version}`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (require.main === module) {
|
|
64
|
-
try {
|
|
65
|
-
main();
|
|
66
|
-
} catch (error) {
|
|
67
|
-
console.error('Error:', error.message);
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
module.exports = { extractVersionFromPyproject };
|
package/cdk.context.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"acknowledged-issue-numbers": [
|
|
3
|
-
32775,
|
|
4
|
-
30717,
|
|
5
|
-
34293,
|
|
6
|
-
34486
|
|
7
|
-
],
|
|
8
|
-
"vpc-provider:account=712023778557:filter.isDefault=true:region=us-east-1:returnAsymmetricSubnets=true": {
|
|
9
|
-
"vpcId": "vpc-2dda6457",
|
|
10
|
-
"vpcCidrBlock": "172.31.0.0/16",
|
|
11
|
-
"ownerAccountId": "712023778557",
|
|
12
|
-
"availabilityZones": [],
|
|
13
|
-
"subnetGroups": [
|
|
14
|
-
{
|
|
15
|
-
"name": "Public",
|
|
16
|
-
"type": "Public",
|
|
17
|
-
"subnets": [
|
|
18
|
-
{
|
|
19
|
-
"subnetId": "subnet-a9e2d0e3",
|
|
20
|
-
"cidr": "172.31.16.0/20",
|
|
21
|
-
"availabilityZone": "us-east-1a",
|
|
22
|
-
"routeTableId": "rtb-455b5e3a"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"subnetId": "subnet-f1a1cead",
|
|
26
|
-
"cidr": "172.31.32.0/20",
|
|
27
|
-
"availabilityZone": "us-east-1b",
|
|
28
|
-
"routeTableId": "rtb-455b5e3a"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"subnetId": "subnet-5853313f",
|
|
32
|
-
"cidr": "172.31.0.0/20",
|
|
33
|
-
"availabilityZone": "us-east-1c",
|
|
34
|
-
"routeTableId": "rtb-455b5e3a"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"subnetId": "subnet-5dbfd673",
|
|
38
|
-
"cidr": "172.31.80.0/20",
|
|
39
|
-
"availabilityZone": "us-east-1d",
|
|
40
|
-
"routeTableId": "rtb-455b5e3a"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"subnetId": "subnet-7a3f8944",
|
|
44
|
-
"cidr": "172.31.48.0/20",
|
|
45
|
-
"availabilityZone": "us-east-1e",
|
|
46
|
-
"routeTableId": "rtb-455b5e3a"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"subnetId": "subnet-30e0c43f",
|
|
50
|
-
"cidr": "172.31.64.0/20",
|
|
51
|
-
"availabilityZone": "us-east-1f",
|
|
52
|
-
"routeTableId": "rtb-455b5e3a"
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
}
|
package/cdk.json
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"app": "npx ts-node --prefer-ts-exts bin/benchling-webhook.ts",
|
|
3
|
-
"watch": {
|
|
4
|
-
"include": [
|
|
5
|
-
"**"
|
|
6
|
-
],
|
|
7
|
-
"exclude": [
|
|
8
|
-
"README.md",
|
|
9
|
-
"cdk*.json",
|
|
10
|
-
"**/*.d.ts",
|
|
11
|
-
"**/*.js",
|
|
12
|
-
"tsconfig.json",
|
|
13
|
-
"package*.json",
|
|
14
|
-
"yarn.lock",
|
|
15
|
-
"node_modules",
|
|
16
|
-
"test"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"context": {
|
|
20
|
-
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
|
|
21
|
-
"@aws-cdk/core:checkSecretUsage": true,
|
|
22
|
-
"@aws-cdk/core:target-partitions": [
|
|
23
|
-
"aws",
|
|
24
|
-
"aws-cn"
|
|
25
|
-
],
|
|
26
|
-
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
|
|
27
|
-
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
|
|
28
|
-
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
|
|
29
|
-
"@aws-cdk/aws-iam:minimizePolicies": true,
|
|
30
|
-
"@aws-cdk/core:validateSnapshotRemovalPolicy": true,
|
|
31
|
-
"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
|
|
32
|
-
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
|
|
33
|
-
"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
|
|
34
|
-
"@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
|
|
35
|
-
"@aws-cdk/core:enablePartitionLiterals": true,
|
|
36
|
-
"@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
|
|
37
|
-
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
|
|
38
|
-
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
|
|
39
|
-
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
|
|
40
|
-
"@aws-cdk/aws-route53-patters:useCertificate": true,
|
|
41
|
-
"@aws-cdk/customresources:installLatestAwsSdkDefault": false,
|
|
42
|
-
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
|
|
43
|
-
"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
|
|
44
|
-
"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
|
|
45
|
-
"@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
|
|
46
|
-
"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
|
|
47
|
-
"@aws-cdk/aws-redshift:columnId": true,
|
|
48
|
-
"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
|
|
49
|
-
"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
|
|
50
|
-
"@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
|
|
51
|
-
"@aws-cdk/aws-kms:aliasNameRef": true,
|
|
52
|
-
"@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
|
|
53
|
-
"@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
|
|
54
|
-
"@aws-cdk/aws-efs:denyAnonymousAccess": true,
|
|
55
|
-
"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
|
|
56
|
-
"@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
|
|
57
|
-
"@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
|
|
58
|
-
"@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
|
|
59
|
-
"@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
|
|
60
|
-
"@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
|
|
61
|
-
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
|
|
62
|
-
"@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
|
|
63
|
-
"@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true,
|
|
64
|
-
"@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": true,
|
|
65
|
-
"@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true,
|
|
66
|
-
"@aws-cdk/aws-eks:nodegroupNameAttribute": true,
|
|
67
|
-
"@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true,
|
|
68
|
-
"@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": true,
|
|
69
|
-
"@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": false,
|
|
70
|
-
"@aws-cdk/aws-s3:keepNotificationInImportedBucket": false,
|
|
71
|
-
"@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature": false,
|
|
72
|
-
"@aws-cdk/aws-ecs:disableEcsImdsBlocking": true,
|
|
73
|
-
"@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": true,
|
|
74
|
-
"@aws-cdk/aws-dynamodb:resourcePolicyPerReplica": true,
|
|
75
|
-
"@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": true,
|
|
76
|
-
"@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": true,
|
|
77
|
-
"@aws-cdk/aws-rds:setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId": true,
|
|
78
|
-
"@aws-cdk/core:cfnIncludeRejectComplexResourceUpdateCreatePolicyIntrinsics": true,
|
|
79
|
-
"@aws-cdk/aws-lambda-nodejs:sdkV3ExcludeSmithyPackages": true,
|
|
80
|
-
"@aws-cdk/aws-stepfunctions-tasks:fixRunEcsTaskPolicy": true,
|
|
81
|
-
"@aws-cdk/aws-ec2:bastionHostUseAmazonLinux2023ByDefault": true,
|
|
82
|
-
"@aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource": true,
|
|
83
|
-
"@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault": true
|
|
84
|
-
}
|
|
85
|
-
}
|
package/doc/NPM_OIDC_SETUP.md
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# NPM OIDC Configuration for GitHub Actions
|
|
2
|
-
|
|
3
|
-
This repository now uses OpenID Connect (OIDC) for publishing to npm, eliminating the need for long-lived `NPM_TOKEN` secrets.
|
|
4
|
-
|
|
5
|
-
## What Changed
|
|
6
|
-
|
|
7
|
-
The GitHub Actions workflow ([.github/workflows/ci.yaml](.github/workflows/ci.yaml)) has been updated to:
|
|
8
|
-
|
|
9
|
-
1. Add `id-token: write` permission for OIDC token generation
|
|
10
|
-
2. Use `npm publish --provenance --access public` with automatic OIDC authentication
|
|
11
|
-
3. Remove dependency on `NPM_TOKEN` GitHub secret
|
|
12
|
-
|
|
13
|
-
## Required npm Configuration
|
|
14
|
-
|
|
15
|
-
To enable OIDC publishing, you need to configure your npm package settings:
|
|
16
|
-
|
|
17
|
-
### 1. Enable Provenance on npm
|
|
18
|
-
|
|
19
|
-
The `--provenance` flag automatically uses OIDC when available. npm will:
|
|
20
|
-
|
|
21
|
-
- Accept OIDC tokens from GitHub Actions
|
|
22
|
-
- Generate signed provenance attestations
|
|
23
|
-
- Link published packages to their source code and build process
|
|
24
|
-
|
|
25
|
-
### 2. Configure npm Package Access
|
|
26
|
-
|
|
27
|
-
If not already configured, ensure your npm account has:
|
|
28
|
-
|
|
29
|
-
1. **Publishing access** to the `quilt-benchling-webhook` package
|
|
30
|
-
2. **Provenance enabled** for your npm account/organization
|
|
31
|
-
|
|
32
|
-
### 3. Update npm Settings (If First Time Using OIDC)
|
|
33
|
-
|
|
34
|
-
Visit [npm automation tokens settings](https://www.npmjs.com/settings/~/tokens) and:
|
|
35
|
-
|
|
36
|
-
1. You can safely **delete the old `NPM_TOKEN`** secret from GitHub after verifying OIDC works
|
|
37
|
-
2. No new token needs to be created - OIDC handles authentication automatically
|
|
38
|
-
3. Ensure your npm organization settings allow publishing with provenance
|
|
39
|
-
|
|
40
|
-
### 4. Grant GitHub Actions Access (npm Configuration)
|
|
41
|
-
|
|
42
|
-
For npm to accept OIDC tokens from your repository:
|
|
43
|
-
|
|
44
|
-
1. Go to [npm package settings](https://www.npmjs.com/package/quilt-benchling-webhook/access)
|
|
45
|
-
2. Ensure the package allows automated publishing
|
|
46
|
-
3. npm automatically trusts GitHub Actions OIDC tokens for configured organizations
|
|
47
|
-
|
|
48
|
-
## Testing the Setup
|
|
49
|
-
|
|
50
|
-
To test OIDC publishing:
|
|
51
|
-
|
|
52
|
-
1. Create a test tag: `git tag v0.4.14-dev.1 && git push origin v0.4.14-dev.1`
|
|
53
|
-
2. Monitor the GitHub Actions workflow
|
|
54
|
-
3. The "Publish to NPM" step should succeed without `NODE_AUTH_TOKEN`
|
|
55
|
-
4. Verify provenance on npm: `npm view quilt-benchling-webhook`
|
|
56
|
-
|
|
57
|
-
## Troubleshooting
|
|
58
|
-
|
|
59
|
-
### "Unable to authenticate" errors
|
|
60
|
-
|
|
61
|
-
- Verify `id-token: write` permission is set in the workflow
|
|
62
|
-
- Check that `registry-url: 'https://registry.npmjs.org'` is configured in the Node.js setup
|
|
63
|
-
- Ensure the package exists and your account has publishing rights
|
|
64
|
-
|
|
65
|
-
### "Provenance not supported" errors
|
|
66
|
-
|
|
67
|
-
- Update to npm 9.5.0 or later (the workflow uses Node.js 24 which includes npm 10.x)
|
|
68
|
-
- Verify your npm account/organization supports provenance
|
|
69
|
-
|
|
70
|
-
### Need to roll back?
|
|
71
|
-
|
|
72
|
-
If you need to revert to token-based authentication:
|
|
73
|
-
|
|
74
|
-
1. Create a new npm automation token
|
|
75
|
-
2. Add it as `NPM_TOKEN` secret in GitHub
|
|
76
|
-
3. Remove `--provenance` flag and add back:
|
|
77
|
-
|
|
78
|
-
```yaml
|
|
79
|
-
env:
|
|
80
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Benefits of OIDC
|
|
84
|
-
|
|
85
|
-
- **No secret rotation**: No long-lived tokens to manage or rotate
|
|
86
|
-
- **Better security**: Tokens are short-lived and scoped to specific workflows
|
|
87
|
-
- **Provenance**: Published packages include verifiable build provenance
|
|
88
|
-
- **Audit trail**: Clear link between published packages and their source
|
|
89
|
-
- **Supply chain security**: Helps prevent package tampering and improves trust
|
|
90
|
-
|
|
91
|
-
## References
|
|
92
|
-
|
|
93
|
-
- [npm Provenance Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
94
|
-
- [GitHub Actions OIDC](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
95
|
-
- [npm publish with provenance](https://docs.npmjs.com/cli/v10/commands/npm-publish#provenance)
|