Repository navigation
Commit 054c91c
authored
getPurchaseDetails previously wrapped any GetExecutionByID error as a
plain fmt.Errorf, which the error handler converted to a 500. A 500
vs 404 difference let unauthenticated callers probe for execution UUID
existence (information disclosure via status code timing/value).
Map both error cases (err != nil, nil execution) to NewClientError(404)
so the handler is silent about whether a given UUID exists.
Update existing not-found tests to assert on the 404 status code.
Add TestHandler_getPurchaseDetails_NotFound_IsClientError as a focused
regression for this class of bug.
1 parent db5850e commit 054c91c
2 files changed
Lines changed: 45 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
1175 | | - | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
1176 | 1178 | | |
1177 | 1179 | | |
1178 | | - | |
| 1180 | + | |
1179 | 1181 | | |
1180 | 1182 | | |
1181 | 1183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1591 | 1591 | | |
1592 | 1592 | | |
1593 | 1593 | | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
1594 | 1598 | | |
1595 | 1599 | | |
1596 | 1600 | | |
| |||
1618 | 1622 | | |
1619 | 1623 | | |
1620 | 1624 | | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
1621 | 1662 | | |
1622 | 1663 | | |
1623 | 1664 | | |
| |||
0 commit comments