PUT /api/ciphers/move not implemented #2362

Closed
opened 2025-10-09 18:01:35 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @mprasil on GitHub.

New vault (#93) calls PUT on /api/ciphers/move to "Move selected" ciphers. We have POST handler already implemented for this, so this should be easy to fix.

Originally created by @mprasil on GitHub. New vault (#93) calls `PUT` on `/api/ciphers/move` to "Move selected" ciphers. We have `POST` handler [already implemented](https://github.com/dani-garcia/bitwarden_rs/blob/48e69cebab29585684be4bf22282ff1dd4697d24/src/api/core/ciphers.rs#L486) for this, so this should be easy to fix.
OVERLORD added the future Vaultgood first issuebug labels 2025-10-09 18:01:35 +03:00
Author
Owner

@krankur commented on GitHub:

Thanks @mprasil . I checked the data folder. I see 2 files inside it, rsa_key.der and rsa_key.pem. I also checked the permissions. The user has both read and write permissions on the data folder and as well as the 2 files inside the data folder. So, I tried to debug and it seems like 3 keys should have been created but only 2 are created. Creation of rsa_key.pub.der is failing here:

success &= Command::new("openssl").arg("rsa")
            .arg("-in").arg(&CONFIG.private_rsa_key)
            .arg("-inform").arg("DER")
            .arg("-RSAPublicKey_out")
            .arg("-outform").arg("DER")
            .arg("-out").arg(&CONFIG.public_rsa_key)
            .output().expect("Failed to create public der file")
            .status.success();

I also tried directly running openssl rsa -in rsa_key.der -inform DER -RSAPublicKey_out -outform DER -out rsa_key.pub.der in terminal. I am getting an error message saying unknown option -RSAPublicKey_out.

@krankur commented on GitHub: Thanks @mprasil . I checked the `data` folder. I see 2 files inside it, `rsa_key.der` and `rsa_key.pem`. I also checked the permissions. The user has both read and write permissions on the `data` folder and as well as the 2 files inside the `data` folder. So, I tried to debug and it seems like 3 keys should have been created but only 2 are created. Creation of `rsa_key.pub.der` is failing here: ``` success &= Command::new("openssl").arg("rsa") .arg("-in").arg(&CONFIG.private_rsa_key) .arg("-inform").arg("DER") .arg("-RSAPublicKey_out") .arg("-outform").arg("DER") .arg("-out").arg(&CONFIG.public_rsa_key) .output().expect("Failed to create public der file") .status.success(); ``` I also tried directly running `openssl rsa -in rsa_key.der -inform DER -RSAPublicKey_out -outform DER -out rsa_key.pub.der` in terminal. I am getting an error message saying `unknown option -RSAPublicKey_out`.
Author
Owner

@krankur commented on GitHub:

So, finally I found out the issue. It was the old openssl version being used. Even though I had 1.0.2l version installed through brew, the old version at /usr/local/bin/openssl was being picked up. I had to create a symlink to the newer version to make it work. https://apple.stackexchange.com/questions/126830/how-to-upgrade-openssl-in-os-x

@krankur commented on GitHub: So, finally I found out the issue. It was the old openssl version being used. Even though I had `1.0.2l` version installed through brew, the old version at `/usr/local/bin/openssl` was being picked up. I had to create a symlink to the newer version to make it work. https://apple.stackexchange.com/questions/126830/how-to-upgrade-openssl-in-os-x
Author
Owner

@krankur commented on GitHub:

Another question. While doing the setup I was following the instructions in Build.md file. Some of the instructions are out of date now, as in the latest vault release, project structure has been changed and the file settings.Production.json no longer exists. I had to use the previous release to build the project. Is the build process with the latest vault version documented anywhere?

Also, as per my understanding, the aim of this task is to accommodate the changes introduced as part of the latest vault release. So, to work on this bug I will need to setup the new vault. Is my understanding correct?

@krankur commented on GitHub: Another question. While doing the setup I was following the instructions in `Build.md` file. Some of the instructions are out of date now, as in the latest vault release, project structure has been changed and the file `settings.Production.json` no longer exists. I had to use the previous release to build the project. Is the build process with the latest vault version documented anywhere? Also, as per my understanding, the aim of this task is to accommodate the changes introduced as part of the latest vault release. So, to work on this bug I will need to setup the new vault. Is my understanding correct?
Author
Owner

@mprasil commented on GitHub:

Hi, I think the program fails to create the keys. Normally they are in the data directory, so make sure that whatever user you're running it under can create that folder and/or write to it.

@mprasil commented on GitHub: Hi, I think the program fails to create the keys. Normally they are in the `data` directory, so make sure that whatever user you're running it under can create that folder and/or write to it.
Author
Owner

@krankur commented on GitHub:

Hi, I am new to Rust and wanted to start contributing to open source projects. This bug looked like a good beginner task, so I decided to give it a shot. I forked and cloned the project, but on "cargo run" I am getting the following error message:

JWT keys don't exist, checking if OpenSSL is available...
OpenSSL detected, creating keys...
Error creating keys, exiting...

Can someone please guide me on what could be the issue here?

@krankur commented on GitHub: Hi, I am new to Rust and wanted to start contributing to open source projects. This bug looked like a good beginner task, so I decided to give it a shot. I forked and cloned the project, but on "cargo run" I am getting the following error message: ``` JWT keys don't exist, checking if OpenSSL is available... OpenSSL detected, creating keys... Error creating keys, exiting... ``` Can someone please guide me on what could be the issue here?
Author
Owner

@mprasil commented on GitHub:

Note that this is still beta branch, so not ready yet. There are couple bugs that need to be fixed (like this one) before the new Vault (2.0) is usable.

@mprasil commented on GitHub: Note that this is still beta branch, so not ready yet. There are couple bugs that need to be fixed (like this one) before the new Vault (2.0) is usable.
Author
Owner

@dani-garcia commented on GitHub:

It’s not documented at the moment, but you can look at the lines 16-25 of the dockerfile to get an idea of the setup.

Basically, clone the 2.0 repo, apply the patch and run the npm commands.

@dani-garcia commented on GitHub: It’s not documented at the moment, but you can look at the lines 16-25 of the dockerfile to get an idea of the setup. Basically, clone the 2.0 repo, apply the patch and run the npm commands.
Author
Owner

@mqus commented on GitHub:

I packaged vault for archlinux and as of my knowledge, you don't have to change anything anymore and the build process is as following (taken from build.sh in the vault repo):

$ npm install
$ npm run sub:update
$ npm run dist:selfhost

and the output directory is then build/

I have tested it and it worked fairly well but I can still be wrong.
EDIT: Ah there IS a patch :D I'll add that later today.

@mqus commented on GitHub: I packaged vault for archlinux and as of my knowledge, you don't have to change anything anymore and the build process is as following (taken from build.sh in the vault repo): $ npm install $ npm run sub:update $ npm run dist:selfhost and the output directory is then `build/` I have tested it and it worked fairly well but I can still be wrong. EDIT: Ah there IS a patch :D I'll add that later today.
Author
Owner

@dani-garcia commented on GitHub:

This should be fixed by #108

@dani-garcia commented on GitHub: This should be fixed by #108
Author
Owner

@krankur commented on GitHub:

Thanks to all. I was able to setup with Vault (2.0). Will start working on the bug now.

@krankur commented on GitHub: Thanks to all. I was able to setup with Vault (2.0). Will start working on the bug now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#2362