feat(vault): server-side pinning broker routes
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 54/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- next.js, typescript
Hướng nghiên cứu
Start by locating the existing /api/vault/pin* and /api/vault/quota/* route handlers, the session authentication and user-scoping code, and the Pinata and Lighthouse service adapters. Then read the route handler tests and run them to understand the current conventions. Done means adding authenticated broker routes for pin, unpin, and quota, with mocked-provider tests for success, auth, size limits, and typed errors that do not leak tokens.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Add session-authenticated routes that perform pin, unpin and quota calls to Pinata and Lighthouse on the server, so provider credentials never reach the browser.
Estimated size: M
Motivation
Provider tokens are currently shipped to every browser as NEXT_PUBLIC_* variables.
Current state in this repo
services/pinata.tsreadsNEXT_PUBLIC_PINATA_JWTandservices/lighthouse.tsreadsNEXT_PUBLIC_LIGHTHOUSE_KEYin the browser./api/vault/pin*and/api/vault/quota/*only record audit data; they do not call the providers.
Proposal
- Add
/api/vault/broker/pin,/unpinand/quotaroute handlers, authenticated with the existing session and scoped to the user. - Read credentials from server-only env vars (for example
PINATA_JWT,LIGHTHOUSE_API_KEY); choose the provider by request parameter. - Enforce a request body size limit and basic rate limiting.
- Additive only: leave the browser adapters untouched in this PR (they switch over in the follow-up).
Acceptance criteria
- Unauthenticated requests get 401.
- A pin, unpin and quota call succeeds through the broker against mocked providers.
- No provider secret is read from a
NEXT_PUBLIC_*variable on the broker path. - Errors from the provider are mapped to typed responses without leaking tokens into logs.
Out of scope
- Switching the browser adapters over (separate issue).
- New providers.
Dependencies
- None; can be picked up independently.
Testing plan
- Route handler tests with mocked provider HTTP; auth and size-limit cases.
Part of #43. Ground rules for the content layer: no secrets in the repo, content-layer failures must never block or discard quantum execution, and tests and docs ship with every PR.
- Ngôn ngữ chính
- Python
- Star
- 2
- Fork
- 4
- Merge trung bình
- 6 giờ 54 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không 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 QMeshPy/distributed-quantum
-
enhancement good first issue helia storage tier-1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QMeshPy/distributed-quantum#53 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chain-integration enhancement payments research-spike tier-2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
QMeshPy/distributed-quantum#78 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chain-integration enhancement payments research-spike tier-2
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
QMeshPy/distributed-quantum#77 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chain-integration enhancement payments tier-2
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
QMeshPy/distributed-quantum#76 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue kubo storage tier-1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 42/100
QMeshPy/distributed-quantum#75 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của QMeshPy/distributed-quantum
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Bump zizmor to 1.31.1+Đang mởgithub_actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
collective/icalendar#2003 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openzim/python-scraperlib#360 ·
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 82/100
volcengine/OpenViking#6445 ·
Maintainer thường phản hồi trong vòng 1 ngày