Resolves policy from a static list of policy records.
| 275 | |
| 276 | |
| 277 | class StaticPolicyResolver(BasePolicyResolver): |
| 278 | """ |
| 279 | Resolves policy from a static list of policy records. |
| 280 | """ |
| 281 | |
| 282 | def __init__(self, fallback: Optional[PolicyResolver] = None) -> None: |
| 283 | """ |
| 284 | Parameters: |
| 285 | fallback (Optional[PolicyResolver]): An optional fallback policy resolver |
| 286 | used for resolving policies if static policies are inadequate. |
| 287 | """ |
| 288 | super().__init__(STATIC_POLICIES, fallback) |
| 289 | |
| 290 | def with_fallback(self, fallback: "PolicyResolver") -> "PolicyResolver": |
| 291 | return StaticPolicyResolver(fallback) |
| 292 | |
| 293 | |
| 294 | class AsyncDynamicPolicyResolver(AsyncBasePolicyResolver): |
no outgoing calls