-
Notifications
You must be signed in to change notification settings - Fork 177
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
Refactor HTTP api to better adhere to REST guidelines #2225
Conversation
Needs companion PRs in private, TypeScript SDK, C# SDK and docs. I can wait on the docs one, but the first three must happen before we merge this. |
Yep, makes sense 👍 |
That said, the changes look good, and I'll be happy to approve once we have the companion PRs ready to go. |
We definitely want to do that. I was meaning to do it for a long time. |
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.
The changes look good to me. I have two comments/requests:
-
In the
Identity
proposal and removeAddress
proposal, I proposed to remove the concept of TLD and domains in general, and instead replace it with database names, where a database name matches^[a-z0-9]+(-[a-z0-9]+)*$
(lowercase alphanumeric with internal dashes). That leaves room in the future for having multipart names likefoo.bar
orfoo/bar
in the future. This is only relevant to this PR insofar as we may not want to introduce a new/domain
route if we're going to just basically have/database/:name_or_identity/set-name
route. That being said, we have little time left and deprecating the/domain
route in favor of the newset-name
route is not a big deal. I am also fine to have a fix for that happen in anotherPR
. -
This needs a corresponding Private PR.
9a3ce60
to
83c96b3
Compare
The actual only functionality there is "register_tld". Is that something that just doesn't need to exist anymore? I wasn't sure whether that was being fully removed or not; I figured it can just be merged into publish, perhaps. |
TLDs are not functional, and this PR has not caused them to become functional. Notably, using If the |
674d5d5
to
b7d7dc9
Compare
b7d7dc9
to
cc2195e
Compare
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.
Upon further reflection I think that POST /database/:db/names
is the correct route.
This now LGTM. I'm okay to merge this.
Merged into the wrong branch 😔 #2243 is the PR into master. |
## Description of Changes Companion PR for the http api glowup. ## API Not a breaking change; this catches us up to being compatible with a breakage introduced by - clockworklabs/SpacetimeDB#2225. ## Requires SpacetimeDB PRs - clockworklabs/SpacetimeDB#2225 ## Testsuite SpacetimeDB branch name: master ## Testing Existing CI passes (it was failing without this change since it couldn't connect). Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Description of Changes
Based off #2181. This mainly hits
/database
, making the endpoints be/database/:dbname/verb
rather than/database/verb/:dbname
, and making the http methods be more accurate to what they do (e.g.DELETE /database/:dbname
rather thanPOST /database/delete/:dbname
). Dns stuff like register_tld (actually, just register_tld for now) got factored into its own/domain
path. Also, I put everything behind a/v1
prefix -- I could revert that if we don't wanna do that, but that feels like best practice for HTTP APIs in general.API and ABI breaking changes
Yes.
Expected complexity level and risk
3: obviously, there's a lot of stuff moving around here, but the smoketests are pretty thorough in exercising all the routes of the API, and if there's anything I miss here it's pretty easy to change.
Testing