Anand Krishnamoorthi
80686d6ed1
feat(ffi): unwind safety: shield FFI entrypoints with panic guard ( #546 )
...
This PR implements widely accepted Rust programming practices for
dealing with panics across ABI (programming language) boundaries.
- Add panic_guard.rs to wrap FFI calls and prevent panic across FFI/ABI boundary (undefined behavior).
- Capture per-thread backtraces via a temporary panic hook
- After a panic, subsequent invocations are poisoned.
- Integrate with_unwind_guard across the engine, schema registry, and target registry exportis
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
2026-01-21 09:20:10 +05:30
Denis Komissarov
9604fe86f1
Bump the version of the C# bindings ( #482 )
2025-09-30 15:31:46 -05:00
dependabot[bot]
5c71debcb9
Bump the nuget group with 1 update ( #462 )
...
Bumps System.Text.Json from 8.0.0 to 8.0.5
---
updated-dependencies:
- dependency-name: System.Text.Json
dependency-version: 8.0.5
dependency-type: direct:production
dependency-group: nuget
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-20 05:54:13 -05:00
Anand Krishnamoorthi
cc917ea75d
feat: Complete target system with C# bindings and resource inference ( #458 )
...
* feat: Add Schema Registry and Validation Framework
This commit introduces a comprehensive schema registry and validation framework, providing schema-based validation of resources and policy effects.
- Thread-safe, in-memory registry for schema storage and management
- Global registry patterns for effects and resources
- Concurrent access with proper error handling
- Unicode schema names support
- JSON Schema-compliant validation for all primitive types
- Advanced constraint validation (patterns, ranges, length limits)
- Discriminated union support with anyOf schemas
- Detailed error reporting with nested validation paths
- Discriminated subobject validation for polymorphic schemas
- **Registry Tests**: All registry operations
- **Effect Tests**: Policy effect validation
- **Resource Tests**: Resource validation
- **Validation Tests**: Core validation engine
- Thread-safety, error handling, integration scenarios, edge cases
- **Dependencies**: dashmap, once_cell, regex
- **Thread Safety**: Minimal locking with Rc<Schema> sharing
- **Error Types**: TypeMismatch, OutOfRange, PatternMismatch, etc.
- Complete schema registry and validation subsystem
- Comprehensive test coverage
- Foundation for policy validation in Regorus
Benchmarks:
- Criterion benchmarks for basic types, effects and Azure resources
- Performance range: 3.22ns (string) to 34.74µs (Azure VM resource schema validation)
- String withs patterns validation: 30.2µs. Need to explore whether regex caching helps
bring this down.
- Azure policy effects: 188ns-1.4µs
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
* feat: Complete target system with C# bindings and resource inference
- Add comprehensive target system with TargetRegistry and target-aware compilation
- Implement resource type inference from policy equality expressions
- Create modular C# bindings with separate wrapper classes for each concept
- Add thread-safe CompiledPolicy with reference counting for safe disposal
- Enhance FFI with detailed error propagation and target functionality
- Create TargetExampleApp demonstrating Azure Policy integration
- Add CI/CD pipeline testing for all C# applications
- Support target definitions with schema validation and resource selectors
- Implement PolicyModule struct and target-aware compilation methods
- Add comprehensive test coverage for target functionality
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
---------
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
2025-08-19 20:23:43 -05:00
Anand Krishnamoorthi
9487defa20
chore: Regorus v0.5.0 release ( #432 )
...
Also update binding versions and lock files.
Note:
- Ruby binding is not updated
- C# binding is v0.7.0. We will make it match Regorus version later.
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
2025-07-08 16:40:06 -05:00
Anand Krishnamoorthi
6719456468
build: Update dependencies ( #401 )
...
Also bump up C# package version
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
2025-04-29 11:06:05 -05:00
Anand Krishnamoorthi
ab93c07773
fix: C# EvalRule ( #387 )
...
- Fix EvalRule to call EvalRule instead of EvalQuery
- Also fix clippy errors
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
2025-04-04 15:44:16 -07:00
Anand Krishnamoorthi
a164f342bf
build: Use VersionPrefix and VersionSuffix ( #385 )
...
The suffix can be customised during dotnet pack.
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
2025-03-31 18:24:59 -07:00
Anand Krishnamoorthi
2858b63cd4
feat: Regorus nuget package ( #383 )
...
Organize C# binding example into separate Regorus nuget package and
a test app.
The nuget package targets netstandard 2.0 and 2.1.
The test app is tested for netframework 8.0.
Implement IDisposable for Engine cleanup.
Also remove net40 example. Can be added back later if needed.
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com >
2025-03-25 11:31:13 -07:00