-
Notifications
You must be signed in to change notification settings - Fork 98
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
fix(api): use accepted value for "Bitwarden-Client-Name" header #219
Conversation
7b1d74b
to
e07f0d7
Compare
For all of my nixos fellows waiting for the next release: rbw = prev.rbw.overrideAttrs (_: {
src = prev.fetchFromGitHub {
owner = "davla";
repo = "rbw";
rev = "fix/client-name-header";
sha256 = "sha256-Sgs+qjKdtS5i7zF86TLSZMVKTDoeYhIgKEwjUUXw/cc=";
};
cargoDeps = prev.rustPlatform.importCargoLock {
lockFile = (
prev.fetchurl {
url = "https://raw.githubusercontent.com/davla/rbw/dd6b65427de3a4b38d27350d8ad7ebacb29e97ff/Cargo.lock";
hash = "sha256-bAELLBb0x0BOGPMLBRX/s0qxqN8XOxUW9OUa55WjeaA=";
}
);
allowBuiltinFetchGit = true;
};
}); Even though this PR addresses the issue and works like a charm (thanks @davla 🙇♂️ ) IMHO the solution should look slightly differently -> my thoughts |
This PR solves #218 when I drop commit 1de97ec. With that commit, I get a compile error on ubuntu in WSL2:
|
@adrianschlatter I don't get that error when I try compiling it. I'm not super familiar with WSL, but my understanding is that it defaults to Ubuntu, which as a non-rolling distro sometimes doesn't have the latest versions of certain packages. What version of rustc are you using? You can find this out by running From using |
Thanks @saghm: It compiles with rustc 1.83.0. |
Since it's not clear to me when this upgrade will get merged, and then it might take some extra time for the new package to get released, I made an AUR package in case any other Arch users want to get this update in a way that doesn't require manually building/installing it: https://aur.archlinux.org/packages/rbw-client-header-fix |
applied, thanks! (and sorry for the delay here!) |
As mentioned in #175, the official Bitwarden server needs some extra HTTP headers to accept authentication requests.
Back then the value in the headers didn't matter, but apparently the time has come when it does. I keep receiving 429 HTTP responses with the header "Bitwarden-Client-Name: rbw".
Changing the value of the header to
"cli"
solves the issue."cli"
seems to be the most appropriate out of the list of values the official server accepts.During my investigation I also ran across the
Device-Type
header, that is added by the official Bitwarden SDK. I see it very likely that it'll become mandatory in the future, so I added it.