Agents auth follow-up: claim-scoped write tokens, shared-state auth, and distributed validity
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
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- authentication, backend-api-design, distributed-systems
Hướng nghiên cứu
Bắt đầu bằng cách lần theo các đường đi của Runtime, forwarding server, các thao tác ghi của Entity Main Stream và các đường dẫn append vào shared state được mô tả trong issue. Kiểm tra việc xử lý callback đối với các phản hồi HTTP 200 chứa { ok: false }. Được xem là hoàn tất khi các thao tác ghi vào shared state được fencing, token mới nhất hợp lệ qua các lần khởi động lại và giữa các instance, đồng thời tính hợp lệ của token tuân theo vòng đời của claim hoặc lease.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The recent stale-epoch fix for Electric Agents moved entity-stream write fencing from durable-stream producer epochs to claim-scoped write tokens plus autoClaim on the runtime producer. That is the right direction, but it leaves a broader auth/distribution follow-up.
Current state
- Entity main-stream writes now use claim-scoped write tokens minted on successful wake claim.
- Entity main-stream writes are validated against the currently active claim token when one exists.
- Runtime producers use
autoClaimto recover when durable streams has a higher remembered producer epoch.
Follow-up gaps
1. Shared-state writes are still effectively unauthenticated
Shared-state producers can now also autoClaim, but shared-state append paths do not currently enforce bearer-token auth the same way entity main streams do.
That means stale or unauthorized shared-state writers are not fenced by the same claim-token mechanism.
2. Claim-token validity is process-local and not lease-coupled
Active claim write tokens are currently held in memory on the server.
Consequences:
- after server restart, active claim state is lost;
- in a distributed/cloud deployment, different server instances will not share claim-token validity;
- token validity is not currently refreshed/expired based on webhook heartbeat or lease expiry.
We need a real mechanism for tracking the latest and only valid write authority for a claimed stream across instances. This does not require JWT specifically; durable/shared server-side state is fine.
3. Entity-token fallback is still compatibility behavior, not a strict final invariant
Today the entity write token is still accepted when no active claim token is present.
That is useful for compatibility, but it means the invariant is only:
while an active claim is present, only that claim token may write
and not yet:
only the current claimed worker may write
4. Callback-forward / done semantics should be audited
The runtime and forwarding server mostly key off HTTP success today. We should confirm whether callback responses can be 200 with { ok: false }, and tighten handling if so.
Goal
Design and implement the actual auth model for Agents writes in a distributed deployment:
- define write authority for entity streams and shared-state streams;
- make "latest valid token" tracking work across server restarts / multiple instances;
- couple claim-token validity to claim/lease lifecycle;
- close the shared-state auth gap.
Context
This came up while fixing stale producer epoch errors like:
- wake consumer epoch is low after restart/reclaim;
- durable streams remembers a higher producer epoch for the same producer id;
- runtime must use
autoClaimto recover; - correctness therefore depends on auth fencing stale writers, not on producer epochs alone.
- Ngôn ngữ chính
- TypeScript
- Star
- 10.4k
- Fork
- 399
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay 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 electric-sql/electric
-
camelToSnake and snakeCamelMapper() drop the underscore when a digit precedes a camelCase boundaryĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
electric-sql/electric#4855 ·
-
ShapeStream does not notify subscribers when it gives up on a non-Error valueCó thể đã có người làm @Tyagiquamar đã nhận 19 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
electric-sql/electric#4830 ·
-
@electric-sql/client throws SecurityError on import when the browser blocks site storage (typeof localStorage outside try)Có thể đã có người làm @mohanedmoh đã nhận 37 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
electric-sql/electric#4826 · 1 bình luận ·
-
agents-chat-starter: spawn PUT goes to the durable-streams proxy, so no entity is created and agents never wakeCó thể đã có người làm @adityavkk đã nhận 133 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
electric-sql/electric#4687 ·
-
Listen IP addressĐang mởfeature request triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
electric-sql/electric#4150 · 1 bình luận ·
Tất cả issue của electric-sql/electric
Issue tương tự
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openclaw/openclaw#199885 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
feature needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
sequant-io/sequant#1689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100