Skip to content
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

Feature/vbr/provide additional fields #113

Merged
merged 2 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/enpass/card.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"github.com/pkg/errors"
"strings"

"github.com/pkg/errors"
)

/*
Expand Down Expand Up @@ -71,6 +72,9 @@ type Card struct {
Category string
Label string
LastUsed int64
Sensitive bool
Icon string
RawValue string

// encrypted
value string
Expand Down
6 changes: 4 additions & 2 deletions pkg/enpass/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (v *Vault) GetEntries(cardType string, filters []string) ([]Card, error) {
rows, err := v.db.Query(`
SELECT uuid, type, created_at, field_updated_at, title,
subtitle, note, trashed, item.deleted, category,
label, value, key, last_used
label, value, key, last_used, sensitive, item.icon
FROM item
INNER JOIN itemfield ON uuid = item_uuid
`)
Expand All @@ -212,11 +212,13 @@ func (v *Vault) GetEntries(cardType string, filters []string) ([]Card, error) {
if err := rows.Scan(
&card.UUID, &card.Type, &card.CreatedAt, &card.UpdatedAt, &card.Title,
&card.Subtitle, &card.Note, &card.Trashed, &card.Deleted, &card.Category,
&card.Label, &card.value, &card.itemKey, &card.LastUsed,
&card.Label, &card.value, &card.itemKey, &card.LastUsed, &card.Sensitive, &card.Icon,
); err != nil {
return nil, errors.Wrap(err, "could not read card from database")
}

card.RawValue = card.value

// if item has been deleted
if card.IsDeleted() {
continue
Expand Down