SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Allow building custom standalone servers

Open m1guelpf opened this issue 8 months ago • 7 comments

Description of Changes

Expands the spacetimedb-standalone crate to also serve as a library to build your own standalone servers with custom auth services and more. This is accomplished by:

  • Publishing some structs/properties to allow reusing the existing StandaloneEnv instead of having to recreate it from scratch.
  • Make StandaloneEnv abstract over any JwtAuthProvider and not just the default (but still default to DefaultJwtAuthProvider, so no API changes for existing clients)

API and ABI breaking changes

I don't believe this includes any breaking changes, other than some of the crate's API now being public. Since the crate is currently marked as unstable, this should be fine.

Expected complexity level and risk

Changes are very simple.

Testing

I'm using this branch locally to develop a custom SpacetimeDB server with stricter authentication requirements.

m1guelpf avatar Mar 10 '25 16:03 m1guelpf

@jdetter lmk how I can go about signing the CLA

m1guelpf avatar Mar 11 '25 00:03 m1guelpf

@m1guelpf Could you send me an email to [email protected]? Thanks, we'll keep an eye out for it 🙂

jdetter avatar Mar 11 '25 16:03 jdetter

@m1guelpf We're happy to move forward with this. Just a note: While we guarantee API/ABI stability for future 1.* versions of SpacetimeDB, we can't make the same guarantee for using SpacetimeDB as a library. Your code may get broken without notice!

bfops avatar Apr 04 '25 16:04 bfops

(also it looks like we have some merge conflicts now - if you can get those fixed, we should be good to go!)

bfops avatar Apr 04 '25 18:04 bfops

@bfops resolved the conflicts! crate stability is not an issue for me, I was planning to pin to a commit anyways 😁

m1guelpf avatar Apr 07 '25 19:04 m1guelpf

Hey @m1guelpf - based on the test failures, it looks like some more crates need updating.

bfops avatar Apr 07 '25 20:04 bfops

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 03 '25 18:05 CLAassistant