jcs / rubywarden

An unofficial, mostly Bitwarden-compatible API server written in Ruby (Sinatra and ActiveRecord)
ISC License
592 stars 49 forks source link

API Breaking Changes Coming #32

Closed kspearrin closed 6 years ago

kspearrin commented 6 years ago

@jcs Just thought you should know that there are some breaking changes coming to cipher API models.

  1. Cipher.Login.Uri on the request and response models is being deprecated in favor of Cipher.Login.Uris, an array of { "Uri": string, "Match": enum }
  2. The cipher response model is being updated to better match the request model. Namely:
    • Data prop is being deprecated.
    • Adding: Name, Notes, and Fields to the root object.
    • Adding: Login, Card, Identity, and SecureNote to the root object (their prop values were part of the dynamic Data property in the past).

Our API will handle these changes in a backwards compatible way for a few iterations since outdated client apps will still be expecting the old models for some time.

These changes are already in the Core API project and refactoring is being done in all client apps over the next few days.

linktohack commented 6 years ago

Thanks for your openness @kspearrin! Cannot think you're willing to contribute to this repo!

ghost commented 6 years ago

I don't see this API change mentioned, but I am seeing this with the latest extension:

Mar 20 19:50:16 colo bitwarden: 1.2.3.4 - - [20/Mar/2018:19:50:16 +0000] "GET /api/accounts/revision-date HTTP/1.1" 404 18 0.0008

edit: disregard. this is not new and not breaking anything

jcs commented 6 years ago

Please see #36 and help test these changes to work with the new upstream clients.

raufis27 commented 6 years ago

Tested Safari extension and it works. But iOS app doesn't load db anymore. It just keeps spinning.

kspearrin commented 6 years ago

This is because mobile apps don’t have the newest update yet and the fix here isn’t backwards compat. They will go out tomorrow.

kspearrin commented 6 years ago

@raufis27

Side note: did your safari extension auto update to 1.25.x? I've been trying to test the auto-updates there but it seems like none of my extensions ever update.

logic commented 6 years ago

FWIW, current android release crashes on sync as well, because Data isn't populated. It's (hopefully) a short-lived problem, but worth mentioning (and pretty easily rectified by generating a Data hash before sending the cipherDetails out the door).

The migration went perfectly for me with the auto-updated Firefox extension, and I have a... er... non-trivial database, so a big :+1: here.

jcs commented 6 years ago

I had some code in there to supply a legacy Data object in the old format (as well as Uri from Uris[0].Uri) but Cipher#update_from_params didn't support updating records from old clients, so I took it out. Since the new mobile clients are releasing tomorrow, I'll just wait to test with those.

raufis27 commented 6 years ago

@kspearrin I reinstalled extension. Didn't use update function.

raufis27 commented 6 years ago

Some issues:

  1. Can't add URL to item. Tried existing and new item. I see PUT request, but url not saved.
  2. Desktop app doesn't work, same problem as iOS app.
ghost commented 6 years ago

Confirmed, adding URI to an item seems to create a blank URI field.

jcs commented 6 years ago

That should be fixed with c3e0eb1f3. It was saving but the client was not reading it back properly because of the case.

@kspearrin It'd be really nice if all of the apps and API could agree on a case format 😀 It's odd that the browser extension sends everything in lowercase ("login": { "uris": [ "uri":) but then requires it back as "Login": { "Uris": [ "Uri":.

kspearrin commented 6 years ago

Yea, our server is case insensitive, so I guess we get a little lax with that. :-/ ideally everything would be camel.

jcs commented 6 years ago

Thanks for testing everyone, this functionality is now in HEAD