fix(webservices): patch SQL injection and improve reliability#12
Open
MrMichou wants to merge 3 commits intocropalato:mainfrom
Open
fix(webservices): patch SQL injection and improve reliability#12MrMichou wants to merge 3 commits intocropalato:mainfrom
MrMichou wants to merge 3 commits intocropalato:mainfrom
Conversation
…bility Replace string-interpolated SQL queries with parameterized queries ($1, $2) to prevent SQL injection in updateMergeStatus(). Add DB connection pooling, replace log.Fatal() with proper error returns, fix CORS wildcard origin, add graceful shutdown, remove pkg/errors dependency, and update Go/deps to latest versions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…DB logic Cover SQL parameterized queries, CORS headers, token validation, error handling (no more log.Fatal crashes), GitLab API mocking, and approval rule enforcement logic using sqlmock and httptest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify SQL parameterized queries, DB updates through full webhook flow, CORS headers, token validation, ReinforceAllMrRule, and SQL injection prevention against a real PostgreSQL 16 instance. Docker build also tested successfully. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
updateMergeStatus()by replacingfmt.Sprintfwith parameterized queries ($1,$2)"*"origin — now uses configuredCorsOriginvalue*sqlx.DBinServicestruct), replace alllog.Fatal()with proper error returns, add graceful shutdown with signal handling (SIGINT/SIGTERM)github.com/pkg/errorsdependency (usefmt.Errorfwith%w), update Go to 1.25, update all dependencies, upgrade Dockerfile base todebian12Test plan
go build ./...passesgo test ./...passesgo vet ./...cleanSIGTERMand confirm clean exit with DB pool closure🤖 Generated with Claude Code