Removed unused API Gateway and apiHandler lambda#38
Conversation
github.com/deepalert/deepalert to github.com/cookpad/deepalert Updated module declaration in go.mod, all Go imports across 47 files, and GitHub URLs in package.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Math.random() uses V8's xorshift128+ PRNG which is not cryptographically
secure. Switched to crypto.randomBytes(32).toString('base64url') for 256
bits of OS-level cryptographic randomness. Existing deployed keys stored
in apikey.json are unaffected.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR strengthens API key generation for the CDK stack and updates the Go module dependency set (notably adding AWS CDK-related Go modules and associated indirect dependencies).
Changes:
- Switched CDK-side API key generation to
crypto.randomBytes(...)and URL-safe encoding. - Added AWS CDK Go / constructs / jsii runtime dependencies plus additional indirect Go dependencies.
- Updated
go.sumto reflect the expanded dependency graph.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
cdk/deepalert-stack.ts |
Uses Node crypto to generate an API key when apikey.json is absent. |
go.mod |
Adds AWS CDK Go-related direct dependencies and several new indirect modules. |
go.sum |
Records checksums for the newly introduced/updated Go modules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The enableAPI feature flag was never set in the deploy repo, so the API Gateway, API key generation, and apiHandler lambda were dead code. Removes both security findings (weak PRNG key generation and plaintext key in CloudFormation template) by deleting the code entirely. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The enableAPI feature flag was never set in the deploy repo, making the API Gateway, API key generation, apiHandler lambda, and internal/api package all dead code. Removes both security findings (weak PRNG key generation and plaintext key in CloudFormation template) by deleting the code entirely. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 12 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request removes the API handler Lambda function and all related API Gateway and HTTP API code from the project. This includes the removal of the API Lambda build process, the infrastructure code for deploying the API and its Lambda, all API handler source files, and associated tests. Additionally, several dependencies related to the HTTP API stack (such as Gin and AWS Lambda API proxy) are removed from the Go module file.
Key removals and cleanups:
Infrastructure and Lambda Removal
apiHandler) and its build steps are removed from theMakefile, so it is no longer built or deployed. [1] [2]cdk/deepalert-stack.ts. [1] [2] [3] [4] [5] [6] [7]API Source Code and Tests
internal/api/api.go,internal/api/alert.go, andinternal/api/report.go. [1] [2]internal/api/api_test.go.Dependency Cleanup
go.mod, includinggin-gonic/gin,awslabs/aws-lambda-go-api-proxy, and related indirect packages.These changes fully remove the HTTP API surface and infrastructure from the codebase, simplifying the deployment and dependency footprint.