Commit Graph

  • dbe1600632 fix: indentation Kharec 2025-11-23 14:49:31 +01:00
  • 458e25cf79 fix: modify compression middleware to pass through redirects immediately without buffering Kharec 2025-11-23 14:48:59 +01:00
  • d4595d8dbf fix: properly encoding the flash message in the redirect URL Kharec 2025-11-23 14:48:39 +01:00
  • c5418f4e4c docs: update swagger Kharec 2025-11-23 14:26:52 +01:00
  • db0369225e refactor: update references to VoteRequest Kharec 2025-11-23 14:26:45 +01:00
  • 07ac965b3d refactor: use consistent naming (VoteRequest -> CastVoteRequest) Kharec 2025-11-23 14:26:19 +01:00
  • e2e5d42035 feat: add SetValidatedDTOInContext to support test helper functions Kharec 2025-11-23 14:22:59 +01:00
  • 6e4b41894f fix: update test cases to use createCreatePostRequests Kharec 2025-11-23 14:22:35 +01:00
  • 0a8ed2e27c fix: add explicite validation check for empty url, title and content length Kharec 2025-11-23 14:21:30 +01:00
  • 216e8657f6 feat: add generic createRequestWithDTO along with helpers functions Kharec 2025-11-23 14:20:59 +01:00
  • fb7206c0a2 fix: test context handling Kharec 2025-11-23 14:20:09 +01:00
  • c25926514b fix: add explicit empty-field validation check in handlers Kharec 2025-11-23 14:19:54 +01:00
  • 964785e494 docs: update swagger Kharec 2025-11-23 13:47:38 +01:00
  • 9c67cd2a47 feat: update vote handler to use dto VoteRequest and update MountRoutes Kharec 2025-11-23 13:47:31 +01:00
  • 8b5cc8e939 feat: add VoteRequest with its validation types Kharec 2025-11-23 13:46:51 +01:00
  • 0e71b28615 feat: update CreateUser to use dto.RegisterRequest and update MountRoutes to apply validation middleware Kharec 2025-11-23 13:43:47 +01:00
  • cd740da57a feat: update methods to use validated DTOs and update MountRoutes Kharec 2025-11-23 13:43:14 +01:00
  • abe4a3dc88 feat: update handlers to use GetValidatedDTO instead of manual decoding and update MountRoutes to wrap handlers with WithValidation for all DTO-based routes Kharec 2025-11-23 13:42:52 +01:00
  • 738243d945 feat: add ValidationMiddleware to RouteModuleConfig Kharec 2025-11-23 13:41:55 +01:00
  • 4fbdfb6e4a feat: add two helpers function to retrieve validated DTOs from request context and to apply validation middleware Kharec 2025-11-23 13:41:07 +01:00
  • 6bb3a78b88 feat: Add ValidationMiddleware to router configuration Kharec 2025-11-23 13:40:31 +01:00
  • 54e37e59fc docs: update swagger Kharec 2025-11-23 13:35:00 +01:00
  • 5d4b38ddc4 feat: add validation tags to request DTOs Kharec 2025-11-23 13:34:53 +01:00
  • 7dc119ecde docs: update swagger Kharec 2025-11-23 13:17:14 +01:00
  • 52c9f4a02b feat: add internal/dto to swagger directories Kharec 2025-11-23 13:16:44 +01:00
  • be91a135bc clean: empty line Kharec 2025-11-23 13:14:41 +01:00
  • 2d7ff9778b feat: update swagger comments following dtos relocation Kharec 2025-11-23 13:14:07 +01:00
  • 4ff3fd3583 refactor: remove UpdatePostRequest definition and update swagger comments Kharec 2025-11-23 13:13:53 +01:00
  • 73121cad15 refactor: remove all request DTO, update swagger comments and update token related methods to use dto ones Kharec 2025-11-23 13:13:23 +01:00
  • c5bf1b2fd8 feat: locate post-related request DTOs Kharec 2025-11-23 13:12:36 +01:00
  • eedebe60d1 feat: locate auth-related request DTOs Kharec 2025-11-23 13:12:10 +01:00
  • 80fb37371f update: fix go version and update alpine to 3.22 Kharec 2025-11-23 10:44:28 +01:00
  • fea49fad8d fix: add missing method to mock Kharec 2025-11-21 17:07:22 +01:00
  • 4b04461ebb style: minor formatting adjustments Kharec 2025-11-21 17:06:04 +01:00
  • 533e8c3d46 feat: add GetByUsernamePrefixFn field and method to UserRepositoryStub Kharec 2025-11-21 17:05:48 +01:00
  • df568291f1 feat: add GetByUsernamePrefix implementation to MockUserRepository Kharec 2025-11-21 17:05:31 +01:00
  • 81acce62b1 feat: add GetByUsernamePrefix method to interface and add implementation Kharec 2025-11-21 17:05:01 +01:00
  • 989a61e7d5 feat: use getByUsernamePrefix to optimize findExistingSeedUser() Kharec 2025-11-21 17:04:35 +01:00
  • 3ffd83b0fb feat: ignore docs in make format Kharec 2025-11-21 17:02:06 +01:00
  • 62d466e4fa refactor: use go generics Kharec 2025-11-21 16:56:26 +01:00
  • 0cd428d5d9 feat: use connection pooling instead of a single connection Kharec 2025-11-21 16:53:46 +01:00
  • 5c239ad61d feat: add missing GetVoteCountsByPostID method to the errorVoteRepository test mock Kharec 2025-11-21 16:50:23 +01:00
  • 01f2b1fe75 feat: remove loop and use GetVoteCountsByPostID Kharec 2025-11-21 16:48:48 +01:00
  • 28134c101c feat: add GetVoteCountsByPostID to the mock for testing Kharec 2025-11-21 16:48:15 +01:00
  • 2f78370d43 feat: GetVoteCountsByPostID: use a single sql query to returns up votes and down votes counts Kharec 2025-11-21 16:47:52 +01:00
  • 39598a166d feat: remove redundat getbyemail call to reduce db query by 2 (1Q/user creation instead of 2) Kharec 2025-11-21 16:43:46 +01:00
  • fa9474d863 revert: db transaction use, avoiding the pgx RETURNING issue while maintaining data consistency Kharec 2025-11-21 16:31:06 +01:00
  • 34a97994b3 feat: improve testing to use production code paths and better coverage Kharec 2025-11-21 16:26:21 +01:00
  • eb5f93ffd0 clean: remove duplicate sequential helpers Kharec 2025-11-21 16:25:27 +01:00
  • 697f201d60 feat: use database transactions to ensure atomicity Kharec 2025-11-21 16:21:04 +01:00
  • f4ab8bda45 feat: transaction rollback test Kharec 2025-11-21 16:20:41 +01:00
  • 65576cc623 feat: keep seeding fast and predictable even when parallelized Kharec 2025-11-21 16:16:35 +01:00
  • a5b4e9bf25 feat: update tests to pass precomputed hashes Kharec 2025-11-21 16:11:42 +01:00
  • c020517ccf feat: reduce hashing cost by removing redundant password hashing Kharec 2025-11-21 16:11:33 +01:00
  • 4cdda3f944 feat: remove bcrypt and use a precompute hash Kharec 2025-11-21 16:11:08 +01:00
  • ff471cd5dd fix: loop Kharec 2025-11-21 15:39:08 +01:00
  • df5e67c7f3 feat: add idempotency tests Kharec 2025-11-21 15:34:08 +01:00
  • b2580d2380 feat: make seeding idempotente Kharec 2025-11-21 15:33:59 +01:00
  • 4749213bf0 feat: update test to accept randomized seed user identities Kharec 2025-11-21 15:26:29 +01:00
  • 6470425b96 feat: avoid unique constraint failures on repeat runs by randomizing seed identities Kharec 2025-11-21 15:26:05 +01:00
  • 14ae6f815b feat: update tests to verify clamping Kharec 2025-11-21 15:21:05 +01:00
  • 73083e4188 feat: check zero/negative value in seeding Kharec 2025-11-21 15:20:57 +01:00
  • c907c4812b feat: add tests covering negative values for the three flags Kharec 2025-11-21 14:56:09 +01:00
  • c7f30070c0 feat: reject negative/nonsensical flag values with a clear error instead of letting slice/channel allocations panic Kharec 2025-11-21 14:55:51 +01:00
  • 0dcd5fec51 fix: Makefile fuzz target to enumerate fuzz functions per package and run each individually Kharec 2025-11-21 14:30:37 +01:00
  • 96c054aa99 feat: add new parameter Kharec 2025-11-21 13:13:27 +01:00
  • bdd7766275 docs: update readme Kharec 2025-11-21 13:13:18 +01:00
  • 0b1241d371 docs: update readme Kharec 2025-11-21 13:11:47 +01:00
  • b300fc2f5e feat: new test for json output flag from config Kharec 2025-11-21 13:11:43 +01:00
  • f49bea4138 feat(config): read a flag in .env to set or not json output Kharec 2025-11-21 13:11:16 +01:00
  • 79e072fe6b feat(cli): read .env value to set or not the json output Kharec 2025-11-21 13:10:53 +01:00
  • 7fca1f78dc feat(cli): add a json output and tests Kharec 2025-11-21 12:59:36 +01:00
  • 30a2e88685 docs: update readme Kharec 2025-11-20 18:55:08 +01:00
  • 10f7220fb6 feat: install pg 18 Kharec 2025-11-20 18:55:05 +01:00
  • 08a934e388 feat: migrate to postgres 18 Kharec 2025-11-20 18:54:58 +01:00
  • 87dadfa4a8 feat: modernize loops Kharec 2025-11-19 13:13:51 +01:00
  • 53c76eee8b feat: modernize loop Kharec 2025-11-17 16:24:40 +01:00
  • 446915d5ee feat: modernize loop Kharec 2025-11-17 15:59:24 +01:00
  • dceb305ac7 feat: modernize statement using max() Kharec 2025-11-17 15:37:03 +01:00
  • e5b1f18beb docs: update readme regarding our new linting configuration Kharec 2025-11-15 11:45:54 +01:00
  • 513e0c05b2 feat: creating my own hell by adding a suitable configuration for golangci-lint Kharec 2025-11-15 11:45:42 +01:00
  • ba09bb4141 lint: fix staticcheck nil pointer issue Kharec 2025-11-15 11:35:31 +01:00
  • 0f9a89bfc7 lint: add error checks on Register() and fix sqlDB.Close() errcheck Kharec 2025-11-15 11:34:57 +01:00
  • 1d1a3dcf60 lint: make linter happy with errcheck Kharec 2025-11-15 11:34:12 +01:00
  • 2b31e80fa1 docs: not necessarily tailwind tbh Kharec 2025-11-15 11:22:41 +01:00
  • 6a513bbcac refactor: simplify return in ValidateFuzzInputStrict() Kharec 2025-11-14 07:16:54 +01:00
  • 69e61c5811 feat: use SplitSeq Kharec 2025-11-14 07:16:20 +01:00
  • 9dfef1d67f refactor: replace if/else chain with switch statement Kharec 2025-11-14 06:59:47 +01:00
  • e171776055 refactor: replace if/else chain with switch statement Kharec 2025-11-14 06:59:18 +01:00
  • 1f703fb8c0 clean: remove dead code and now unused functions and types Kharec 2025-11-14 06:58:05 +01:00
  • ba17fa1b5a clean: remove now unused helpers Kharec 2025-11-14 06:50:14 +01:00
  • 8b01f79c8e fix: use .Pointer Kharec 2025-11-13 19:33:07 +01:00
  • 34b7c509ec feat: use createUserWithCleanup for automatic test cleanup Kharec 2025-11-13 08:17:27 +01:00
  • 32eeb76ee9 fix: check for empty header in assertHeader() Kharec 2025-11-13 08:17:11 +01:00
  • b2d255cc0d refactor: use assertCookie and createUserWithCleanup helpers Kharec 2025-11-13 08:16:06 +01:00
  • ff73d2919d refactor: use assertHeader and createUserWithCleanup helpers Kharec 2025-11-13 08:15:56 +01:00
  • 5725cf21ce refactor: use assertHeader helper for Retry-After check Kharec 2025-11-13 08:15:35 +01:00
  • ac81ce66ff refactor: use assertCookie helper for auth token check Kharec 2025-11-13 08:15:21 +01:00
  • aeee85934c refactor: use createUserWithCleanup for automatic test cleanup Kharec 2025-11-13 08:15:07 +01:00
  • 6b63cacf14 refactor: use assertHeaderContains helper for compression header checks Kharec 2025-11-13 08:14:45 +01:00