mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-23 16:42:18 -05:00
[PR #4386] [MERGED] Change API and structs to camelCase #24293
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/4386
Author: @dani-garcia
Created: 2/28/2024
Status: ✅ Merged
Merged: 6/23/2024
Merged by: @dani-garcia
Base:
main← Head:remove_upcase📝 Commits (9)
ccdcbc8Change API inputs/outputs and structs to camelCase8daa359Fix fields and password history716c9adUse convert_json_key_lcase_first813994eMake sends lowercaseb46a6e9Update admin and templatesb4c9518Update org revoke0d6a8b8Fix sends expecting size to be a string on mobile4988e33Convert two-factor providers to string3fe72caMerge branch 'main' into remove_upcase📊 Changes
37 files changed (+1953 additions, -2006 deletions)
View changed files
📝
src/api/admin.rs(+6 -6)📝
src/api/core/accounts.rs(+232 -247)📝
src/api/core/ciphers.rs(+180 -216)📝
src/api/core/emergency_access.rs(+67 -71)📝
src/api/core/events.rs(+25 -26)📝
src/api/core/folders.rs(+13 -19)📝
src/api/core/mod.rs(+29 -34)📝
src/api/core/organizations.rs(+389 -379)📝
src/api/core/public.rs(+38 -33)📝
src/api/core/sends.rs(+74 -80)📝
src/api/core/two_factor/authenticator.rs(+22 -33)📝
src/api/core/two_factor/duo.rs(+30 -30)📝
src/api/core/two_factor/email.rs(+35 -35)📝
src/api/core/two_factor/mod.rs(+30 -30)📝
src/api/core/two_factor/protected_actions.rs(+9 -8)📝
src/api/core/two_factor/webauthn.rs(+74 -86)📝
src/api/core/two_factor/yubikey.rs(+39 -37)📝
src/api/identity.rs(+9 -7)📝
src/api/mod.rs(+4 -9)📝
src/db/models/attachment.rs(+7 -7)...and 17 more files
📄 Description
This PR changes all the project's structs and API inputs and outputs from the old
PascalCaseformat to the newcamelCaseformat. 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:
OTPin/accounts/verify-otp, as that's what the clients send. That said we also checkotpKeysandNfcin yubikey, this is for backwards compat with older values stored on the server, now we serialize new versions tokeysandnfc.AttestationObjectandclientDataJsonin 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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.