Feat v0.9.8 routing sdk (#82)
Some checks failed
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Has been skipped
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-go-pg (push) Failing after 2m39s
CI/CD / test-sqlite (push) Successful in 3m0s
CI/CD / build-and-deploy (push) Has been skipped
Some checks failed
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Has been skipped
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-go-pg (push) Failing after 2m39s
CI/CD / test-sqlite (push) Successful in 3m0s
CI/CD / build-and-deploy (push) Has been skipped
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #82.
This commit is contained in:
@@ -84,6 +84,24 @@ Returns `True` if the user has the permission, `False` otherwise (including
|
||||
when the user is not found). Resolves the user's groups and merges granted
|
||||
permissions — works for both kernel and extension-declared permissions.
|
||||
|
||||
### routing
|
||||
|
||||
Generic rule-based decision engine. Evaluates an ordered list of conditions
|
||||
against a data dict, returning the first matching rule's target string.
|
||||
|
||||
```python
|
||||
result = routing.evaluate([
|
||||
{"field": "priority", "op": "eq", "value": "critical", "target": "escalation"},
|
||||
{"field": "amount", "op": "gt", "value": 10000, "target": "manager_review"},
|
||||
{"field": "region", "op": "in", "value": ["EU", "UK"], "target": "gdpr_flow"},
|
||||
], stage_data)
|
||||
# Returns "escalation", "manager_review", "gdpr_flow", or None
|
||||
```
|
||||
|
||||
Each rule is a dict with `field`, `op`, `value`, and `target`. Operators:
|
||||
`exists`, `not_exists`, `eq`, `neq`, `gt`, `lt`, `gte`, `lte`, `in`,
|
||||
`contains`. First-match-wins; returns `None` if no rule matches.
|
||||
|
||||
## Permission-gated modules
|
||||
|
||||
These modules are only available if the package has the corresponding
|
||||
|
||||
Reference in New Issue
Block a user