-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Change API and structs to camelCase #4386
Conversation
4074a8a
to
909e0d7
Compare
f40f45a
to
c54f75e
Compare
c54f75e
to
0f5cb4c
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.
I still see a few non-camelCase key's in outputted JSON. For example in identity.rs
Ill check further but this was what is saw rather quickly.
Also, card vault types have |
Also, not sure, but isn't it more useful to use |
On this PR, and web 2024.05 confirming users to orgs does not work (I'm not sure if this is due to the PR, or due to the web vault changing), but since this is the same kind of issue it makes sense to solve here. Specifically, the body the web vault sends contains "key:", while the server expects "Key:" on the post body to |
Also, for native app compatibility, there seem to be some keys missing for organization profile responses, like causing the native app(s) [only tested for iOS] to crash for accounts in an organization. |
Also, somehow all custom fields in the sync response are null on this branch, (making custom fields inaccessible on all clients). |
663c8f8
to
d5148bc
Compare
@quexten Thanks for the review! I fixed the invalid case in @BlackDex I didn't even notice |
Native apps are available in beta now, so we should try getting this merged soon: |
Fixed in the latest main, uploads should work in the next beta update. |
Ill see if i can do some more testing soon. |
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 just did some testing with my local accounts i use for debugging, and these are my findings so far.
- The admin UI doesn't work, the user and org overview are broken because the handlebar templates are not updated.
- For some reason in the Android Emulator i can't login at all, but that is not something we can fix i think.
On my physical phone (Pixel 7) it also doesn't work, i can login, but the sync fails on the client side.
- Sends have a
text
object which have the keysHidden
andText
those are still capital-case
"text": {
"Hidden": false,
"Text": "2.j2Z/rN...TbjMvCQ==|/Kk0bfdc...68kv8A==|W1qbVban...AVJYYJRPy/WbK5iQeEQJIWwJh1k="
}
- The same for Sends
file
:
"file": {
"FileName": "2.KcN9y...GuollclQ==|XxaO+KyT4fjIIYRb...MNxZ8VeHAAz4=|hruuM...PU4A=",
"Id": "25587de08f158fe7ecfef24d22fc600c596efaf53bc5d7e23125e75c033a49bb",
"Size": 10737,
"SizeName": "10.49 KB"
},
Other than that, i have not yet found anything which could be wrong any futher
Small update, Those sends were added via the PascalCase version of Vaultwarden. |
Okay, sends should be fixed and changed to lowercase now, and the admin templates are updated too. I've also updated the org revoke API endpoint which was using |
Login with device seems to result in an error, where the request was unable to be processed. |
I've tried sends: Text is okay. File results in an error for me with the beta app... EDIT: Also when I upload a testfile to the webui and refresh the app, it does not the uploaded files. only text sends |
Some values need to be converted from diff --git a/src/api/identity.rs b/src/api/identity.rs
index 89c82859..523a267a 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -564,8 +564,11 @@ async fn _json_err_twofactor(providers: &[i32], user_uuid: &str, conn: &mut DbCo
let mut result = json!({
"error" : "invalid_grant",
"error_description" : "Two factor required.",
- "TwoFactorProviders" : providers,
- "TwoFactorProviders2" : {} // { "0" : null }
+ "TwoFactorProviders" : providers.iter().map(|i| i.to_string()).collect::<Vec<String>>(),
+ "TwoFactorProviders2" : {}, // { "0" : null }
+ "MasterPasswordPolicy": {
+ "Object": "masterPasswordPolicy"
+ }
});
for provider in providers { |
I fixed an issue with Sends sending their size as a integer instead of a string, which was breaking the ios app, also fixed the issue mentioned with twofactorproviders being sent as ints too |
I can confirm this solves the issue I had with sends. |
I see there's a lot of interest in this issue so for anyone who's following this, the docker images including this PR are now available at the |
POST /api/ciphers/create fails on testing using Android Native Beta. Not sure though if app issue or vaultwarden |
I can reproduce this too. Looks like the client still send |
I can also reproduce, running latest Bitwarden Beta on Android 14 and |
On IOS it is working perfect ( Version 2024.6.1 Build 1151, IOS 17.5.1) |
The issue with cipher creation in Android should be fixed now with #4670, builds should be ready in half an hour-ish |
Sorry if this is an odd question, but can I share the data set of the prod version along the testing version? I’ve tried the testing image earlier (seperate data folder) and it was working fine on my iPhone. So I thought about using it along the prod environment and maybe switch apps back and forth. Thanks for your work and commitment to this amazing project! |
If the database is not SQLite, it kinda can. Push/Websocket notifications will not traverse those different servers, but that is about it |
I can also confirm that it works on iOS |
I'm unable to download/view attachment on iOS beta app. Not sure if that's related though. |
Works for me on Android. Check your domain settings. If those are not correct it will not work. |
It is working perfect on iOS |
I just tested again. It seems like image attachments works fine but PDF attachment doesn't work. |
PDF works fine for me too. it might be your phone which has issues with the attachment maybe? For me it just saves the files and i need to open it with a different app afterwards. So it doesn't matter what extension it is using. |
Can confirm. PDF and other attachments work fine in the web interface and in the iOS beta app. |
This PR changes all the project's structs and API inputs and outputs from the old
PascalCase
format to the newcamelCase
format. At the moment the clients support both but that won't be a thing forever.I haven't had the time to fully test this, but at least the basic things work. There may be some things missing, and I still need to review what we store in the db to make sure that there aren't any backwards compat issues.
This might also cause problems with other pending PRs so we can wait to merge it until they are dealt with.
Some fields that have special casing:
OTP
in/accounts/verify-otp
, as that's what the clients send. That said we also checkotp
Keys
andNfc
in yubikey, this is for backwards compat with older values stored on the server, now we serialize new versions tokeys
andnfc
.AttestationObject
andclientDataJson
in webauthn, as that's what the clients send. This is a bigger annoyance as it complicates the use of the webauthn crate.camelCase
.Fixes #4656