Done
Details
Assignee
Marcin SwieczkowskiMarcin SwieczkowskiReporter
Marcin SwieczkowskiMarcin SwieczkowskiLabels
Start date
Jun 26, 2018End date
Jul 06, 2018Story Points
20Components
Priority
Major
Details
Details
Assignee
Marcin Swieczkowski
Marcin SwieczkowskiReporter
Marcin Swieczkowski
Marcin SwieczkowskiLabels
Start date
Jun 26, 2018
End date
Jul 06, 2018
Story Points
20
Components
Priority
Created June 26, 2018 at 3:33 PM
Updated July 12, 2018 at 11:13 PM
Resolved July 12, 2018 at 11:13 PM
This task supersedes https://maidsafe.atlassian.net/browse/MAID-2718#icft=MAID-2718 (see the task description and comments for details).
Remove the
ClientType
struct fromsafe_core::client
and provide application-specificClient
types. This will decouplesafe_core
fromsafe_auth
andsafe_app
as the current design assumes the existence of those libraries.Details:
Replace the current
Client
struct with aClient
trait insafe_core
. The methods from the current struct can be moved to the new trait with their implementations intact.Create application-specific clients for safe_authenticator (
RegisteredClient
) and safe_app (UnregisteredClient
andKeysClient
) which implement theClient
trait.Move the authenticator-specific code from
safe_core::client
intoRegisteredClient
. For example, functions likeClient::set_access_container
orClient::update_account_packet
.Also create a new
CoreClient
struct internal tosafe_core
, for use in testing. It should be a barebones implementation of theClient
trait.The current
Client
constructors (e.g.registered
andunregistered
) should be moved to the appropriate new application-specificClient
struct. The constructors should be markedpub(crate)
so that other applications cannot initialize instances of theClient
but they are still public within the crate.Publically-exported functions in
safe_core
that currently take aClient
parameter should take a generic parameter that implementsClient
.Make
safe_core::event_loop::run
take a generic client instead of a givenClient
struct.In
safe_app
, only exportUnregisteredClient
andKeysClient
(with its constructors only public within the crate). TheClient
trait will have an implementation for thenew
constructor, which we don't want to export.Update all tests that use the current API.
Update documentation for all affected functions and structs.
Misc changes:
Move the
Client::sign_pk_from_seed
function fromimpl Client
into a standalone function insafe_core::lib.rs
, as this is a "static method" which has no real reason to be associated withClient
.