fission-codes / fission-server

Apache License 2.0
9 stars 0 forks source link

[bug]: `account/manage` handle error message #235

Closed hugomrdias closed 8 months ago

hugomrdias commented 8 months ago

Summary

Problem

When changing the handle for an account, where the domain does not have the TXT record yet the api returns this error:

Couldn't find DNS TXT record for _did.<domain> set to <accountDid>

and it should be

Couldn't find DNS TXT record for _did.<username>.<domain> set to <accountDid>
matheus23 commented 8 months ago

So, this is the relevant code for this request:

https://github.com/fission-codes/fission-server/blob/25a54e5e8a114c0acdb72883c5a74985011537e8/fission-server/src/routes/account.rs#L308-L330

It does indeed look for a DNS record at _did.<domain>.

I think you may be misunderstanding something. E.g. I'd be issuing a request PATCH /api/v0/account/handle/matheus23.com and have a DNS TXT record at _did.matheus23.com set to did:key:<accountDID>. There's no more username, only the handle.

hugomrdias commented 8 months ago

so the record is on _did.<domain> not on _did.<username>.<domain> ? but the local doh is on _did.<username>.localhost

what if domain owner whats to do multiple accounts ?

on the same topic i wrote some notes on username/handle :

hugomrdias commented 8 months ago

we should describe better username, handle and domain in the context of this api

matheus23 commented 8 months ago

what if domain owner whats to do multiple accounts ?

Then the domain owner should/could use subdomains. I.e. work.matheus23.com and personal.matheus23.com.

matheus23 commented 8 months ago

I think that's better than requiring them to add an additional subdomain. What if I do want to use matheus23.com? I don't want to be forced to use fission.matheus23.com or matheus23.matheus23.com, that'd be weird.

matheus23 commented 8 months ago

we should describe better username, handle and domain in the context of this api

Yep. :100:% Agree. Should we just use username as e.g. matheus23, and handle as matheus23.com or matheus23.computer.name? (or .localhost if running locally. Eventually I think it'll be .computer.name when deployed).

Also - what is your opinion on having handles & usernames simultaneously. I felt like it'd make sense to always have a username, since that's what we have control over. Otherwise it's possible that domain names expire, what would a user's username be then? That's why all of the things are somewhat weird right now. I only return the handle, if available in account info, not the username, even though in theory it still exists. But at the same time the patch handle & patch username routes are different. So it's weird.

matheus23 commented 8 months ago

Closing this in favor of #239

hugomrdias commented 8 months ago

I think that's better than requiring them to add an additional subdomain. What if I do want to use matheus23.com? I don't want to be forced to use fission.matheus23.com or matheus23.matheus23.com, that'd be weird.

How does a service know that it should use the top level domain for hugomrdias and not hugomrdias.hugodias.dev and for hugodias it's need to use subdomain because top level is taken by hugomrdias?

hugomrdias commented 8 months ago

we should describe better username, handle and domain in the context of this api

Yep. 💯% Agree. Should we just use username as e.g. matheus23, and handle as matheus23.com or matheus23.computer.name? (or .localhost if running locally. Eventually I think it'll be .computer.name when deployed).

Also - what is your opinion on having handles & usernames simultaneously. I felt like it'd make sense to always have a username, since that's what we have control over. Otherwise it's possible that domain names expire, what would a user's username be then? That's why all of the things are somewhat weird right now. I only return the handle, if available in account info, not the username, even though in theory it still exists. But at the same time the patch handle & patch username routes are different. So it's weird.

Imo we should only have handle, by default and as a fallback we provide .computer.name but users can setup up their own domain. We can call this username but we should only have one human readable property.

matheus23 commented 8 months ago

I think that's better than requiring them to add an additional subdomain. What if I do want to use matheus23.com? I don't want to be forced to use fission.matheus23.com or matheus23.matheus23.com, that'd be weird.

How does a service know that it should use the top level domain for hugomrdias and not hugomrdias.hugodias.dev and for hugodias it's need to use subdomain because top level is taken by hugomrdias?

The domain should be the source of truth. In a log-in form, you type hugodias.dev or hugodias.computer.name, depending on what you use/have set up. If what you have is a DID, then you use the account/info capability & endpoint, and you'll get the canonical name for the account, that'd be either hugodias.dev or hugodias.computer.name.

hugomrdias commented 8 months ago

I think that's better than requiring them to add an additional subdomain. What if I do want to use matheus23.com? I don't want to be forced to use fission.matheus23.com or matheus23.matheus23.com, that'd be weird.

How does a service know that it should use the top level domain for hugomrdias and not hugomrdias.hugodias.dev and for hugodias it's need to use subdomain because top level is taken by hugomrdias?

The domain should be the source of truth. In a log-in form, you type hugodias.dev or hugodias.computer.name, depending on what you use/have set up. If what you have is a DID, then you use the account/info capability & endpoint, and you'll get the canonical name for the account, that'd be either hugodias.dev or hugodias.computer.name.

agree, user set ups whatever he wants tld, subdomain, fission fallback (.computer.name) and logs in with that input