Skip to content

Commit 9fd4b0e

Browse files
authored
Merge pull request #166 from abdegenius/feat/emergency-sweep
Feat/emergency sweep
2 parents 8091e71 + f3db25b commit 9fd4b0e

59 files changed

Lines changed: 14630 additions & 137 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
"Bash(find /home/ljtwp/Desktop/drips/niff -type f -name *.sol -o -name *.rs -o -name *.ts -o -name *.tsx -o -name *.js -o -name *.jsx)",
55
"Bash(cargo test:*)",
66
"Bash(cargo fmt:*)",
7-
"Bash(cargo clippy:*)"
7+
"Bash(cargo clippy:*)",
8+
"Bash(npm install:*)",
9+
"Bash(node -e \"const { rpc } = require\\(''''@stellar/stellar-sdk''''\\); console.log\\(Object.keys\\(rpc\\)\\);\")",
10+
"Bash(grep -r ThemeProvider /home/ljtwp/Desktop/drips/niff/frontend/src/ --include=*.tsx --include=*.ts -l)",
11+
"Bash(grep -n \"toast\\\\|useToast\" /home/ljtwp/Desktop/drips/niff/frontend/src/app/policy/[id]/claim/page.tsx)",
12+
"Bash(git -C /home/ljtwp/Desktop/drips/niff add frontend/package-lock.json)",
13+
"Bash(git -C /home/ljtwp/Desktop/drips/niff status --short)",
14+
"Bash(npm audit:*)",
15+
"Bash(echo \"EXIT:$?\")"
816
]
917
}
1018
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ build/
1717
*.tsbuildinfo
1818
pnpm-lock.yaml
1919
package-lock.json
20+
!frontend/package-lock.json
2021

2122
# Env / secrets
2223
.env

backend/package-lock.json

Lines changed: 53 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/specs/claim-rate-limiting/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ The implementation uses Redis for O(1) counter operations, NestJS guards for req
196196
- Log initialization status
197197
- _Requirements: 6.1, 6.2, 6.3_
198198

199-
- [x] 12. Add OpenAPI documentation
199+
- [ ] 12. Add OpenAPI documentation
200200
- [x] 12.1 Document rate limit responses
201201
- Add @ApiResponse decorators for 429 status to claim endpoints
202202
- Document RateLimitException response schema

backend/src/__tests__/cors.property.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ describe("Feature: cors-helmet-security-headers, Property 2", () => {
103103
// Should echo the exact origin string (not true, not false)
104104
return (
105105
calledWith !== null &&
106-
(calledWith as any).err === null &&
107-
(calledWith as any).allow === origin
106+
(calledWith as { err: unknown; allow: unknown }).err === null &&
107+
(calledWith as { err: unknown; allow: unknown }).allow === origin
108108
);
109109
},
110110
),
@@ -141,8 +141,8 @@ describe("Feature: cors-helmet-security-headers, Property 3", () => {
141141
// Should call cb with an Error and false
142142
return (
143143
calledWith !== null &&
144-
(calledWith as any).err instanceof Error &&
145-
(calledWith as any).allow === false
144+
(calledWith as { err: unknown; allow: unknown }).err instanceof Error &&
145+
(calledWith as { err: unknown; allow: unknown }).allow === false
146146
);
147147
},
148148
),
@@ -159,7 +159,7 @@ describe("Feature: cors-helmet-security-headers, Property 4", () => {
159159
* Validates: Requirements 2.4
160160
*/
161161
fc.assert(
162-
fc.property(fc.constant(null), (_) => {
162+
fc.property(fc.constant(null), () => {
163163
return CORS_CONFIG.credentials === true;
164164
}),
165165
{ numRuns: 100 },
@@ -175,7 +175,7 @@ describe("Feature: cors-helmet-security-headers, Property 5", () => {
175175
* Validates: Requirements 2.6, 2.7
176176
*/
177177
fc.assert(
178-
fc.property(fc.constant(null), (_) => {
178+
fc.property(fc.constant(null), () => {
179179
const requiredHeaders = [
180180
"Authorization",
181181
"Content-Type",
@@ -214,7 +214,7 @@ describe("Feature: cors-helmet-security-headers, Property 6", () => {
214214
fc.assert(
215215
fc.property(
216216
fc.array(fc.string({ minLength: 1 }), { minLength: 1 }),
217-
(allowlist) => {
217+
() => {
218218
return (
219219
CORS_CONFIG.maxAge === 86400 &&
220220
CORS_CONFIG.optionsSuccessStatus === 204 &&

backend/src/__tests__/cors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function buildTestApp(frontendOrigins: string[], adminOrigins: string[] = []) {
5959
origin: (origin, cb) => {
6060
if (!origin) return cb(null, true);
6161
const allowed = [...frontendOrigins, ...adminOrigins];
62-
if (allowed.includes(origin)) return cb(null, origin as any);
62+
if (allowed.includes(origin)) return cb(null, origin);
6363
return cb(new Error("Not allowed by CORS"));
6464
},
6565
credentials: true,

backend/src/admin/admin.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class AdminController {
114114
@HttpCode(HttpStatus.ACCEPTED)
115115
@ApiOperation({ summary: 'Submit a privacy request (anonymize or delete off-chain data)' })
116116
async submitPrivacyRequest(@Body() dto: PrivacyRequestDto, @Req() req: Request) {
117-
const actor = (req.user as any)?.walletAddress ?? 'unknown';
117+
const actor = (req.user as { walletAddress?: string })?.walletAddress ?? 'unknown';
118118
return this.privacyService.handleRequest({
119119
subjectWalletAddress: dto.subjectWalletAddress,
120120
requestType: dto.requestType,

backend/src/cache/redis.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export class RedisService implements OnModuleDestroy {
3737
await this.client.quit();
3838
}
3939

40+
getClient(): Redis {
41+
return this.client;
42+
}
43+
4044
/**
4145
* Get cached value
4246
*/

backend/src/claims/claims.controller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { SubmitTransactionDto } from './dto/submit-transaction.dto';
2626
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
2727
import { WalletAddress } from '../auth/decorators/wallet-address.decorator';
2828
import { RateLimitGuard } from '../rate-limit/rate-limit.guard';
29+
import { MAX_LIMIT, DEFAULT_LIMIT } from '../helpers/pagination';
2930

3031
@ApiTags('claims')
3132
@Controller('claims')

backend/src/claims/claims.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { Injectable, Logger, NotFoundException } from '@nestjs/common';
22
import { ConfigService } from '@nestjs/config';
33
import { Prisma } from '@prisma/client';
44
import { SorobanService } from '../rpc/soroban.service';
5+
import { PrismaService } from '../prisma/prisma.service';
6+
import { RedisService } from '../cache/redis.service';
7+
import { SanitizationService } from './sanitization.service';
58
import {
69
ClaimDetailResponseDto,
710
ClaimMetadataDto,

0 commit comments

Comments
 (0)