-
Notifications
You must be signed in to change notification settings - Fork 17
Identity / IdentityProvider #8
Comments
If that looks good, we could create a |
Hey thanks for checking this out, Thiago! The identity needs to be serialized, how do you envision serializing the sign and verify functions? Also it is for public information and therefore shouldn't include the private key imo, its a job for the keystore, which means you need another in-memory-only object to handle interfacing with that |
We don't have to rely on stringify for it, we could provide a serialize function
Yeah but it wouldn't be added to the entry or anything. Actually, I only mentioned the private key because it's in the My view is that it would make sense, that way the Identity is responsible for signing/verifying entries and the IdentityProvider would only provide an Identity, not the signing/verification functionality |
It would make sense if we could serialize the verifyFn and allow identities to be self-verifying but its not clear how to do that...and without that not sure its the responsibility of identity to verify other identities. @haadcode made the point that we need to hit disk for every sign(entry) rn (perhaps this was your thinking) so could be a reason to have an ephemeral .key/sign field that we can load from disk once |
The serialization here only matters when we're adding the identity to the Entry, isn't that right? We wouldn't serialize the functions, I'm proposing that so |
|
So
Will it change depending on the Identity "type"? I mean, each different IdentityManager implementation could have their own Identity format? If that's correct then the default Identity format could be even simpler, no? We could have just the |
Thanks for the discussion and proposals on this! I agree there's an opportunity to clarify the identity and the identity provider a little. I don't think IdentityProvider should be called a manager. It doesn't manage identities as in allow users to modify the identity through it nor internally keep a track of identities. It just provides an orbit-db identity object that describes the identity being used. Agreed on the naming of the signature field, these could be improved. I think they should still be called signatures since that's what they are. The first on ( Re. adding a On the "log depending on IdentityProvider instead of just identity" and "passing only identity instead of identity provider": we discussed this at some point with @shamb0t and decided not to add .sign/.verify functions to Identity as per the reasoning above: it makes sense an identity can sign for their data, but an (individual) identity to verify other identities doesn't feel as natural and fitting. The identity will regardless need the provider internally and call its sign/verify functions. More generally, the idea is that IdentityProvider can "resolve" different identities (based on the .type field in Identity that @shamb0t was going to add), so for example a user can use ColonyIdentity but still use IdentityProvider to verify another type of identity. Third point to this is that Access Controller in .capAppend will need the IdentityProvider to call .verifyIdentity as per user's need (we don't verify it by default on every append) and even though this could be passed in via the identity, I feel putting that too into identity doesn't feel like the right place. To summarize:
|
I was looking at the
feat/identity
PR again. This is how theIdentity
looks now on the left and how I imagine it could look on the right (sorry for the horrible handwriting):Key
publicKey : String | Buffer
privateKey : String | Buffer
encoding : String (e.g: hex)
The basic Identity object would look like this:
id: String
key: Key
provider : IdentityProvider (?)
type: String
(eg. ColonyIdentity, Ethereum address, IPFS PeerID, Dat address, DID, even Twitter can be an IdentityProvider)sign: (e: Object) => { key: Key, signature: String }
verify : (e: Entry) => boolean
(signature) orbitKeyOwnershipProof : String
(pkSignature) externalIdentityOwnershipProof : String
sign
andverify
would be provided by theIdentityProvider
so when we create an identity the object get a hold on whatever the implementation is.This way we don't need to pass the provider to the log but just the identity object which will be responsible for signing and verifying entries (and to provide the necessary info for the AccessController
canAppend
method).How does it sound?
The text was updated successfully, but these errors were encountered: