-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from animo/feat/issue-credential
feat: issue credential + refactoring
- Loading branch information
Showing
22 changed files
with
701 additions
and
228 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
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,14 @@ | ||
clippy: | ||
cargo clippy | ||
|
||
build: | ||
cargo build | ||
|
||
run: | ||
cargo run | ||
|
||
docs: | ||
cargo doc --open | ||
|
||
install: clippy build | ||
cargo install --path . |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use crate::typing::{ | ||
Connection, Connections, Features, Invitation, InvitationConfig, IssueCredentialConfig, | ||
MessageConfig, | ||
}; | ||
use async_trait::async_trait; | ||
|
||
/// base cloudagent functionality | ||
#[async_trait] | ||
pub trait Agent { | ||
/// Gets all the connections | ||
async fn get_connections(&self, filter: Option<String>) -> Connections; | ||
|
||
/// Get a connection by id | ||
async fn get_connection_by_id(&self, id: String) -> Connection; | ||
|
||
/// Prints an invitation, as url or qr, in stdout | ||
async fn create_invitation(&self, config: &InvitationConfig) -> Invitation; | ||
|
||
/// Requests all the features from the cloudagent | ||
async fn discover_features(&self) -> Features; | ||
|
||
/// Send a basic message to another agent | ||
async fn send_message(&self, config: &MessageConfig); | ||
|
||
/// Offer a credential to another agent | ||
async fn offer_credential(&self, config: &IssueCredentialConfig); | ||
} | ||
|
||
/// HTTP specific cloudagent functionality | ||
#[async_trait] | ||
pub trait HttpAgentExtended { | ||
/// New http agent instance | ||
fn new(endpoint: String) -> Self; | ||
|
||
/// Check if the endpoint is valid | ||
async fn check_endpoint(&self) -> (); | ||
} |
Oops, something went wrong.