-
Notifications
You must be signed in to change notification settings - Fork 1
Add SQL injection test data for Postgres test. Use username/password in examples. #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThe changes extract database credentials from the DSN string into separate User and Password fields within the Config.Connect type. Tests were updated to verify credentials are properly stored in these dedicated fields while the DSN is constructed without embedded credentials. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Areas requiring extra attention:
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/bsql/config_test.go (1)
34-36: DSN/user/password expectations correctly updated; consider explicit “no credentials in DSN” assertsThe new expectations for
c.Connect.DSN,c.Connect.User, andc.Connect.Passwordcorrectly reflect separating credentials from the DSN, which matches the PR intent and improves safety around special characters in env vars.As a small optional hardening/clarity tweak, you could also assert that the DSN never contains the credential placeholders:
require.Equal(t, "Wordpress Test", c.AppName) - require.Equal(t, "mysql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?charset=utf8mb4&parseTime=True&loc=Local", c.Connect.DSN) - require.Equal(t, "${DB_USER}", c.Connect.User) - require.Equal(t, "${DB_PASSWORD}", c.Connect.Password) + require.Equal(t, "mysql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?charset=utf8mb4&parseTime=True&loc=Local", c.Connect.DSN) + require.Equal(t, "${DB_USER}", c.Connect.User) + require.Equal(t, "${DB_PASSWORD}", c.Connect.Password) + require.NotContains(t, c.Connect.DSN, "${DB_USER}") + require.NotContains(t, c.Connect.DSN, "${DB_PASSWORD}")This makes the “no credentials in DSN” contract explicit and guards against regressions. As per coding guidelines.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
examples/mysql-test.ymlis excluded by none and included by noneexamples/oracle-test.ymlis excluded by none and included by noneexamples/postgres-test.ymlis excluded by none and included by noneexamples/sap-hana-test.ymlis excluded by none and included by noneexamples/sqlserver-test.ymlis excluded by none and included by noneexamples/wordpress-test.ymlis excluded by none and included by nonetest/postgres-init.sqlis excluded by none and included by none
📒 Files selected for processing (1)
pkg/bsql/config_test.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.go: Error handling: usefmt.Errorfwith contextual messages; check specific errors witherrors.Is
Organize imports: standard library first, then third-party, then project imports; alphabetize within each group
Naming: CamelCase for exported identifiers; camelCase for unexported; preserve acronyms like ID, URL, HTTP, API
Limit line length to a maximum of 200 characters
Comments for exported items must be complete sentences ending with periods
Do not uselog.Fatalorlog.Panic(ruleguard-enforced)
Files:
pkg/bsql/config_test.go
**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Tests should be table-driven using testify/require; name tests
TestStructName_methodName
Files:
pkg/bsql/config_test.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: go-test (ubuntu-latest)
… expose bugs in the account provisioning github workflow.
Some people have weird characters in their usernames/passwords, and don't escape them in the environment variables. We have a username & password fields separate from the DSN that do get escaped, so use those in the examples.
Also add some user login names that show we're not vulnerable to SQL injection attacks.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.