Sentrie - Policy Enforcement Engine
Sentrie
Section titled “Sentrie”The policy enforcement engine that scales with your needs
Sentrie is a powerful, flexible policy enforcement engine designed for modern applications. With its rich expression language, comprehensive type system, and JavaScript module integration, Sentrie makes it easy to implement complex authorization, access control, and business rules.
Why Sentrie?
Section titled “Why Sentrie?”Rich Expression Language
Powerful expressions with arithmetic, logical, comparison, and collection operations. Support for quantifiers, pattern matching, and conditional expressions.
Type-Safe Policies
Comprehensive type system with shapes, constraints, and validation. Catch errors at policy definition time, not runtime.
JavaScript Integration
Seamlessly integrate JavaScript modules for complex logic. Built-in modules for UUID generation, crypto operations, and more.
Key Features
Section titled “Key Features”- 🎯 Policy-First Design: Define policies as code with clear, readable syntax
- 🔒 Authorization & Access Control: Implement fine-grained permissions and business rules
- 📦 Pack System: Organize policies into reusable, versioned packages
- 🌐 HTTP API: RESTful API for policy evaluation with comprehensive tracing
- ⚡ High Performance: Built-in caching and optimization for production workloads
- 🔧 Developer Experience: Rich tooling, comprehensive error messages, and debugging support
Quick Start
Section titled “Quick Start”Get up and running with Sentrie in minutes:
# Install Sentriego install github.com/sentrie-sh/sentrie@latest
# Create your first policymkdir my-policy && cd my-policyecho 'namespace com/example/auth
policy user { rule allow = default false when user.role == "admin" { yield true }
export decision of allow}' > auth.sentrie
# Start the serversentrie serve --pack-location .Language Highlights
Section titled “Language Highlights”Sentrie’s expression language is designed for clarity and power:
namespace com/example/pricing
policy pricing { let discount = 0.1 let premiumUsers = ["alice", "bob"]
rule calculatePrice = default 0 { let basePrice = product.price let userDiscount = user.name in premiumUsers ? discount : 0 let finalPrice = basePrice * (1 - userDiscount)
yield finalPrice }
export decision of calculatePrice}What’s Next?
Section titled “What’s Next?”Community & Support
Section titled “Community & Support”- GitHub: github.com/sentrie-sh/sentrie
- Issues: Report bugs and request features
- Discussions: Ask questions and share ideas
Version 0.1.0 - Early Access