Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

The key is accepted only as a bearer token, and nothing says so

Abierto
#512 4 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 2 días

@krsnak ya está trabajando en esto.

Desde el 18/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

area:docs difficulty:easy help wanted points:100 Stellar Wave
Background

extractBearer reads Authorization: Bearer <key> and nothing else. That is a
reasonable choice, but it is only discoverable by reading src/api/auth.ts:
the README does not describe authentication, and a caller who sends
X-API-Key, a common convention and the one Linq's own API uses, gets a
401 saying the key is missing — which is confusing when they can see they sent
it.

What to build
  • Document authentication properly: the header, the format, how to get a key,
    what the quotas mean, and what each 401 code means (L247).
  • A worked example that runs as written.
  • Make the "missing key" message name the header it expected.
  • Decide whether to also accept X-API-Key. Accepting both is friendlier;
    accepting one is simpler. Either way, write the decision down rather than
    leaving it implicit in a helper function.
Acceptance criteria
  • Authentication is documented where a new caller will find it
  • The example works exactly as written
  • The missing-key error names the expected header
  • The decision on alternative headers is explicit
  • No real key appears in any example

Drips Wave · Complexity: Easy · 100 points


Repo: Divinity-Labs/Lens. Auth is src/api/auth.ts, key minting
src/api/admin.ts, usage reporting src/api/usage.ts, metering
src/x402/metering.ts, the ApiKey model in prisma/schema.prisma.

Run the tests: npm test. The tests are vitest, not jest. A single file
is npx vitest run src/__tests__/auth.test.ts.

Load test (prices) is already failing on main. Not your PR.

Do not weaken what is already right. Three things are correct today and
should survive every change here:

  • generateApiKey() is lens_ plus randomBytes(24) — 192 bits. Do not
    shorten it, and do not make it guessable or sequential.
  • hashApiKey() is an unsalted SHA-256. That is correct for a
    high-entropy random key: it must stay fast and deterministic so a lookup is
    one indexed query. Do not "improve" it into bcrypt or argon2 — those are for
    low-entropy human passwords, and here they would only make every request slow.
  • Only the hash is ever stored. The plaintext is returned once, at creation,
    and never again.

Admin routes carry config: { public: true }. That does not mean public —
it means "skip the API-key hook", because they enforce ADMIN_TOKEN instead.
Removing that flag locks the admin surface behind the keys it exists to mint.

Never elide an address, a key or a token in code, comments, tests or
documentation. Write it in full or not at all — and never write a real key
anywhere.



Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Lenguaje dominante
TypeScript
Estrellas
4
Forks
71
Merge medio
2 d 20 h
PR fusionados (30 d)
127

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Divinity-Labs/Lens

Todos los issues de Divinity-Labs/Lens

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.