MemoryStore should evict claims once their challenge expires
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Xem xét interface Store và triển khai MemoryStore, sau đó theo dõi TempoChargeIntent.matchTransferLogs và flow challenge đã được xác minh của nó. Xác nhận cách memo giao dịch có thể liên kết một khoản thanh toán với một challenge duy nhất trước khi thay đổi cách xử lý claim. Hoàn thành khi có thể loại bỏ các claim đã hết hạn mà không cho phép replay attack, đồng thời vẫn giữ interface và payment flow nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bind replay claims to challenge expiry. Ex. tryClaim(key, expiresAt).
Background
Store.tryClaim(key) (added in #24) retains transaction-hash claims forever. Every verified payment leaves a permanent entry, so any durable store grows without bound.
The typescript mppx SDK solved this by storing a marker that lapses at the challenge's expiry. One a challenge has expired, there's no reason to keep a cache entry for its associated transaction as it can no longer be claimed by an agent.
Using an expiry/TTL is safe in the typescript SDK because it cryptographically binds on-chain transaction memos to to a specific challenge. Therefore, a settled transaction can only satisfy exactly one challenge.
The mpp-java SDK has no such binding. TempoChargeIntent.matchTransferLogs compares only
currency, recipient, amount, and sender. Adding claim expiry would be a regression and make servers susceptible to replay attacks.
Proposed change
Implement memo binding between on-chain transactions and challenges. Then, once memo binding is in place, update the Store interface:
@FunctionalInterface
public interface Store {
boolean tryClaim(String key);
/** Claims {@code key} until {@code expiresAt}, after which the claim may be dropped. */
default boolean tryClaim(String key, Instant expiresAt) {
return tryClaim(key);
}
}
TempoChargeIntent should pass the verified challenge's expires as expiresAt.
Why?
- Prevents unbound growth in MemoryStore
- Achieves parity with other SDKs
- Ngôn ngữ chính
- Java
- Star
- 8
- Fork
- 8
- Merge trung bình
- 14 giờ 52 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stripe/mpp-java
Tất cả issue của stripe/mpp-java
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Black theme and viewing mode.Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
oracle/javavscode#652 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenAPITools/openapi-generator#25014 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
AloisSeckar/demos-java#380 ·