style: change space to tab for goreport
This commit is contained in:
parent
30ada1a1fc
commit
3f9d4850b6
13 changed files with 853 additions and 842 deletions
|
@ -17,6 +17,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|||
- Export in a file
|
||||
- Use RandomString function for wallet's salt
|
||||
- Search is case insensite
|
||||
- change space to tab for goreport
|
||||
|
||||
## v1.1.0 - 2019-07-23
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# gpm: Go Passwords Manager
|
||||
|
||||
[![Version](https://img.shields.io/badge/latest_version-1.1.0-green.svg)](https://git.yaegashi.fr/nishiki/gpm/releases)
|
||||
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/gpm/src/branch/master/LICENSE)
|
||||
[![Build Status](https://travis-ci.org/nishiki/gpm.svg?branch=master)](https://travis-ci.org/nishiki/gpm)
|
||||
[![GoReport](https://goreportcard.com/badge/git.yaegashi.fr/nishiki/gpm)](https://goreportcard.com/report/git.yaegashi.fr/nishiki/gpm)
|
||||
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/gpm/src/branch/master/LICENSE)
|
||||
|
||||
gpm is passwords manager write in go and use AES-256 to encrypt the wallets
|
||||
|
||||
|
|
12
gpm/cli.go
12
gpm/cli.go
|
@ -17,13 +17,13 @@ package gpm
|
|||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"github.com/atotto/clipboard"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"github.com/atotto/clipboard"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
// Cli contain config and wallet to use
|
||||
|
@ -40,7 +40,11 @@ func (c *Cli) printEntries(entries []Entry) {
|
|||
tables = make(map[string]*tablewriter.Table)
|
||||
|
||||
for i, entry := range entries {
|
||||
if entry.OTP == "" { otp = "" } else { otp = "X" }
|
||||
if entry.OTP == "" {
|
||||
otp = ""
|
||||
} else {
|
||||
otp = "X"
|
||||
}
|
||||
if _, present := tables[entry.Group]; present == false {
|
||||
tables[entry.Group] = tablewriter.NewWriter(os.Stdout)
|
||||
tables[entry.Group].SetHeader([]string{"", "Name", "URI", "User", "OTP", "Comment"})
|
||||
|
|
|
@ -16,9 +16,9 @@ package gpm
|
|||
|
||||
import (
|
||||
"crypto/aes"
|
||||
"crypto/sha512"
|
||||
"crypto/cipher"
|
||||
"crypto/rand"
|
||||
"crypto/sha512"
|
||||
"encoding/base64"
|
||||
"io"
|
||||
mrand "math/rand"
|
||||
|
@ -89,9 +89,15 @@ func RandomString(length int, letter bool, digit bool, special bool) string {
|
|||
chars := ""
|
||||
randomString := make([]byte, length)
|
||||
|
||||
if letter { chars = chars + letters }
|
||||
if digit { chars = chars + digits }
|
||||
if special { chars = chars + specials }
|
||||
if letter {
|
||||
chars = chars + letters
|
||||
}
|
||||
if digit {
|
||||
chars = chars + digits
|
||||
}
|
||||
if special {
|
||||
chars = chars + specials
|
||||
}
|
||||
if !letter && !digit && !special {
|
||||
chars = digits + letters
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@ package gpm
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/pquerna/otp/totp"
|
||||
)
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
package gpm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
|
|
@ -20,12 +20,11 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"regexp"
|
||||
"time"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
// WalletFile contains the data in file
|
||||
type WalletFile struct {
|
||||
Salt string
|
||||
|
|
|
@ -2,8 +2,8 @@ package gpm
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue