-
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
Rust SDK: with_credentials
-> with_token
#2118
Conversation
See discussion on clockworklabs/com.clockworklabs.spacetimedbsdk#212 This PR replaces `DbConnectionBuilder::with_credentials` with `::with_token`, which does not require an `Identity` as argument. It also amends our machinery for saving and loading credentials to and from disk to suit the new API.
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'm not a fan of impl ToString
since this accepts almost any type in Rust ecosystem (any type that implements Display
), eg user can accidentally pass Some(true)
as a token and it will be silently stringified, but it's up to you.
No concerns otherwise.
We use |
Literally |
If you want to open a follow-up PR that changes all uses of |
As discussed on #2118, ToString is overly generic because it includes any type that implements Display. Instead, we only want to accept string-like types (whether owned or not), which is better covered by Into<String>.
Description of Changes
See discussion on clockworklabs/com.clockworklabs.spacetimedbsdk#212
This PR replaces
DbConnectionBuilder::with_credentials
with::with_token
, which does not require anIdentity
as argument. It also amends our machinery for saving and loading credentials to and from disk to suit the new API.API and ABI breaking changes
Yep!
Expected complexity level and risk
Testing
Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!