-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor/typestate connections (#739)
Reimplement (non-mediated) Connection, update napi-rs, sync up rust agent, reformat libvdrtools * Remove obsolete structs * Removed transport type from type state Connection * Factored out build_con_request method * Moved all typestate connection related code to a different module * Refactored inner methods and simplified them * Reverted changes on current code as the typestate_con is separated into a different module * Added serde capabilities to typestate Connection * Added invitation processing to Invitee and moved some Connection methods to their appropriate types * Renamed SerdeCon to VagueConnection. This will be used for deserialization only * Added dedicated serialization types for borrowed serialization of Connection and implemented Serialize * Fixed Connection serialization trait bounds * Reverted to using invitation ID as thread ID * Added direct deserialization support to Connection through try_from impl of VagueConnection * Set typestate_con states attributes pub(crate) * Added typestate_con libvcx implementation draft * Completed typestate_con implementation in libvcx * Renamed remove_connection in libvcx to get_cloned_connection and implemented cloning to persist previous state in the cache * Removed the lazy_static HTTPCLIENT in favor of using the ZST directly * Retro-fitted the process_request and send_response methods for backwards compatibility * Added ProblemReport generation and sending * Added test From implementations between SerializableConnection and VagueConnection for compile-time check that types match * Added boilerplate macro for From impls for SerializationConnection * Modified aries-vcx-agent to use typestate connections * Fixed method rename in libvcx * Removed send_invitation method * Typestate connection cosmetic changes, comments, and modules re-organization * Removed previous non-mediated Connection in favor of newer typestate Connection * Fixed state differences in Node.js wrapper * Reuse request did_doc * Moved Transport trait and auto-implemented for references of types implementing it * Fix FFI wrapper to return a Promise for the async request handling * Reverting dependencies in vcxagent-core * Ignore dist dirs * Reverted NAPI changes and mimicked old connection states more accurately for backwards compatibility * Fixed accept_invitation log comment and added more explicit logs to libvcx * processInvite is now a Promise * Fixed thread_id handling when accepting invitation and sending request as an invitee * More state retro-fitting with previous implementation * Fix thread_id usage in Request generation * Added comments * Added concrete and generic connection serialization and deserialization tests * Added whitespace in libcx * Ran cargo fmt * Completely separated states between invitee and inviter * Added BootstrapDidDoc trait * Added non-mediated connection OOB handling * Improved OOB connection existence look-up and implemented libvcx non-mediated connection calls * Implemented necessary changes to node wrappers to expose non-mediated connections * Unexposed internal OOB method * Added re-export of PairwiseInfo to mediatedconnection to avoid struct duplication * Ran cargo fmt * Fixed GenericConnection doc test and comment * Made processInvite in node wrapper async * Fixed comments typos * Updated napi and napi-derive dependencies version * Made from_parts public and added into_parts method on Connection Signed-off-by: Bogdan Mircea <mirceapetrebogdan@gmail.com>
- Loading branch information
Showing
147 changed files
with
4,561 additions
and
1,809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use aries_vcx::{agency_client::httpclient::post_message, errors::error::VcxResult, transport::Transport}; | ||
|
||
use async_trait::async_trait; | ||
|
||
pub struct HttpClient; | ||
|
||
#[async_trait] | ||
impl Transport for HttpClient { | ||
async fn send_message(&self, msg: Vec<u8>, service_endpoint: &str) -> VcxResult<()> { | ||
post_message(msg, service_endpoint).await?; | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ extern crate uuid; | |
|
||
mod agent; | ||
mod error; | ||
mod http_client; | ||
mod services; | ||
mod storage; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.