Indexer: validate referrer query on GET /v1/referrals/applied (split from #2) #7

Closed
opened 2026-03-28 09:50:15 +00:00 by PlasticDigits · 7 comments
PlasticDigits commented 2026-03-28 09:50:15 +00:00 (Migrated from gitlab.com)

Split from #2. /v1/timecurve/buyer-stats rejects invalid addresses with 400; /v1/referrals/applied?referrer= does not.

Scope

  • When referrer is present, require 0x + 20-byte hex (same helper as buyer-stats) and return 400 with a clear JSON error otherwise.

Exit

  • Unit or integration assertion; no regression for omitted referrer (list-all mode).

Related: #2

Split from #2. `/v1/timecurve/buyer-stats` rejects invalid addresses with `400`; `/v1/referrals/applied?referrer=` does not. **Scope** - When `referrer` is present, require `0x` + 20-byte hex (same helper as buyer-stats) and return `400` with a clear JSON error otherwise. **Exit** - Unit or integration assertion; no regression for omitted `referrer` (list-all mode). Related: #2
PlasticDigits commented 2026-03-28 09:50:23 +00:00 (Migrated from gitlab.com)

mentioned in issue #2

mentioned in issue #2
PlasticDigits commented 2026-03-31 03:23:52 +00:00 (Migrated from gitlab.com)

@brouie Could you verify the fix on main?

  • #7 scope: GET /v1/referrals/applied — when referrer is present, invalid values (not 0x + 40 hex chars) return 400 with a JSON error body; omitted referrer still lists all (unchanged).
  • Related follow-up: rabbit /v1/rabbit/deposits and /withdrawals user= filter now uses the same valid_0x_address20 helper so non-hex 42-char strings are rejected too.

Leaving this issue open for your verification pass.

@brouie Could you verify the fix on `main`? - **#7 scope:** `GET /v1/referrals/applied` — when `referrer` is present, invalid values (not `0x` + 40 hex chars) return **400** with a JSON `error` body; omitted `referrer` still lists all (unchanged). - **Related follow-up:** rabbit `/v1/rabbit/deposits` and `/withdrawals` `user=` filter now uses the same `valid_0x_address20` helper so non-hex 42-char strings are rejected too. Leaving this issue **open** for your verification pass.
Brouie commented 2026-04-01 03:47:58 +00:00 (Migrated from gitlab.com)

partial verify -- invalid referrer returns 400 with proper error message: 'referrer must be a 0x-prefixed 20-byte address'. full list query needs postgres running, will confirm after stack restart.

partial verify -- invalid referrer returns 400 with proper error message: 'referrer must be a 0x-prefixed 20-byte address'. full list query needs postgres running, will confirm after stack restart.
Brouie commented 2026-04-01 06:15:25 +00:00 (Migrated from gitlab.com)

fully verified on d9987ca. invalid referrer returns 400 with error message. valid query returns paginated response with items/limit/offset/next_offset structure. no DOM errors on referrals page.

fully verified on d9987ca. invalid referrer returns 400 with error message. valid query returns paginated response with items/limit/offset/next_offset structure. no DOM errors on referrals page.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-04-02 04:22:36 +00:00
Brouie commented 2026-04-22 03:41:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #42

mentioned in issue #42
PlasticDigits commented 2026-06-25 20:07:11 +00:00 (Migrated from gitlab.com)

mentioned in issue #343

mentioned in issue #343
PlasticDigits commented 2026-06-25 20:07:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #342

mentioned in issue #342
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#7
No description provided.