Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Twelve live routes declare no access control

Aperta
#626 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
graphql, postgresql, typescript

Direzione di ricerca

Start with the guard in tests/openapi.test.ts and its UNDECLARED_LEGACY set, then review the route definitions and the field-level scope handling in #623. Audit existing API keys and their scopes before deciding which routes should be public or require read:prices; for scoped routes, the scope must be granted to existing keys before adding the requirement. Done means each route is resolved and removed from the legacy set, while /graphql remains excluded.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

The guard added in 4cd27d5 (tests/openapi.test.ts → "declares access control on every non-internal route") found twelve routes already serving with no API-key scope, no public: true, and no admin config:

Route Likely intent
GET /usage, GET /usage/me authenticated — they report the calling key's own usage
GET /impact/{assetA}/{assetB} read:prices
GET /movers read:prices
GET /rates, GET /rates/{asset} read:prices
GET /correlation read:prices
GET /dispersion, GET /dispersion/{assetA}/{assetB} read:prices
POST /pairs the one to look at first — a POST with no declared gate
GET /graphql, POST /graphql deliberate, see below

They are frozen in a UNDECLARED_LEGACY set in that test so no new route can join them. The list may shrink; it must not grow.

Why they are not simply fixed. Adding a scope to a live route refuses every existing key that lacks it. Keys minted before a scope existed will not carry it, so this is a breaking change for current integrations — the same shape as the offramp auth change that had to ship client-first. It needs a decision and probably a sequence, not a patch.

A workable order:

  1. Audit which keys exist and what scopes they carry.
  2. Decide per route: is it genuinely public (then mark public: true and the question is closed), or should it require read:prices?
  3. For the ones that should be scoped, grant the scope to existing keys first, then add the requirement.
  4. Remove each from UNDECLARED_LEGACY as it is resolved.

POST /pairs is worth looking at ahead of the rest. The others are reads where the worst case is unmetered access to public market data; a POST that any caller can reach is a different category.

/graphql stays excluded on purpose. #623 enforces scope per field against FIELD_SCOPES, because a single route-level scope cannot describe a document that selects fields with different requirements. Adding one there would be wrong, not missing.

Lingua principale
TypeScript
Stelle
4
Fork
71
Merge medio
3g 14h
PR unite (30g)
157

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Divinity-Labs/Lens

Tutte le issue di Divinity-Labs/Lens

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.