Add @epilot/blueprint-tester: format-agnostic blueprint validation library#366
Add @epilot/blueprint-tester: format-agnostic blueprint validation library#366
Conversation
…tion Catches dangling UUIDs, leaked tokens/secrets, source org references, and other issues in exported blueprint ZIP files before publishing. 8 validation rules: - dangling-uuid (error): hardcoded UUIDs not matching any blueprint resource - source-org-ref (error): hardcoded organization IDs - cross-ref-integrity (error): broken depends_on / terraform references - token-detection (warning): API keys, bearer tokens, OAuth secrets - public-journey-safety (warning): public journeys with hardcoded refs - incomplete-webhook (warning): webhooks with hardcoded URLs/auth - environment-url (info): sandbox/staging/dev URLs - email-address (info): hardcoded email addresses Also adds `epilot blueprint-test` CLI command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| { name: 'dev URL', regex: /dev[.\-_][a-z]+\.epilot\.cloud/gi }, | ||
| { name: 'localhost URL', regex: /(?:localhost|127\.0\.0\.1)(?::\d+)?/g }, | ||
| { name: 'org-specific S3 path', regex: /(?:s3:\/\/|amazonaws\.com\/)[^\s"']*\d{5,}[^\s"']*/g }, | ||
| { name: 'internal service URL', regex: /https?:\/\/[a-z-]+\.sls\.epilot\.io/g }, |
Check failure
Code scanning / CodeQL
Missing regular expression anchor High
Copilot Autofix
AI 17 days ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| @@ -0,0 +1,130 @@ | |||
| import { resolve } from 'node:path'; | |||
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 17 days ago
To fix the problem, remove the unused resolve import from the top of packages/blueprint-tester/__tests__/validator.test.ts. This does not change any functionality, since resolve is never used and node:path has no needed side effects here. Concretely, delete line 1 containing import { resolve } from 'node:path'; and leave the remaining imports and code unchanged. No additional methods, imports, or definitions are required.
| @@ -1,4 +1,3 @@ | ||
| import { resolve } from 'node:path'; | ||
| import AdmZip from 'adm-zip'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { validateBlueprint } from '../src/validator.js'; |
Accept any blueprint input format (ZIP, JSON manifest, API response) via adapters that normalize to a common BlueprintData type. Rules now use rawContent instead of rawHcl and conditionally apply terraform-specific checks based on the input format. - Add BlueprintResource, BlueprintData, BlueprintManifest types - Add terraform-adapter (ZIP → BlueprintData) and json-adapter (manifest → BlueprintData) - Add auto-detection in normalizeBlueprintInput - Update all 8 rules to be format-aware - Update CLI to accept .json files - Add JSON adapter tests (6 new, 62 total) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
@epilot/blueprint-testerlibrary for validating epilot blueprint exportsBlueprintDataobjectsterraform-adapter(ZIP → BlueprintData),json-adapter(manifest → BlueprintData), with auto-detectionepilot blueprint-test <file.zip|file.json>Architecture
Test plan
🤖 Generated with Claude Opus 4.6