Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mediator and simple client implementation #977

Merged
merged 78 commits into from
Oct 24, 2023
Merged

Conversation

nain-F49FF806
Copy link
Member

@nain-F49FF806 nain-F49FF806 commented Sep 13, 2023

Client agent has majorly common code with mediator agent.
It's in essence one hybrid, with code organized separately.
This is in anticipation of splitting client into separate binary.

Then again, Aries agents are meant to be horizontal (p2p). So perhaps a multifunctional agent isn't all that odd.

@nain-F49FF806 nain-F49FF806 force-pushed the nain/mediator-client branch 2 times, most recently from ba7b96f to f619fab Compare September 14, 2023 00:02
@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2023

Codecov Report

Merging #977 (e020eba) into main (dbaac13) will increase coverage by 0.00%.
The diff coverage is n/a.

❗ Current head e020eba differs from pull request most recent head 23fd9fa. Consider uploading reports for the commit 23fd9fa to get more accurate results

@@           Coverage Diff           @@
##             main     #977   +/-   ##
=======================================
  Coverage   36.31%   36.32%           
=======================================
  Files         386      386           
  Lines       22040    22040           
  Branches     4062     4073   +11     
=======================================
+ Hits         8003     8005    +2     
  Misses      11877    11877           
+ Partials     2160     2158    -2     
Flag Coverage Δ
unittests-aries-vcx 36.32% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 4 files with indirect coverage changes

@nain-F49FF806 nain-F49FF806 force-pushed the nain/mediator-client branch 4 times, most recently from 241be31 to 54026f3 Compare September 21, 2023 18:43
@nain-F49FF806 nain-F49FF806 force-pushed the nain/mediator-client branch 2 times, most recently from 3b6393e to 66dc3a4 Compare October 3, 2023 11:31
@nain-F49FF806 nain-F49FF806 changed the title Add simple client implementation Add mediator and simple client implementation Oct 3, 2023
@nain-F49FF806 nain-F49FF806 changed the base branch from nain/mediator to main October 3, 2023 11:46
@Patrik-Stas
Copy link
Contributor

Hi @nain-F49FF806 note that all of the commits must be DCO signed

@nain-F49FF806
Copy link
Member Author

@Patrik-Stas Yes. This PR is currently WIP. (Specifically the unsigned commit)

I was using the (absence of) DCO as an automatic block. 😅

@nain-F49FF806 nain-F49FF806 force-pushed the nain/mediator-client branch 3 times, most recently from f66a1b3 to 23932c2 Compare October 6, 2023 16:41
Copy link
Contributor

@Patrik-Stas Patrik-Stas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review is not complete yet (far from it), but just submitting my intermediate comments

mediator/Cargo.toml Outdated Show resolved Hide resolved
mediator/Cargo.toml Outdated Show resolved Hide resolved
mediator/src/bin/mediator.rs Outdated Show resolved Hide resolved
mediator/src/bin/mediator.rs Outdated Show resolved Hide resolved
mediator/src/bin/mediator.rs Outdated Show resolved Hide resolved
mediator/src/agent/mod.rs Outdated Show resolved Hide resolved
@nain-F49FF806 nain-F49FF806 force-pushed the nain/mediator-client branch 3 times, most recently from ea170f4 to 8bb431e Compare October 12, 2023 15:25
Signed-off-by: Naian <[email protected]>
Has majorly common code with mediator agent.
It's in essence one hybrid, with organized code. Then again, aries agents are meant to be horizontal.

Signed-off-by: Naian <[email protected]>
The workspace Cargo.lock will be used since mediator is now part of workspace.
This can be removed

Signed-off-by: Naian <[email protected]>
Signed-off-by: Naian <[email protected]>
Signed-off-by: Naian <[email protected]>
Signed-off-by: Naian <[email protected]>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is commented, shall be removed?


Currently exposed endpoints.

```yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the endpoints below are now out of sync - but note my comments on endpoint routes, before you start changing this

Encrypted Aries messages (envelops) can be passed and received from this endpoint in json serialized format.
```

### Client API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove this, for once, I am not sure if there a value to the web client, I think TUI is a lot nicer, secondly if we were to keep this, it would probably be separate project. Let's keep this readme focus on mediator only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned elsewhere, but why don't we just keep the TUI in favor of this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep all workflows in the root .github/ directory

> The commits are made in such a way as to demonstrate and try one feature or workflow (refactoring) at a time.
> So the git log could be educative.
>
> ## Some Interesting commits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to include this somewhere along project plan notes, but probably doesn't belong here.

Comment on lines +32 to +33
.route("/forward", post(handle_forward))
.route("/pickup", post(handle_pickup))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these can be either:

  • a single didcomm endpoint
  • or 2 endpoints as you have it, but then I'd suggest /didcomm for 3rd party fw messages and /didcomm-client for didcomm messages from clients (eg connections, mediation coordition, pickup)

2 endpoints can be really good idea from oversight perspective, in logs it would be easier to distinguish between incoming 3rd party messages, client messages and plot stats and graphs out of that data

pub async fn respond_message_json(Json(body): Json<MessageJson>) -> Json<MessageResponseJson> {
Json(MessageResponseJson {
message: (body.message),
response: ("I am groot".to_owned()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 👍

let app = create_router().await;
info!("Starting server");
// add server task to main loop
axum::Server::bind(&"127.0.0.1:7999".parse().unwrap())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's the IP and the port configurable. You can keep the current values as defaults

// Copyright 2023 Naian G.
// SPDX-License-Identifier: Apache-2.0

// unimplemented!()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we going with mysql only, I guess we can remove the commented code?

@Patrik-Stas
Copy link
Contributor

@nain-F49FF806 I've left another round of comments. I think we could get initial version merged after these, and we can keep bigger improvements in a todo list externally

@Patrik-Stas
Copy link
Contributor

For now, I am merging this as is~ The outstanding comments shall be addressed in subsequent PRs

@Patrik-Stas Patrik-Stas merged commit 04b486b into main Oct 24, 2023
30 of 31 checks passed
@Patrik-Stas Patrik-Stas deleted the nain/mediator-client branch October 24, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants