Open emmacasolin opened 2 years ago
Not every identity is always going to be connected… and one should be able to discover disconnected identities using the discover
command. Therefore search
should also work, however I'm wondering why not also default to disconnected too? Just rank the connected identities first.
Another thing is that it just continues and continues and never ends. This is a type of command that benefits from some level of pagination… but stream calls is interesting too.
For example this is a weird situation:
cmcdragonkai ➜ matrix-ml-1 ➜ ~/Projects/Polykey-CLI
$ ./dist/polykey.js identities list
gestalt
actionsList
identities
github.com:a1ec
nodeIds
veu6q4pppbeoumv9n3uj819t6c5thr8kb9jshpfco85l4cvst4c6g
gestalt
actionsList
identities
nodeIds
vmlqap14bckq01osbh2htm7t4fuvmbpdac080qd7dgqe5nc20ratg
cmcdragonkai ➜ matrix-ml-1 ➜ ~/Projects/Polykey-CLI
$ ./dist/polykey.js identities search a1ec
cmcdragonkai ➜ matrix-ml-1 ➜ ~/Projects/Polykey-CLI
$
You can see that I did identities discover github.com:a1ec
ahead of time, but it's not a connected identity. It does get into my gestalt graph of course, because I force discovered it. And then when I try to search, it doesn't show up!! This is very confusing for end users.
I think it should search through connected THEN disconnected and just keep going. No need for an extra flag. One may provide a property to tell the end user that this identity is a the global search and isn't part of the your connected identities!
Super important that the search function is case insensitive! It's important to also mention that identities discover
is case sensitive. But search should be case insensitive.
Given the idea of STDERR being used for diagnostic messages. It also means that it makes sense that it could be used to tell you if it was successful or not. Not sure.
Another thing is that when claiming, we often provide the ability to do identities claim github.com:CMCDragonkai
, but why do we need the identity ID as well? Our provide authentication only allows one authentication, we should technically be able to automatically know what the identity of our provider token is. And thus one can should just claim identities claim github.com
.
Specification
The
identities search
command was properly implemented in #320, however, it was left incomplete with only the ability to search across connected identities. The intended usage of theidentities search
command is as follows:However, attempting to use the
--disconnected
flag will currently result in theErrorProviderUnimplemented
error being thrown, since we have no way of searching across disconnected identities. Like searching across connected identities, the definition of 'disconnected identities' is provider-specific. Since we currently only support GitHub as a provider, this issue only needs to define disconnected identities (and the implementation for searching across them) for GitHub.Additional context
identities search
command usage: https://github.com/MatrixAI/js-polykey/pull/320#issuecomment-1020608006Tasks
Provider
interface to add a method for searching across disconnected identities