Closed RangerMauve closed 2 years ago
Nice. The query thing in particular is looking nice.
How do you feel about merging gun://_pubkey
and gun://$something
? I was thinking it could be something like gun://$pubkey/something
would be gun.user(pubkey).get(something)
and gun://$/something
would be gun.user().auth().get(something)
. That way $
would represent "the current user" and $pubkey
would represent "a specific user".
As well, would the concepts of aliases be combineable? Like, wold it be possible to detect when something is a pubkey
and when something is an alias
and automatically convert the string? e.g. $somebody
is different from $46ee244685c57a89587264affa072c5adae86c19fef686084f3ad66203b86c5e
and could be detected in code.
Would you be down for me submitting a PR with some of these changes?
How do you feel about merging gun://_pubkey and gun://$something? I was thinking it could be something like gun://$pubkey/something would be gun.user(pubkey).get(something) and gun://$/something would be gun.user().auth().get(something). That way $ would represent "the current user" and $pubkey would represent "a specific user".
then we would only have 1 current user, which means losing the ability to have multiple logged in users. as of right now, we have the ability to log in multiple users because we can specify with the .
character. if we merge pubkey and current user, then one will lose out.
As well, would the concepts of aliases be combineable? Like, wold it be possible to detect when something is a pubkey and when something is an alias and automatically convert the string? e.g. $somebody is different from $46ee244685c57a89587264affa072c5adae86c19fef686084f3ad66203b86c5e and could be detected in code.
that is what we are currently doing. _
is for both pubkey and alias(of other specific users)
updated the package again. so there are only 2 special characters now. -
and _
.
-
is for hex encoded hostname. such as gun://-someHexEncodedThingHere, 'someHexEncodedThingHere' can be 'someThing', gun-fetch will decode it, this is a way to get around browsers lowercasing the hostname
`by itself such as gun://_/ means you want user creation/login/logout/destroy, body will contain username and password
_with a pubkey, such as gun://_so-me.pub-key, gundb pubkey's have dashes and periods, so if the hostname has dashes and periods, we know its a pubkey
_` with an alias, such as gun://_someAlias, here is where the main change is, so is someAlias is the current user, then it will return the logged in user for crud, if someAlias is not logged in as a user, then it will treat it like someone else(another specific user)
so if _someAlias/something is not logged in -> gun.get('~@someAlias').get('something'), if _someAlias/something is logged in then -> gun.user().auth(someAlias).get('something')
yeah, do a pull request. though check out the changes that i made first. if there are changes you still want to make then yeah submit a pull request.
Sweet, sounds good to me! Would you like to send in a PR with the protocol handler? I'm down to update the docs once that's in. 😁
@RangerMauve pull request has been made
Gonna close it now that it's been released as part of v1.0.0-44
Thanks again for your hard work @resession !
It'd be cool to flush out a
gun-fetch
protocol handler.Main stuff that we'd need to figure out:
GUN
or should we have named GUN instances per 'origin' kinda like names inhyper://
.get
sequentiallycc @amark