Skip to content

[Audit] Stellar public-key regex duplicated instead of importing the existing validator constant #1272

Description

@K1NGD4VID

Filed from the second-wave repository audit (issue 70/100). See the audit summary for full category context.

  • Location: backend/src/controllers/user.controller.ts:94, 122 vs. backend/src/validators/user.validator.ts:11
  • Problem: getUser/getUserEvents re-declare /^G[A-Z2-7]{55}$/ inline instead of importing STELLAR_PUBLIC_KEY_REGEX, which already exists for exactly this purpose.
  • Evidence: Duplicated regex literal versus an existing named export for the same pattern.
  • Suggested implementation: Import and use STELLAR_PUBLIC_KEY_REGEX from the validator module in both locations.
  • Acceptance criteria: No inline Stellar-address regex literals remain outside the validator module.
  • Difficulty: S
  • Expected impact: Removes a small but real drift risk (e.g. a future format change updated in one place but not the other).

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksrefactorRefactoring existing codesecond-wave-auditFiled from the second-wave repo audit (100 issues)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions