fix(backend): enable forbidNonWhitelisted, batch team split inserts, remove dead split math, and harden DTO/pipe/OAuth scopes (#170, #150, #127, #112, #111, #104, #98) - #181
Open
ghzhost wants to merge 1 commit into
Conversation
…remove dead split math, and harden DTO/pipe/OAuth scopes (MergeFi#170, MergeFi#150, MergeFi#127, MergeFi#112, MergeFi#111, MergeFi#104, MergeFi#98)
|
Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
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 of Changes
Closes #170, #150, #127, #112, #111, #104, #98.
Global Validation Pipe hardening (Global ValidationPipe uses forbidNonWhitelisted: false, silently stripping unexpected request body fields instead of rejecting them #170):
forbidNonWhitelisted: trueinmain.tsso unknown body properties are rejected with a clear 400 rather than silently stripped.Batch Team Member Splits insertion (TeamsService.create issues one separate INSERT per team member split instead of a single batched insert #150):
TeamsService.createto batch split creation viathis.splitRepo.save(splitEntities)instead of N concurrent individual inserts.Drop Unused OAuth Scope (GithubStrategy requests the read:org OAuth scope but nothing in the codebase reads org membership data #127):
read:orgfromGithubStrategyscopes to adhere to least-privilege principles, leaving onlyuser:email.DTO Min/Max bounds on team splits (TeamMemberSplitDto.percentage has @IsNumber() but no @Min/@Max bound, unlike escrow's SplitRecipientDto #112):
@Min(0.01)and@Max(100)decorators toTeamMemberSplitDto.percentage.Remove Dead Split Math (computeSplitShares() in team-split.util.ts is unused dead code #111):
computeSplitSharesfromsrc/teams/team-split.util.tsand its spec file.ParseEnumPipe for Bounties status query filter (BountiesController.list's status query param has no @IsEnum validation #104):
new ParseEnumPipe(BountyStatus, { optional: true })toGET /bountiesstatus query param to reject invalid status values early with 400.Fix JwtModule expiresIn typing (JwtModule's expiresIn is cast via
as unknown as number, masking a string/number type mismatch #98):as unknown as numbercast with preciseas StringValue | numberusingmstype definitions.Verification
npm run buildsucceeds cleanly.npx jest --testPathIgnorePatterns="integration"passes all 20 test suites (161 tests).