Commit 3c6dcac
refactor: replace emulator with WireMock, add E2E encryption and rate-limit tests
- Replace custom phone emulator with WireMock for FCM and webhook stubs
- Refactor tests to use httpsms-go SDK instead of raw HTTP calls
- Add TestSendSMS_Encrypted: E2E encryption round-trip verification
- Add TestReceiveSMS_Encrypted: incoming encrypted message test
- Add TestSendSMS_RateLimit: verify >=6s gap between FCM pushes (10 msg/min)
- Add TestSendSMS_OutstandingFlow: verify outstanding message retrieval
- All tests assert webhook JWT (HMAC-SHA256, claims validation)
- Each test creates isolated phone with random number for parallel execution
- Update CI workflow: checkout httpsms-go SDK, increase test timeout to 300s
- Simplify seed.sql to only user data (phones created dynamically)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent e58acfd commit 3c6dcac
20 files changed
Lines changed: 677 additions & 461 deletions
File tree
- .github/workflows
- tests
- emulator
- wiremock/mappings
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
| |||
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
62 | | - | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
31 | 30 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
37 | 34 | | |
38 | | - | |
| 35 | + | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
| |||
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
53 | | - | |
| 50 | + | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments