RFC: Optional dotNsIdentifier and permissioned external-account access#245
RFC: Optional dotNsIdentifier and permissioned external-account access#245valentinfernandez1 wants to merge 2 commits into
Conversation
Drop dotNsIdentifier from the seven local account, signing, and statement-store request bodies, callers pass only derivationIndex and the host resolves the caller's own domain.
|
Keeping as draft for now as this is a big breaking change and we need to settle on the best versioning strategy for this |
|
The Hard NO from my side |
|
Thanks for the feedback @valentunn, I was not aware of this requirement since in general we want per product isolation. Still part of my design still applies, I invite you to read though the issue as this is not necessarily removing it but rather removing it from these calls and creating explicit permissioned calls for products that want to access the user's account in another product. So if a product wants to access an account that is not from its on product it must be first explicitly be granted permission by the user |
|
I will refactor this draft though as I realized that there is a simpler way to approach this by keeping the |
|
Refactoring is done, I have also updated the title and description of this Draft to reflect the updated behavior |
| ```rust | ||
| struct ProductAccountId { | ||
| dot_ns_identifier: Option<String>, | ||
| derivation_index: u32, | ||
| } |
There was a problem hiding this comment.
maybe should be an enum for clarity ?
enum ProductAccountId {
Current {
derivation_index: u32,
},
Other {
dot_ns_identifier: String,
derivation_index: u32,
},
}There was a problem hiding this comment.
Both option and enum looks too specific for such a general purpose type: both approaches effectively forbird usage of ProductAccountId in a context where "current" is not defined
|
@valentunn is the requirement for requesting other product accounts only for reading or signing too? As discussed today I will create twin methods that explicitly request for external account (like |
|
I thought we discussed in the meeting and then explicitly summed up at the end, that
(2) allows to build more convenient APIs on top while also being usefull for products in other cases Making dot_ns_identifier nullable / enum would just make the API more complex and provide no real benefit imo Also,
This looks opposite to what we discussed actually |
|
About cross-product signing: yes, we generally want to allow all cross-product actions. We only want to limit something to the current product if the action doesn't make much sense in cross-product context, like deriving an entropy for a different product |
Yes, the permission part is already in this draft ( On the method shape I think we walked out with different takeaways, so let me make the case here instead. With the required field and the new method With the twin methods the only cost is a breaking change to the seven request types plus two new methods, which is not a big issue at the moment. |
|
I see no benefit in having
This is not true. TruAPI is not aiming for a perfect devEX it is aiming for completness and ability to have perfect devEx, which itself should be provided by product-sdk. So overall I get what the point you re trying to address. My take is that you are trying to address it on the wrong level |
Summary
The account, signing, and statement-store calls that operate on a product account take a
ProductAccountId { dotNsIdentifier, derivationIndex }, anddotNsIdentifieris optional.authenticated caller, so the common case only needs a
derivationIndex.new
ExternalAccountremote permission. LikeChainSubmitandStatementSubmit, it is triggeredimplicitly the first time a product makes such a call, and the host accepts or rejects based on the
grant.