security: verify OC orders, fail-closed revoke, per-IP rate buckets, escaped guest email
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
1 parent
5a0a3decbe
commit
c9726f4029
6 files changed
+264
-104
No files matched your search
@@ -38,6 +38,7 @@ def check(cond, msg):
|
||||
|
||||
def order(freq, status, amount, created="2026-11-17T01:52:56.450Z"):
|
||||
return {"frequency": freq, "status": status,
|
||||
"amount": {"value": amount, "currency": "USD"},
|
||||
"totalAmount": {"value": amount, "currency": "USD"},
|
||||
"createdAt": created, "lastChargedAt": created}
|
||||
|
||||
@@ -76,11 +77,11 @@ check(_current_dues([{"frequency": "MONTHLY", "status": "ACTIVE",
|
||||
"totalAmount": {"value": "not-a-number"}}]) == (None, None),
|
||||
"an unparseable amount -> (None, None)")
|
||||
|
||||
print("6. the most recent live recurrence wins when a member has history")
|
||||
print("6. stacked live monthlies are summed (not newest-only)")
|
||||
old = order("MONTHLY", "ACTIVE", 5, "2024-01-01T00:00:00.000Z")
|
||||
new = order("MONTHLY", "ACTIVE", 10, "2026-11-17T01:52:56.450Z")
|
||||
check(_current_dues([new, old]) == (10.0, "MONTHLY"),
|
||||
"the newest live monthly ($10) wins over an older $5 monthly")
|
||||
check(_current_dues([new, old]) == (15.0, "MONTHLY"),
|
||||
"two live monthly subscriptions are summed ($5 + $10 = $15)")
|
||||
|
||||
print()
|
||||
if FAILS:
|
||||
|
||||
Reference in new issue
Block a user