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

Remove agency settings #208

Merged
merged 16 commits into from
Dec 4, 2020
Merged

Conversation

mirgee
Copy link
Contributor

@mirgee mirgee commented Nov 18, 2020

Removes the dependecy of aries-vcx on agency_client's agency_settings and creates an AgencyClient struct as a stepping stone toward multitenancy support.

Signed-off-by: Miroslav Kovar miroslavkovar@protonmail.com

libvcx/src/settings.rs Outdated Show resolved Hide resolved
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch 6 times, most recently from 091fc91 to b7ba597 Compare November 18, 2020 14:59
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch from b7ba597 to 63f05df Compare November 18, 2020 15:04
/// #Returns
/// Error code as a u32
#[no_mangle]
pub extern fn vcx_init_agency_client(command_handle: CommandHandle, wallet_handle: WalletHandle, config: *const c_char, cb: extern fn(xcommand_handle: CommandHandle, err: u32)) -> u32 {
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 hold off from extending API just yet. Let's keep this PR internal changes and refactoring only, then create issue with new API proposal (onboarding new agent, initializing existing agent, creating wallet, opening wallet, etc. ) - then implement those APIs in separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe before thinking about aries-vcx apis, we can first define agency_client APIs for creation and initialization:

  • create new client (create it in agency)
  • create client instance (create client/initialize create which can be used to talk to agency)

Create new client

I think all we need to create new client is: agency_url, agency_did, agency_verkey and a wallet handle.
The output of this operation should be whatever is need to create client instance. I'd suggest to output to be JSON config, just as it is currently on vcx_provision_agent

Create client instance / initialization

The required information here should be

  • agency_url
  • agency_did
  • agency_verkey
  • remote_to_sdk_did
  • remote_to_sdk_verkey
  • sdk_to_remote_did
  • sdk_to_remote_verkey
    and wallet handle, whereas it's up to agency_client consumer responsibility to pass in the correct wallet handle.

Copy link
Contributor

Choose a reason for hiding this comment

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

However this should not yet impact aries-vcx. Let's first design good api for the agency_client, then we can enhance API for aries-vcx

Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>

# Conflicts:
#	libvcx/src/api/vcx.rs
#	libvcx/src/aries/handlers/connection/agent_info.rs
#	libvcx/src/libindy/utils/wallet.rs
#	libvcx/src/settings.rs
#	libvcx/src/utils/devsetup.rs
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch 4 times, most recently from 315874f to 3439c0c Compare November 24, 2020 09:46
@mirgee mirgee marked this pull request as ready for review November 24, 2020 11:08
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch from 122b2cf to f269071 Compare November 24, 2020 11:47
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch from f269071 to a504eb5 Compare November 24, 2020 12:13
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch from f473590 to 1580a40 Compare November 30, 2020 10:47
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee changed the title WIP: Remove agency settings Remove agency settings Dec 1, 2020
@codecov-io
Copy link

codecov-io commented Dec 1, 2020

Codecov Report

Merging #208 (cefac4a) into master (b4731de) will decrease coverage by 1.14%.
The diff coverage is 43.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
- Coverage   58.84%   57.69%   -1.15%     
==========================================
  Files         148      149       +1     
  Lines       19408    19902     +494     
  Branches     4307     4464     +157     
==========================================
+ Hits        11420    11482      +62     
- Misses       4616     5071     +455     
+ Partials     3372     3349      -23     
Flag Coverage Δ
integration 26.14% <28.39%> (-0.56%) ⬇️
unittests 51.95% <36.78%> (-0.97%) ⬇️

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

Impacted Files Coverage Δ
agency_client/src/agency_client.rs 0.00% <0.00%> (ø)
agency_client/src/get_message.rs 85.71% <ø> (ø)
agency_client/src/lib.rs 57.14% <ø> (ø)
...aries/handlers/connection/invitee/state_machine.rs 71.58% <0.00%> (-0.20%) ⬇️
libvcx/src/connection.rs 61.81% <0.00%> (-0.15%) ⬇️
libvcx/src/init.rs 52.38% <0.00%> (-7.08%) ⬇️
libvcx/src/utils/error.rs 63.28% <ø> (ø)
libvcx/src/api/vcx.rs 69.34% <16.66%> (-3.14%) ⬇️
libvcx/src/error/mod.rs 34.56% <16.66%> (-1.12%) ⬇️
agency_client/src/error.rs 18.18% <20.00%> (ø)
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4731de...cefac4a. Read the comment docs.

@mirgee mirgee force-pushed the refactor/replace-agency-settings branch 2 times, most recently from 70e6b3c to 0459218 Compare December 2, 2020 16:40
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch from 0459218 to fdfed56 Compare December 2, 2020 19:25
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch from 180cbc9 to 8bba114 Compare December 2, 2020 21:26
agency_client/src/agency_settings.rs Outdated Show resolved Hide resolved
agency_client/src/error.rs Outdated Show resolved Hide resolved
agency_client/src/utils/error_utils.rs Outdated Show resolved Hide resolved
agency_client/src/utils/validation.rs Show resolved Hide resolved
libvcx/src/init.rs Outdated Show resolved Hide resolved
libvcx/src/settings.rs Outdated Show resolved Hide resolved
libvcx/src/settings.rs Outdated Show resolved Hide resolved
libvcx/src/settings.rs Outdated Show resolved Hide resolved
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
libvcx/src/settings.rs Outdated Show resolved Hide resolved
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>

# Conflicts:
#	agency_client/src/agent_utils.rs
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/replace-agency-settings branch from cffbed7 to cefac4a Compare December 4, 2020 09:36
@Patrik-Stas Patrik-Stas merged commit f688207 into master Dec 4, 2020
@Patrik-Stas Patrik-Stas deleted the refactor/replace-agency-settings branch December 4, 2020 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants