VictorNine / bitwarden-go

A Bitwarden-compatible server written in Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding a custom field fails with "An unexpected error"

sofixa opened this issue · comments

Hi,

First, great work! I've been playing around, and i seem to be unable to add a custom field from the Chrome extension(can't try it from the Web Vault because, like in #24 , objects aren't visible), it fails with "An unexpected error occurred" in the interface, and the following in the logs(running with docker-compose with one nginx, one bitwarden-go and one bitwarden-web with @leonghui 's containers):

                                                                                                                                                                           bw_back_1  | 2018/03/17 16:57:51 XXX is trying to edit his data                                                                                       bw_back_1  | 2018/03/17 16:57:51 Cipher decode errorjson: cannot unmarshal array into Go struct field newCipher.fields of type string                                       
nginx      | 2018/03/17 16:57:51 [error] 7#7: *768 upstream prematurely closed connection while reading response header from upstream, client: XXX.XXX.XXX, server: mybw.com, request: "PUT /api/ciphers/6 HTTP/2.0", upstream: "http://172.19.0.4:8000/api/ciphers/6", host: "mybw.com:8000"

And it seems the reason is at https://github.com/VictorNine/bitwarden-go/blob/master/internal/api/api.go#L172

Are custom fields supported?

Cheers,
Adrian

That's right these are not supported yet

I have implemented custom fields and Notes (at the moment only strings). So if you want to try it, you can use my forks master branch.
I plan to submit a pull request in the next time, but as I have done major changes it is hard to make my branch compatible with VictorNines.