Skip to content

Commit

Permalink
Merge pull request #29 from animo/feat/issue-credential
Browse files Browse the repository at this point in the history
feat: issue credential + refactoring
  • Loading branch information
berendsliedrecht authored Dec 15, 2021
2 parents 10fcd2e + a9c3305 commit 7a35c91
Show file tree
Hide file tree
Showing 22 changed files with 701 additions and 228 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
[package]
name = "aries-cloudagent-controller-ferris"
version = "0.1.0"
authors = ["Animo Solutions"]
description = "A simple Aries Cloudagent Controller"
homepage = "animo.id"
edition = "2018"
repository = "https://github.com/animo/aries-datagenerator-toolkit"
keywords = ["aries", "cloudagent", "controller", "cli-tool"]
categories = ["aries", "cloudagent", "controller", "cli-tool"]

[[bin]]
name = "accf"
Expand Down
14 changes: 14 additions & 0 deletions Makefile
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 .
69 changes: 64 additions & 5 deletions cli.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# General information
name: Aries Cloudagent Controller Ferris
version: "0.1.0"
author: Animo Solutions
about: An Aries Cloudagent Controller to interact with an Aries instance for quick data manipulation


# Application settings
settings:
- ArgRequiredElseHelp
Expand Down Expand Up @@ -43,3 +39,66 @@ subcommands:
short: l
long: alias
takes_value: true
- connections:
about: connections subcommand
version: "0.1.0"
args:
- id:
help: connection id
short: i
long: connection-id
takes_value: true
- alias:
help: filter on alias
short: a
long: alias
takes_value: true
- features:
about: discover features subcommand
version: "0.1.0"
- message:
about: basic message subcommand
version: "0.1.0"
args:
- connection-id:
help: connection id
short: i
long: connection-id
takes_value: true
required: true
- message:
help: message to send to the connection
short: m
long: message
takes_value: true
required: true
- issue-credential:
about: issue credentials subcommand
version: "0.1.0"
args:
- connection-id:
help: connection id
short: i
long: connection-id
required: true
takes_value: true
- credential-definition-id:
help: credential definition id
short: d
long: cred-def-id
required: true
takes_value: true
- key:
help: key
short: k
long: key
required: true
takes_value: true
multiple: true
- value:
help: value
short: v
long: value
required: true
takes_value: true
multiple: true
15 changes: 0 additions & 15 deletions src/agent/agent.rs

This file was deleted.

37 changes: 37 additions & 0 deletions src/agent/agents.rs
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) -> ();
}
Loading

0 comments on commit 7a35c91

Please sign in to comment.