You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Enhance AuthZEN demo with mock PDP server and new flags
- Added `mock_pdp` and `no_mock_pdp` flags for local testing with a mock PDP server.
- Implemented realistic authorization policies in the mock server for testing.
- Updated `Args` struct to include flags for mock PDP usage.
- Enhanced README with mock PDP details and usage instructions.
- Improved demo output to focus on authorization decisions without actual SLIM operations.
This update provides a more user-friendly experience for testing AuthZEN authorization scenarios.
Signed-off-by: Razco <razchn@gmail.com>
- SLIM entity to AuthZEN format conversion (Agent → Subject, AgentType → Resource)
27
27
- Error handling and fallback policies
28
+
- Mock PDP server for realistic testing
28
29
- Performance testing with cached decisions
29
30
30
31
### 📊 Demo Scenarios
31
32
1.**Agent Creation**: Create publisher, subscriber, and admin agents
32
-
2.**Route Testing**: Authorized and unauthorized route creation attempts
33
-
3.**Message Publishing**: Normal and oversized message authorization
34
-
4.**Subscription Management**: Same-org and cross-org subscription attempts
33
+
2.**Route Testing**: Authorized and unauthorized route creation authorization
34
+
3.**Message Publishing**: Normal and oversized message authorization testing
35
+
4.**Subscription Management**: Same-org and cross-org subscription authorization
35
36
5.**Cache Testing**: Performance impact of authorization caching
36
37
38
+
Note: This demo focuses on authorization decision testing. Actual SLIM operations (route creation, message publishing, subscriptions) are skipped to maintain clean output focused on AuthZEN functionality.
39
+
37
40
## Quick Start
38
41
39
42
### Prerequisites
@@ -55,13 +58,16 @@ cargo run --bin authzen-demo -- --help
55
58
# Run with default settings (fail-open for demo)
56
59
cargo run --bin authzen-demo
57
60
58
-
# Test fail-closed security behavior
61
+
# Run with mock PDP server (recommended - default)
62
+
cargo run --bin authzen-demo -- --mock-pdp
63
+
64
+
# Test fail-closed security behavior
59
65
cargo run --bin authzen-demo -- --fail-closed
60
66
61
-
#Run with a real AuthZEN PDP
62
-
cargo run --bin authzen-demo -- --pdp-endpoint http://your-pdp:8080
67
+
#Test with real AuthZEN PDP (disable mock)
68
+
cargo run --bin authzen-demo -- --no-mock-pdp --pdp-endpoint http://your-pdp:8080
63
69
64
-
# Disable AuthZEN (JWT-only mode)
70
+
# Disable AuthZEN entirely (JWT-only mode)
65
71
cargo run --bin authzen-demo -- --authzen-enabled false
The example includes a built-in mock AuthZEN PDP server for realistic testing without requiring an external policy engine. The mock PDP implements these policies:
92
+
93
+
### 📋 Mock Policies
94
+
-**Same-Organization Routes**: ✅ Allow route creation between agents in the same organization (`cisco`)
95
+
-**Cross-Organization Routes**: ❌ Deny routes to external organizations (`external`, etc.)
96
+
-**Message Publishing**: ✅ Allow normal message publishing within organization
97
+
-**Subscriptions**: ✅ Allow subscriptions within the same organization
98
+
-**Default Policy**: ✅ Allow other operations (for demo purposes)
99
+
100
+
### 🎛️ Mock PDP Controls
101
+
-`--mock-pdp` (default): Use local mock PDP with realistic policies
102
+
-`--no-mock-pdp`: Connect to real PDP at `--pdp-endpoint`
103
+
-`--fail-closed`: Test security-first behavior (deny when PDP unavailable)
104
+
105
+
The mock PDP demonstrates how AuthZEN policies can enforce fine-grained access control beyond simple JWT claims, showing realistic organizational boundaries and operation restrictions.
0 commit comments