Skip to content

Add config masking helper, wallet address validation, and integration tests#413

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
ritik4ever:issues/317-299-300-312-integration-tests-and-masking
Jun 2, 2026
Merged

Add config masking helper, wallet address validation, and integration tests#413
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
ritik4ever:issues/317-299-300-312-integration-tests-and-masking

Conversation

@ritik4ever
Copy link
Copy Markdown
Contributor

This PR addresses 4 issues: config masking, wallet address validation, and two new integration test suites for the creator list endpoint.

Changes

Issue #300 — Config masking helper for startup summary log

  • Added src/utils/config-mask.utils.ts with maskSensitiveConfigValues() that redacts values whose keys match sensitive patterns (SECRET, KEY, PASSWORD, TOKEN, and DATABASE_URL)
  • Sensitive values are partially masked (first 4 / last 4 characters preserved); DATABASE_URL has its embedded credentials redacted
  • Non-sensitive config values pass through unchanged
  • Applied at startup in server.ts via a logger.info call with the masked config

Issue #299 — Integration test for malformed wallet address param

  • Added Stellar address format validation to requireCreatorProfileOwnership middleware using the existing StellarAddressSchema (56 chars, starts with G, Base32)
  • Malformed addresses (wrong length, invalid characters) now return 400 with a standard error shape
  • Added 3 new integration test cases in creator-profile-protected.integration.test.ts covering wrong length, invalid characters, and valid addresses
  • Mounted creator.routes.ts in modules/index.ts so the profile endpoints are accessible

Issue #317 — Integration test for creator list response shape consistency

  • Added src/__tests__/integration/creator-list-response-shape.test.ts
  • Requests the creator list with page sizes 1, 10, and MAX_PAGE_SIZE (100)
  • Asserts the top-level response envelope (success, data.items, data.meta) is identical across all sizes
  • Asserts items.length matches the requested page size and pagination metadata reflects the correct limit and total

Issue #312 — Integration test for concurrent creator list requests

  • Added src/__tests__/integration/creator-list-concurrent.test.ts
  • Fires 3 simultaneous GET /api/v1/creators requests
  • Asserts all responses return identical item sets and pagination metadata
  • Uses a read-only fixture with no concurrent writes

Infrastructure

  • Configured Jest roots: ["<rootDir>/src"] to prevent stale dist/ test artifacts from interfering

Testing

  • All 28 tests directly related to these changes pass
  • pnpm lint and pnpm build pass cleanly

Closes #317
Closes #299
Closes #300
Closes #312

… tests

- Add maskSensitiveConfigValues() helper to redact secrets and credentials
  from startup config summary logs (accesslayerorg#300)
- Add Stellar address format validation to requireCreatorProfileOwnership
  middleware, returning 400 for malformed wallet addresses (accesslayerorg#299)
- Add integration test for creator list response shape consistency across
  page sizes of 1, 10, and 100 (accesslayerorg#317)
- Add integration test for concurrent creator list requests returning
  consistent results (accesslayerorg#312)
- Mount creator module routes in modules/index.ts so profile endpoints
  are accessible
- Configure Jest roots to src/ to prevent stale dist test artifacts
  from interfering with test runs
@Chucks1093 Chucks1093 merged commit c9e6e48 into accesslayerorg:main Jun 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants