Closed mikera closed 4 years ago
Moved back to in-progress, until we have a stable API proposal that must include:
Needs to be will explained in JavaDocs and doc site
@shark8me adding you since you are a consumer of this
Done
@ilyabukalov Where is this documented currently? If I want to use the resolver in a "Hello World" type case how do I do it?
@pedrorgirardi FYI this is the functionality you will need in surfer, great if you could review.
Thanks Ilya.
Some comments:
@ayush the construction of the credential map looks a bit unwieldy from a user perspective can you simplify this? I'm expecting something like RemoteAccount.create(username, password). We shouldn't be forcing users to construct hashmaps just to do this!
@mikera my use case was a function that gets an Agent from a DID so then we can use the get-asset
function and pass the resolved Agent as a parameter.
starfish-clj currently uses a LocalResolverImpl
to get a DDO for the specific DID and then create a remote Agent. The problem then is that the resolved Agent might require authentication and we don't have a solution for that - independently of the Resolver implementation - e.g., LocalResolverImpl
, DexResolver
.
- Most important from a user perspective is a function that gets an agent or asset from a given DID. It should not be tied to a specific implementation (DEXResolver, RemoteAgent) since it needs to work with other implementations e.g. Squid/Ocean assets. Where is the public API for this? Perhaps @pedrorgirardi you can comment further on what you need here?
Starfish as library does not have configs by design and our decision. The config which is used here is created specially for integration tests. Current "real users" of DexResolver are only admiral and surfer. Both of them have required configuration. And no one else except them have this configuration @pedrorgirardi Could you clarify and confirm whether I am correct and do you need anything else more than defined interface (except authorization as you described above)?
- Line 6-7: Should wrap these exception types with appropriate starfish exceptions (avoid exposing web3-specific implementation details)
ok. Can be done.
- Line 36-37: Why two different configs? Please document. Also must be possible to use starfish as a library with minimal/zero config so what are the defaults?
It is just for demonstration in integration tests. The case where you register from one resolver (assuming it is separated computer) and resolving from another computer. And as well for the specific case with permission control, where write/update DDO is not allowed by another account. These two configs are exactly the same except that they have different account. This behaviour with permission control I described here in "Resolver" section. There is no defaults because of there is no config as I said above. Universal Resolver as part of starfish is impossible since there is no configs on starfish (where resolver should connect) or we need to review and change again the approach to configs in starfish-java. @AyushVerma2 could you help and clarify this? Since there are still a lot of questions I will create separated document in DEP with step by step explanation with coding.
- Should add an integration test that resolves a real, known agent (e.g. https://dex-surfer-prod.herokuapp.com/)
It is exactly what I have done. It works but I didn't commit it because it has another issue which I described here
Authorization is not clear for everyone now. Probably @shark8me is the first person who has developed some first approach. We need to listen him at first to continue our further steps. For a while, regarding concrete case with DexResolver integration, we decided on our latest call to use hardcoded values of authorization.
@mikera my use case was a function that gets an Agent from a DID so then we can use the
get-asset
function and pass the resolved Agent as a parameter.
Exactly. This would perfectly suit to existing starfish interface.
Starfish as library does not have configs by design and our decision. The config which is used here is created specially for integration tests.
So what do we expect a library user to do? What is idiomatic usage of the resolver in user code?
My opinion is based on the limited circumstances which we have now by the design:
Moreover, there are cases where there are several networks with several different accounts or one network with several different accounts. So thats why config (which contains both network+account settings) should be separated of code to provide such customization for user.
@ayush the construction of the credential map looks a bit unwieldy from a user perspective can you simplify this? I'm expecting something like RemoteAccount.create(username, password). We shouldn't be forcing users to construct hashmaps just to do this!
I will be fixing this by this week
My opinion is based on the limited circumstances which we have now by the design:
- Starfish java does not provide any config by design (if it is wrong design? Then lets rebuild it @AyushVerma2).
- DexResolver must have an account on chain, it must be initialized somehow by an account. => which cause
- Being part of starfish DexResolver is supposed to accept some external config created by user. There is no other choices in the current design of starfish. The config format is very simple and I will describe it in new DEP document as I commented above.
Moreover, there are cases where there are several networks with several different accounts or one network with several different accounts. So thats why config (which contains both network+account settings) should be separated of code to provide such customization for user.
Currently Starfish lib used config only for running IT test case.In Src code there should be no reference of it. @ilyabukalov : let discuss on this tomorrow.
@ayush the construction of the credential map looks a bit unwieldy from a user perspective can you simplify this? I'm expecting something like RemoteAccount.create(username, password). We shouldn't be forcing users to construct hashmaps just to do this!
I will be fixing this by this week
This is fixed and code pushed to develop branch.Please refer testcase below to verify: In TestRemoteAgentTest_26.java, testCreatRemoteAccount_WithUsernamePassword testCreatRemoteAccount_WithWrongUsernamePassword
- Line 6-7: Should wrap these exception types with appropriate starfish exceptions (avoid exposing web3-specific implementation details)
https://github.com/DEX-Company/starfish-java/commit/8994738f3dcd2a577707f2c3eb715b905fff2e9b Transaction exception is removed. CipherException has dependency from squid. But it is rather formal dependency than real functioning. I will try to do refactoring to remove squid at all (and check whether it is possible)
Please review everything and close.
We need Integration Testing as a part of Starfish-java.
It should be possible to get a DDO (as a String) for any given DID registered on-chain.
It should also be possible to register a DDO for a DID given an ethereum account