diff --git a/Cargo.toml b/Cargo.toml
index fa01da07..5d3ec491 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,9 +1,17 @@
[package]
-name = "didcomm-mediator"
-version = "0.1.0"
+name = "didcomm-mediator"
+version = "0.1.0"
+authors = ["adorsys GmbH Co. KG"]
+license = "Apache-2.0"
+description = "A Rust Mediator for DIDComm messaging, supporting secure and decentralized communication."
+repository = "https://github.com/adorsys/didcomm-mediator-rs"
+homepage = "https://github.com/adorsys/didcomm-mediator-rs/blob/main/README.md"
+documentation = "https://github.com/adorsys/didcomm-mediator-rs/tree/main/docs"
+keywords = ["DIDComm", "Mediator", "DIDComm Mediator", "DIDComm Mediation", "DIDCOMM Messaging", "Decentralized Identity", "Rust Mediator"]
+categories = ["cryptography", "decentralized-systems"]
edition = "2021"
-description = "A mediator for DIDComm messages"
-authors = ["adorsys GmbH Co. KG"]
+readme = "README.md"
+
[workspace]
diff --git a/README.md b/README.md
index c0a17e65..d8c1caac 100644
--- a/README.md
+++ b/README.md
@@ -19,12 +19,12 @@ For further understanding checkout the [docs](docs/mediator-doc.md)
|[Pickup Protocol](https://didcomm.org/messagepickup/3.0/)| ADOPTED | ✅ |
|[DID Rotation](https://didcomm.org/book/v2/didrotation) | ACCEPTED | ✅ |
|[Cross-Domain Messaging/ Routing Protocol](https://identity.foundation/didcomm-messaging/spec/#routing-protocol-20) | ADOPTED | ✅|
-|[Trust Ping Ptotocol](https://identity.foundation/didcomm-messaging/spec/#trust-ping-protocol-20) | ADOPTED|⚪|
+|[Trust Ping Ptotocol](https://identity.foundation/didcomm-messaging/spec/#trust-ping-protocol-20) | ADOPTED|✅|
|[Discover Features Protocol](https://didcomm.org/discover-features/2.0/) | ADOPTED | ⚪ |
|[Out of band Messaging](https://identity.foundation/didcomm-messaging/spec/#out-of-band-messages) | ADOPTED | ⚪
+|[Basic Message Protocol](https://didcomm.org/basicmessage/2.0/#:~:text=The%20BasicMessage%20protocol%20describes%20a,message%20type%20used%20to%20communicate.) | ADOPTED|⚪|
|[Acks](https://github.com/hyperledger/aries-rfcs/tree/main/features/0015-acks)| ADOPTED |❌ |
|[Present Proof Protocol](https://didcomm.org/present-proof/3.0/)| ADOPTED | ❌|
-|[Basic Message Protocol](https://didcomm.org/basicmessage/2.0/#:~:text=The%20BasicMessage%20protocol%20describes%20a,message%20type%20used%20to%20communicate.) | ADOPTED|❌|
## Building and testing
diff --git a/crates/web-plugins/didcomm-messaging/Cargo.toml b/crates/web-plugins/didcomm-messaging/Cargo.toml
index 7acb4eb5..8da6d9bf 100644
--- a/crates/web-plugins/didcomm-messaging/Cargo.toml
+++ b/crates/web-plugins/didcomm-messaging/Cargo.toml
@@ -13,6 +13,7 @@ plugin-api.workspace = true
filesystem.workspace = true
forward.workspace = true
pickup.workspace = true
+trust-ping.workspace = true
mediator-coordination.workspace = true
mongodb.workspace = true
diff --git a/crates/web-plugins/didcomm-messaging/protocols/forward/src/error.rs b/crates/web-plugins/didcomm-messaging/protocols/forward/src/error.rs
index 2595acdf..67fa1b18 100644
--- a/crates/web-plugins/didcomm-messaging/protocols/forward/src/error.rs
+++ b/crates/web-plugins/didcomm-messaging/protocols/forward/src/error.rs
@@ -1,25 +1,29 @@
-use axum::Json;
-use serde_json::{json, Value};
+use axum::{response::IntoResponse, Json};
+use hyper::StatusCode;
use thiserror::Error;
#[derive(Debug, Error)]
-pub enum RoutingError {
+pub enum ForwardError {
#[error("message body is malformed")]
MalformedBody,
- #[error("Repository not set")]
- RepostitoryError
-}
-impl RoutingError {
- /// Converts the error to an axum JSON representation.
- pub fn json(&self) -> Json {
- Json(json!({
- "error": self.to_string()
- }))
- }
+ #[error("Uncoordinated sender")]
+ UncoordinatedSender,
+ #[error("Internal server error")]
+ InternalServerError,
}
-impl From for Json {
- fn from(error: RoutingError) -> Self {
- error.json()
+impl IntoResponse for ForwardError {
+ fn into_response(self) -> axum::response::Response {
+ let status_code = match self {
+ ForwardError::MalformedBody => StatusCode::BAD_REQUEST,
+ ForwardError::UncoordinatedSender => StatusCode::UNAUTHORIZED,
+ ForwardError::InternalServerError => StatusCode::INTERNAL_SERVER_ERROR,
+ };
+
+ let body = Json(serde_json::json!({
+ "error": self.to_string(),
+ }));
+
+ (status_code, body).into_response()
}
}
diff --git a/crates/web-plugins/didcomm-messaging/protocols/forward/src/lib.rs b/crates/web-plugins/didcomm-messaging/protocols/forward/src/lib.rs
index 82f5807c..e17bcec6 100644
--- a/crates/web-plugins/didcomm-messaging/protocols/forward/src/lib.rs
+++ b/crates/web-plugins/didcomm-messaging/protocols/forward/src/lib.rs
@@ -1,3 +1,5 @@
mod error;
-
pub mod web;
+
+// Re-exports
+pub use error::ForwardError;
diff --git a/crates/web-plugins/didcomm-messaging/protocols/forward/src/web/handler.rs b/crates/web-plugins/didcomm-messaging/protocols/forward/src/web/handler.rs
index eb3f40ad..92413149 100644
--- a/crates/web-plugins/didcomm-messaging/protocols/forward/src/web/handler.rs
+++ b/crates/web-plugins/didcomm-messaging/protocols/forward/src/web/handler.rs
@@ -1,14 +1,14 @@
-use super::routing::handler;
-use axum::response::Response;
+use crate::{web::routing::handler, ForwardError};
use didcomm::Message;
use shared::state::AppState;
+use std::sync::Arc;
/// Mediator receives forwarded messages, extract the next field in the message body, and the attachments in the message
/// then stores the attachment with the next field as key for pickup
pub async fn mediator_forward_process(
- state: &AppState,
+ state: Arc,
payload: Message,
-) -> Result {
- let result = handler(state, payload).await.unwrap();
+) -> Result