Skip to content

Commit

Permalink
Merge pull request #113 from v-braun/feature/vbr/provide-additional-f…
Browse files Browse the repository at this point in the history
…ields

Feature/vbr/provide additional fields
  • Loading branch information
hazcod committed Apr 19, 2022
2 parents 8f3f1be + ef388a0 commit e5b81e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pkg/enpass/card.go
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
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

0 comments on commit e5b81e5

Please sign in to comment.