New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

evopolicychecker

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evopolicychecker

A secure, offline, deterministic policy evaluation engine.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

EvoPolicy SDK

npm version License

EvoPolicy is a high-performance, deterministic authorization engine tailored for enterprise Node.js and TypeScript ecosystems. It facilitates advanced attribute-based access control (ABAC) and role-based access control (RBAC) by evaluating policies locally within the application process. This architecture eliminates network latency and central service dependency while maintaining a robust security posture.

Technical Value Proposition

In large-scale distributed systems, authorization logic often becomes fragmented or creates performance bottlenecks due to network-based policy lookups. EvoPolicy addresses these fundamental challenges through:

  • Sub-Millisecond Evaluation: Policies are processed in-memory. Standard decision cycles complete in under 100 microseconds, ensuring critical paths remain high-speed.
  • Universal Data Interfacing: The engine is decoupled from storage. It supports seamless ingestion from local configuration (JSON/YAML), relational clusters (MySQL, PostgreSQL), and distributed NoSQL/API sources (MongoDB, GraphQL).
  • Auditable Condition Logic: A formal recursive descent parser evaluates complex constraints without unsafe script execution.
  • Security Fail-Closed Design: The SDK enforces a strict denial policy in cases of initialization failure or ambiguous rule sets.

Enterprise System Architecture

The following diagram illustrates the integration of various policy sources and the internal decision logic flow.

EvoPolicy Enterprise Architecture

Architectural Components

  • Logic Engine: Orchestrates the filtering and matching of policies against the evaluation context.
  • IPolicyLoader Abstraction: An extensible interface for implementing custom data persistence strategies.
  • Condition Parser: A secure, non-evaluative parser that validates resource and subject attributes.
  • Decision Matrix: Applies Deny-Overrides logic to deliver a final authorization verdict.

Installation

npm install evopolicychecker

Technical Implementation Guide

Engine Initialization and Data Ingestion

The engine supports multiple loading strategies, allow for both static and dynamic policy management.

import { PolicyEngine, JsonPolicyLoader, CustomPolicyLoader } from 'evopolicychecker';

const engine = new PolicyEngine();

// Static file ingestion
engine.loadPolicies('./config/access_rules.json');

// Dynamic Database Integration
const fetcher = async () => {
    // Implement database-specific retrieval logic
    return await database.authorizations.findMany();
};
await engine.loadFromLoader(new CustomPolicyLoader(fetcher));

Advanced Connection Patterns

For detailed implementation and copy-paste examples for MySQL, MongoDB, PostgreSQL, and GraphQL, please refer to the Database Integration Specification.

Middleware Lifecycle Integration

EvoPolicy provides standardized middleware for Express.js to facilitate request-level authorization.

import { policyMiddleware } from 'evopolicychecker';

// Global middleware with automatic context mapping
app.use(policyMiddleware(engine));

// Granular route protection with explicit context mapping
app.post('/v1/assets/restricted', policyMiddleware(engine, (req) => ({
    subject: req.authenticatedUser,
    action: 'administer',
    resource: {
        type: 'restricted_asset',
        id: req.params.id,
        classification: req.body.level
    }
})));

Condition Operator Specification

OperatorCategorizationEvaluation Logic
> , < , >= , <=RangeArithmetic and Chronological Comparison (ISO-8601 compatible)
~=PatternRegular Expression matching (ECMAScript compatible)
IN [...]SetInclusion check within discrete arrays
!=LogicStrict inequality validation

Performance Benchmarks

  • Memory Efficiency: < 50MB baseline.
  • Evaluation Throughput: 100k+ operations per second.
  • Initialization Speed: ~10ms for 1,000 policy records.

For deeper insights into the internal evaluation logic and security hardening, consult the Architectural Specification.

Licensed under the ISC License. Copyright © 2026 Daksha Dubey.

Keywords

authorization

FAQs

Package last updated on 03 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts