scribe-org / scribe-org/Scribe-Server
Add unit tests for database table name validators
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 12
- Forks
- 14
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 4
Description
Terms
- I have searched open and closed feature requests
- I agree to follow Scribe-Server's Code of Conduct
Description
Tests for database.IsValidTableName and IsValidTranslationTableName which are the only guard between user input and fmt.Sprintf("SELECT * FROM %s", ...).
Table names are interpolated, not parameterised, so a regex regression here is a SQL injection. Includes injection payloads, casing and suffix cases.
Contribution
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the definitions of database.IsValidTableName and IsValidTranslationTableName, then inspect the existing Go test layout and run the relevant package tests. Add unit coverage for injection payloads, casing, and suffix cases; done means the validators' accepted and rejected inputs are explicitly tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases, security, testing-qa
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 78/100