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

@digelim/identity

v0.1.0

Published

Backend-only identity integration module for the Signal Framework. This package provides secure, transport-agnostic authentication orchestration for OAuth and OIDC style providers, plus a clean extension interface for custom providers.

Readme

Signal Identity Module

Backend-only identity integration module for the Signal Framework. This package provides secure, transport-agnostic authentication orchestration for OAuth and OIDC style providers, plus a clean extension interface for custom providers.

Purpose

  • Normalize external provider identities into a consistent auth model.
  • Provide secure auth flow orchestration without tying to a web framework.
  • Offer clear boundaries and ports for persistence, crypto, HTTP, and logging.

Features

  • Built-in providers: Google, Apple, LinkedIn, GitHub, Facebook.
  • Pluggable provider interface for custom integrations.
  • Stateful auth orchestration with PKCE and nonce support.
  • Safe account resolution, linking, and unlinking with guardrails.
  • Transport-agnostic Signal capability handlers.
  • Typed results and structured errors.
  • In-memory adapters for tests and reference use.

Architecture Overview

  • Domain: core models, errors, and events.
  • Application: auth orchestration, config validation, provider registry.
  • Providers: built-in and custom provider implementations.
  • Ports: persistence, crypto, HTTP, logging, time.
  • Adapters: in-memory stores, system crypto, fetch HTTP client.
  • Signal: capability definitions and handler wrappers.

See docs/ARCHITECTURE.md for details.

Install

This module is intended to be used within the Signal Framework workspace.

pnpm -C server/identity install

Configuration

import { createAuthService } from './src/application/auth-service';
import { createDefaultProviderRegistry } from './src/application/provider-registry';
import {
  MemoryAuthStateRepository,
  MemoryProviderAccountRepository,
  MemoryTokenStore,
  MemoryUserRepository,
  MemoryAuditEventRepository,
  MemoryEventPublisher,
} from './src/adapters/memory/repositories';
import { NodeCryptoAdapter } from './src/adapters/system/node-crypto';
import { SystemClock } from './src/adapters/system/clock';
import { FetchHttpClient } from './src/adapters/http/fetch-client';

const registry = createDefaultProviderRegistry();

const config = {
  providers: {
    google: {
      enabled: true,
      clientId: process.env.GOOGLE_CLIENT_ID ?? '',
      clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '',
      redirectUri: 'https://api.example.com/auth/google/callback',
      scopes: ['openid', 'email', 'profile'],
    },
  },
  policy: {
    allowEmailMatch: true,
    autoCreateUser: true,
    autoLink: true,
    requireVerifiedEmail: true,
  },
};

const result = createAuthService({
  registry,
  config,
  userRepo: new MemoryUserRepository(),
  providerAccountRepo: new MemoryProviderAccountRepository(),
  authStateRepo: new MemoryAuthStateRepository(),
  tokenStore: new MemoryTokenStore(),
  auditRepo: new MemoryAuditEventRepository(),
  eventPublisher: new MemoryEventPublisher(),
  crypto: new NodeCryptoAdapter(),
  clock: new SystemClock(),
  httpClient: new FetchHttpClient(),
});

if (!result.ok) {
  throw new Error(result.error.message);
}

const authService = result.value;

Built-in Providers

  • Google: OAuth 2.0 + OIDC profile mapping.
  • Apple: OAuth 2.0 with issuer-aware configuration.
  • LinkedIn: OAuth 2.0 basic profile mapping.
  • GitHub: OAuth 2.0 user profile mapping.
  • Facebook: OAuth 2.0 profile mapping.

Each provider isolates endpoints, config validation, and profile normalization. See src/providers/builtins.

Custom Provider Plugin Example

See examples/providers/enterprise-oidc.ts for a generic OIDC provider implementation and registration.

Signal Integration Example

import { createSignalHandlers } from './src/signal/handlers';

const handlers = createSignalHandlers(authService);

const authorize = handlers['auth.provider.authorize.v1'];
const result = await authorize({
  provider: 'google',
  redirectUri: 'https://api.example.com/auth/google/callback',
});

Security Model

  • CSRF-resistant state handling with TTL.
  • PKCE support with strict verifier checks.
  • Nonce handling for replay protection.
  • Strict redirect URI matching by default.
  • Tokens are never logged and are stored via a port interface.
  • Constant-time comparisons for secret material.

See docs/SECURITY.md for details.

Testing and Coverage

pnpm -C server/identity test:coverage

Coverage gates are enforced at 100% for statements, branches, functions, and lines.

Limitations

  • This module does not implement UI flows or browser sessions.
  • Provider SDKs are intentionally not included; HTTP is abstracted.
  • Database adapters are not included; ports are provided for integration.

Future Extension Points

  • Multi-tenant account routing strategies.
  • Token revocation support per provider.
  • Additional provider adapters (OIDC discovery, SAML bridges).
  • Rate limiting and risk scoring policies.

License

See repository license.