goldwarden-vaultwarden-bitw.../cli/ipc/messages/notes.go

103 lines
2.1 KiB
Go
Raw Normal View History

2023-09-20 03:05:44 +02:00
package messages
import "encoding/json"
type GetLoginRequest struct {
Name string
Username string
UUID string
OrgId string
GetList bool
}
type GetLoginResponse struct {
Found bool
Result DecryptedLoginCipher
}
type GetLoginsResponse struct {
Found bool
Result []DecryptedLoginCipher
}
type DecryptedLoginCipher struct {
Name string
Username string
Password string
UUID string
OrgaizationID string
Notes string
2024-01-20 17:34:42 +01:00
TOTPSeed string
URI string
2023-09-20 03:05:44 +02:00
}
type AddLoginRequest struct {
Name string
UUID string
}
type AddLoginResponse struct {
Name string
UUID string
}
type ListLoginsRequest struct {
}
func init() {
registerPayloadParser(func(payload []byte) (interface{}, error) {
var req GetLoginRequest
err := json.Unmarshal(payload, &req)
if err != nil {
panic("Unmarshal: " + err.Error())
}
return req, nil
}, GetLoginRequest{})
registerPayloadParser(func(payload []byte) (interface{}, error) {
var req GetLoginResponse
err := json.Unmarshal(payload, &req)
if err != nil {
panic("Unmarshal: " + err.Error())
}
return req, nil
}, GetLoginResponse{})
registerPayloadParser(func(payload []byte) (interface{}, error) {
var req GetLoginsResponse
err := json.Unmarshal(payload, &req)
if err != nil {
panic("Unmarshal: " + err.Error())
}
return req, nil
}, GetLoginsResponse{})
registerPayloadParser(func(payload []byte) (interface{}, error) {
var req AddLoginRequest
err := json.Unmarshal(payload, &req)
if err != nil {
panic("Unmarshal: " + err.Error())
}
return req, nil
}, AddLoginRequest{})
registerPayloadParser(func(payload []byte) (interface{}, error) {
var req AddLoginResponse
err := json.Unmarshal(payload, &req)
if err != nil {
panic("Unmarshal: " + err.Error())
}
return req, nil
}, AddLoginResponse{})
registerPayloadParser(func(payload []byte) (interface{}, error) {
var req ListLoginsRequest
err := json.Unmarshal(payload, &req)
if err != nil {
panic("Unmarshal: " + err.Error())
}
return req, nil
}, ListLoginsRequest{})
}