(
_state: State<Arc<ServerState>>,
Path(name): Path<String>,
Json(req): Json<PluginAuthAuthorizeRequest>,
)
| 4604 | } |
| 4605 | |
| 4606 | async fn plugin_auth_authorize( |
| 4607 | _state: State<Arc<ServerState>>, |
| 4608 | Path(name): Path<String>, |
| 4609 | Json(req): Json<PluginAuthAuthorizeRequest>, |
| 4610 | ) -> Result<Json<PluginAuthAuthorizeResponse>> { |
| 4611 | let bridge = get_auth_bridge(&name).await?; |
| 4612 | |
| 4613 | let result = bridge |
| 4614 | .authorize(req.method, req.inputs) |
| 4615 | .await |
| 4616 | .map_err(|e| ApiError::BadRequest(e.to_string()))?; |
| 4617 | |
| 4618 | Ok(Json(PluginAuthAuthorizeResponse { |
| 4619 | url: result.url, |
| 4620 | instructions: result.instructions, |
| 4621 | method: result.method, |
| 4622 | })) |
| 4623 | } |
| 4624 | |
| 4625 | #[derive(Debug, Deserialize)] |
| 4626 | struct PluginAuthCallbackRequest { |
nothing calls this directly
no test coverage detected