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

Some Updates #36

Merged
merged 3 commits into from
Nov 30, 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
33 changes: 17 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
language: go
sudo: false

arch:
- amd64
- ppc64le
go:
- 1.16.x
- 1.15.x
- 1.19.x
- 1.18.x

git:
depth: false

install:
- go get -t ./...
- go get github.com/mattn/goveralls
- go get -u honnef.co/go/tools/cmd/staticcheck
- go get -u github.com/client9/misspell/cmd/misspell
- go install github.com/mattn/goveralls@latest
- go install honnef.co/go/tools/cmd/staticcheck@latest
- go install github.com/client9/misspell/cmd/misspell@latest

before_script:
- $(exit $(go fmt ./... | wc -l))
- go vet ./...
- misspell -error -locale US .
- misspell -error -locale US ./nk
- staticcheck ./...

script:
- go test -v
- go test -v --race
- go test -v -vet=off --race --failfast
- go test -v -covermode=count -coverprofile=coverage.out
- $HOME/gopath/bin/goveralls -coverprofile coverage.out -service travis-ci

#deploy:
#- provider: script
# skip_cleanup: true
# script: curl -sL http://git.io/goreleaser | bash
# on:
# tags: true
# condition: $TRAVIS_OS_NAME = linux
deploy:
- provider: script
skip_cleanup: true
script: curl -sL http://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/nats-io/nkeys

go 1.16
go 1.19

require golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
require golang.org/x/crypto v0.3.0
11 changes: 2 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A=
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
15 changes: 7 additions & 8 deletions nk/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2019 The NATS Authors
// Copyright 2018-2022 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -21,7 +21,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"runtime"
Expand Down Expand Up @@ -130,7 +129,7 @@ func sign(fname, keyFile string) {
log.Fatal(err)
}

content, err := ioutil.ReadFile(fname)
content, err := os.ReadFile(fname)
if err != nil {
log.Fatal(err)
}
Expand All @@ -153,15 +152,15 @@ func verify(fname, keyFile, pubFile, sigFile string) {
var kp nkeys.KeyPair
if keyFile != "" {
var seed []byte
seed, err = ioutil.ReadFile(keyFile)
seed, err = os.ReadFile(keyFile)
if err != nil {
log.Fatal(err)
}
kp, err = nkeys.FromSeed(seed)
} else {
// Public Key
var public []byte
public, err = ioutil.ReadFile(pubFile)
public, err = os.ReadFile(pubFile)
if err != nil {
log.Fatal(err)
}
Expand All @@ -171,12 +170,12 @@ func verify(fname, keyFile, pubFile, sigFile string) {
log.Fatal(err)
}

content, err := ioutil.ReadFile(fname)
content, err := os.ReadFile(fname)
if err != nil {
log.Fatal(err)
}

sigEnc, err := ioutil.ReadFile(sigFile)
sigEnc, err := os.ReadFile(sigFile)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -288,7 +287,7 @@ func createVanityKey(keyType, vanity, entropy string, max int) nkeys.KeyPair {

func readKeyFile(filename string) []byte {
var key []byte
contents, err := ioutil.ReadFile(filename)
contents, err := os.ReadFile(filename)
if err != nil {
log.Fatal(err)
}
Expand Down
File renamed without changes.
File renamed without changes.