Skip to content

Commit

Permalink
Merge pull request #12 from lucor/release/0.22.2
Browse files Browse the repository at this point in the history
Release 0.22.2
  • Loading branch information
lucor authored Feb 17, 2024
2 parents 67dbf53 + 091cb79 commit 49d70a3
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog - Paw

## 0.22.2 - 17 February 2024

- sshagent: fix SignWithFlags implementation
- ui: update website info into about view
- ui: update SSH key filter label

- deps remove:
- golang.org/x/text

## 0.22.1 - 15 February 2024

- ui: detail view could not show multiline label correctly
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
golang.org/x/image v0.15.0
golang.org/x/sync v0.6.0
golang.org/x/term v0.16.0
golang.org/x/text v0.14.0
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce
)

Expand Down Expand Up @@ -40,6 +39,7 @@ require (
golang.org/x/mobile v0.0.0-20230531173138-3c911d8e3eda // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect
Expand Down
5 changes: 4 additions & 1 deletion internal/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ func (a *Agent) Unlock(passphrase []byte) error {
}

func (a *Agent) SignWithFlags(key ssh.PublicKey, data []byte, flags sshagent.SignatureFlags) (*ssh.Signature, error) {
return nil, ErrOperationUnsupported
if v, ok := a.sshagent.(sshagent.ExtendedAgent); ok {
return v.SignWithFlags(key, data, flags)
}
return nil, sshagent.ErrExtensionUnsupported
}

func (a *Agent) Extension(extensionType string, contents []byte) ([]byte, error) {
Expand Down
19 changes: 19 additions & 0 deletions internal/paw/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ const (
SSHKeyItemType
)

// Label returns the item type label used in the UI
func (it ItemType) Label() string {
switch it {
case MetadataItemType:
return "Metadata"
case NoteItemType:
return "Note"
case PasswordItemType:
return "Password"
case LoginItemType:
return "Login"
case SSHKeyItemType:
return "SSH key"
}
return "Invalid item type"
}

// String returns the item type string representation
func (it ItemType) String() string {
switch it {
case MetadataItemType:
Expand All @@ -41,6 +59,7 @@ func (it ItemType) String() string {
return "invalid"
}

// ItemTypeFromString returns the item type from a string
func ItemTypeFromString(v string) (ItemType, error) {
var itemType ItemType
var err error
Expand Down
4 changes: 2 additions & 2 deletions internal/ui/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func (a *app) makeMainMenu() *fyne.MainMenu {
}

func (a *app) about() {
u, _ := url.Parse("https://lucor.dev/paw")
u, _ := url.Parse("https://paw.pm")
l := widget.NewLabel("Paw - " + paw.Version())
l.Alignment = fyne.TextAlignCenter
link := widget.NewHyperlink("https://lucor.dev/paw", u)
link := widget.NewHyperlink("https://paw.pm", u)
link.Alignment = fyne.TextAlignCenter
co := container.NewCenter(
container.NewVBox(
Expand Down
5 changes: 1 addition & 4 deletions internal/ui/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"lucor.dev/paw/internal/icon"
"lucor.dev/paw/internal/paw"
)
Expand Down Expand Up @@ -154,11 +152,10 @@ func (a *app) makeCurrentVaultView() fyne.CanvasObject {
// filter entries
itemTypeMap := map[string]paw.ItemType{}
options := []string{fmt.Sprintf("All items (%d)", vault.Size())}
ca := cases.Title(language.Und)
for _, item := range a.makeEmptyItems() {
i := item
t := i.GetMetadata().Type
name := fmt.Sprintf("%s (%d)", ca.String(t.String()), vault.SizeByType(t))
name := fmt.Sprintf("%s (%d)", t.Label(), vault.SizeByType(t))
options = append(options, name)
itemTypeMap[name] = t
}
Expand Down

0 comments on commit 49d70a3

Please sign in to comment.