Skip to main content

authz_resolver_sdk/
plugin_api.rs

1//! Plugin API trait for `AuthZ` resolver implementations.
2
3use async_trait::async_trait;
4
5use crate::error::AuthZResolverError;
6use crate::models::{EvaluationRequest, EvaluationResponse};
7
8/// Plugin API trait for `AuthZ` resolver implementations.
9///
10/// Each plugin registers this trait with a scoped `ClientHub` entry
11/// using its GTS instance ID as the scope.
12#[async_trait]
13pub trait AuthZResolverPluginClient: Send + Sync {
14    /// Evaluate an authorization request.
15    ///
16    /// # Errors
17    ///
18    /// - `Internal` for unexpected errors
19    async fn evaluate(
20        &self,
21        request: EvaluationRequest,
22    ) -> Result<EvaluationResponse, AuthZResolverError>;
23}