npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@core-tecnologias-empresariales/core-auth

v0.1.0

Published

Políticas de identidad (rotación de refresh tokens, recuperación de contraseña) para el ecosistema Core Tecnología Empresarial. Agnóstico de base de datos.

Readme

@core-tecnologias-empresariales/core-auth

Políticas de identidad del ecosistema Core Tecnología Empresarial. Agnóstico de base de datos — no accede a ninguna DB (regla "no core-database" del CLAUDE.md); recibe estado, devuelve qué debe persistirse, y cada producto lo conecta a su propio storage.

v0.1 — qué incluye

Las dos políticas más específicas y más detalladas en CLAUDE.md:

Rotación de refresh tokens (§55)

import { rotateRefreshToken } from "@core-tecnologias-empresariales/core-auth";
import { generateSecureToken, hashToken } from "@core-tecnologias-empresariales/core-security";

const rawToken = generateSecureToken();
const result = rotateRefreshToken({
  presentedToken,       // el RefreshToken leído desde tu DB
  family,                // su RefreshTokenFamily
  nextTokenHash: hashToken(rawToken),
});

if (result.outcome === "reuse_detected") {
  // revocar toda la família + invalidar sesiones + registrar security event (core-audit)
} else {
  // persistir result.token, devolver rawToken (nunca el hash) al cliente
}

Un token ya usado, revocado, o con su familia revocada dispara reuse_detected — la respuesta correcta según CLAUDE.md es revocar toda la token_family e invalidar las sesiones asociadas (fuera del scope de este paquete: es una operación de persistencia).

Recuperación de contraseña (§59)

import { createPasswordResetRequest, validatePasswordResetCode } from "@core-tecnologias-empresariales/core-auth";
import { generateNumericCode, hashToken } from "@core-tecnologias-empresariales/core-security";

const code = generateNumericCode(6);              // se envía por Core Mail
const request = createPasswordResetRequest({ userId, codeHash: hashToken(code) });
// ...persistir request...

const result = validatePasswordResetCode({ request, presentedCodeHash: hashToken(codeFromUser) });
// "valid" | "invalid" (con attemptsRemaining) | "expired" | "already_used" | "too_many_attempts"

El código nunca se compara en texto plano ni se almacena sin hashear. El placeholder de UI (-----) es responsabilidad de core-ui, no de este paquete.

Para qué NO sirve (todavía — ponytail: diferido)

Sin consumidor real hoy, así que quedan fuera de v0.1 hasta que un producto los necesite:

  • Login/verificación de contraseña — usar directamente core-security (hashPassword/verifyPassword).
  • Modelo completo de sessions, users, mfa_methods, user_identities (SSO).
  • Repositorios/adapters de persistencia concretos.

Instalación

pnpm add @core-tecnologias-empresariales/core-auth

Desarrollo

pnpm build
pnpm test