-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hive vote #28
Hive vote #28
Conversation
const [accountType, account, network] = sub.split('/'); | ||
|
||
if (!accountTypes.includes(accountType as AccountType)) { | ||
throw new Error(`Invalid account type: ${accountType}`); | ||
} | ||
|
||
if (!network.includes(network as Network)) { | ||
throw new Error(`Invalid network: ${network}`); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this need username (account
) validation as well? If not, I would assume that the above checks are just sanity checks.
This also brings up a bigger question. What do usernames look like for DID accounts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe they're just ceramic IDs. account is just any network dependant unique identifier in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are ceramic IDs? Do you mean did:key:....
s?
Also, what about the question about validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah they're just sanity checks, they allow us to return them types the type for a username is just string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok cool. I don't think this should block this PR, but it would probably be better for us to have a better understand of what the account
portion of the sub
look like for each network type.
Co-authored-by: Geoffrey Casper <[email protected]>
Co-authored-by: Geoffrey Casper <[email protected]>
Co-authored-by: Geoffrey Casper <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/api
in them despite caddy now adding that part