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

@novashield352/novashield-wso2

v2.1.0

Published

SDK agnóstico para integración con WSO2 Identity Server y manejo de permisos genéricos - v2 Security Core

Downloads

32

Readme

@novashield352/novashield-wso2 (v2.1.0)

This is the official NovaShield SDK designed to handle integration with WSO2 Identity Server using clean architecture methodologies. It is completely agnostic to the underlying framework (Express, NestJS, FastAPI backend, etc.).

Version 2.1.0 (Developer Experience Release) introduces features to make integration faster and more robust.

🚀 What's New in v2.1.0

  1. OIDC Auto Discovery: Automatically fetch configuration from /.well-known/openid-configuration. No more manual endpoint setup.
  2. Config Validator: Proactive validation of your configuration fields to prevent runtime errors.
  3. Debug Mode: Enable detailed, structured logging with debug: true.
  4. CLI Tool: Initialize your project configuration instantly with npx novashield init.

🛡️ Core Security Features

  • JWT Signature Validation (JWKS): Automatically verifies cryptographic signatures using the JWKS endpoint.
  • Native PKCE Support: Built-in S256 code challenge and verifier generators.
  • Custom Error Hierarchy: Specific classes like Wso2AuthenticationError and Wso2SignatureError for precise error handling.
  • OIDC Compliance: Strict validation of iss (issuer) and aud (audience).

📦 Installation

npm install @novashield352/novashield-wso2
# Or via yarn
yarn add @novashield352/novashield-wso2

🏗️ Quick Start

1. Initialize Configuration

Run the following command to generate a base configuration file:

npx novashield init

2. Initialize the Client

import { NovashieldAuthClient } from "@novashield352/novashield-wso2";

const config = {
  baseUrl: "https://your-wso2.com",
  clientId: "...",
  clientSecret: "...",
  autoDiscovery: true, // Enables fetching endpoints automatically
  debug: true, // Enables verbose logging
};

const wso2Client = new NovashieldAuthClient(config, new MyUserMapper());

// NEW: Call initialize() to perform discovery
await wso2Client.initialize();

🏗️ Architectural Benefits

  • Typed Generics (TUser, TPermissions): Adapt the SDK to your domain model by passing your own TypeScript interfaces.
  • Dependency Injection: SOLID principles by separating User Mapping (UserMapperProvider) and Permission Resolution (PermissionProvider).
  • Network Abstraction: Decouples the "dirty work" of HTTPS and Base64 from your business logic.

🚀 Advanced Usage

Step 1: Implement Providers

import { UserMapperProvider } from "@novashield352/novashield-wso2";

export class Wso2UserMapper implements UserMapperProvider<MyUserShape> {
  fromIdToken(idTokenPayload: any): MyUserShape {
    return {
      id: idTokenPayload.sub,
      email: idTokenPayload.email,
    };
  }
}

Step 2: Authentication Flow (PKCE)

// 1. Generate Redirect URL
const verifier = generateCodeVerifier();
const challenge = await generateCodeChallenge(verifier);
const authUrl = wso2Client.getAuthorizationUrl("secure_state", challenge);

// 2. Process Callback
const { user, tokens } = await wso2Client.handleCallback(code, verifier);

Step 3: Server-to-Server

// Obtains an application access token with automatic caching & rotation
const token = await wso2Client.getAppAccessToken();

📋 Method Summary

| Method | Description | | ------------------------------------------ | -------------------------------------------------- | | initialize() | NEW: Performs OIDC configuration discovery. | | getAuthorizationUrl(state, challenge?) | Generates the URL to initiate the OIDC flow. | | handleCallback(code, verifier?) | Exchanges the code for tokens and user profile. | | getLogoutUrl(idTokenHint, postLogoutUri) | Generates the logout URL. | | getAppAccessToken() | Obtains an application token (Client Credentials). | | getUserInfo(accessToken) | Queries the WSO2 /scim2/Me endpoint. |


🤝 Community & Support

Developed with ❤️ by the NovaShield team.