This section explains how to integrate the Manetu PolicyEngine into your application using the Policy Decision Point (PDP) and Policy Enforcement Point (PEP) architecture.
The Manetu PolicyEngine serves as a Policy Decision Point (PDP)—it evaluates policies and returns access control decisions. To integrate the PolicyEngine, you create one or more Policy Enforcement Points (PEPs) in your application that call the PDP.
<SectionHeader icon="pdp" level={3}>Policy Decision Point (PDP)
The PDP is the Manetu PolicyEngine itself. It:
The PDP knows nothing about your application's business logic—it only evaluates policies against the inputs it receives.
<SectionHeader icon="pep" level={3}>Policy Enforcement Point (PEP)
A PEP is code within your application that enforces access control. Each PEP is responsible for:
The PolicyEngine provides two integration options:
| Method | Best For |
|---|---|
| HTTP API | Any language — Python, Java, TypeScript, Go, and more |
| Embedded Go Library | Go applications needing lowest latency |
When choosing an integration method, consider your long-term needs:
| Consideration | HTTP API | Embedded Go Library |
|---|---|---|
| Language support | Any language | Go only |
| Latency | Low (network call) | Lowest (in-process) |
| Deployment | Separate service or sidecar | Single artifact |
| Scaling | Varies (See Deployment Options) | Scales with application |
| Premium Edition Compatible | Yes | No |
Choose the HTTP API when:
Choose the embedded Go library when:
Learn how to construct proper authorization requests:
Create enforcement points in your application that:
See Best Practices for implementation guidance.
Here's a minimal PEP implementation:
// 1. Build PORC expression
porc := map[string]interface{}{
"principal": map[string]interface{}{
"sub": claims.Subject,
"mroles": claims.Roles,
},
"operation": "api:documents:read",
"resource": "mrn:app:myservice:document:12345",
"context": map[string]interface{}{},
}
// 2. Call PDP
allowed, err := pdp.Authorize(ctx, porc)
// 3. Handle decision
if !allowed {
return ForbiddenError
}
// Proceed with operation...
For understanding the PORC format itself, see PORC Expressions in the Concepts section.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |