Skip to content

Commit

Permalink
Merge branch 'master' into mysql
Browse files Browse the repository at this point in the history
* master:
  Don't timeout users entering OAuth info (google#1195)
  Linter fixups (google#1197)
  • Loading branch information
gdbelvin committed Feb 8, 2019
2 parents 76ea772 + 5ac39fe commit 798d185
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
13 changes: 7 additions & 6 deletions .golangci.yml
@@ -1,8 +1,3 @@
run:
skip-file:
- ".+\\.pb\\.go"
- ".+\\.pb\\.gw\\.go"

linters-settings:
govet:
check-shadowing: false
Expand All @@ -17,6 +12,12 @@ linters-settings:
min-occurrences: 3
misspell:
locale: US
depguard:
list-type: blacklist
packages:
- golang.org/x/net/context
- github.com/gogo/protobuf/proto
- github.com/google/martian/log

linters:
enable-all: true
Expand All @@ -30,4 +31,4 @@ linters:

issues:
exclude:
- .((os\.)?std(out|err)\..*|.*Close|.*Flush|.*Write|.*Serve|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv).
- .(.*Write|.*Serve).
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -34,7 +34,7 @@ before_install:

install:
- gcloud -q components install kubectl
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.13.1
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.13.2
- go get -t ./...

script:
Expand Down
3 changes: 1 addition & 2 deletions cmd/gen-test-vectors/main.go
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/google/keytransparency/core/testutil"
"github.com/google/keytransparency/impl/authentication"
"github.com/google/keytransparency/impl/integration"
"github.com/google/martian/log"
"github.com/google/tink/go/tink"
"github.com/google/trillian/types"

Expand Down Expand Up @@ -89,7 +88,7 @@ func GenerateTestVectors(ctx context.Context, env *integration.Env) error {
MaxBatch: 100,
}
if _, err := env.Sequencer.RunBatch(ctx, req); err != nil {
log.Errorf("RunBatch(): %v", err)
glog.Errorf("RunBatch(): %v", err)
}
})
}()
Expand Down
9 changes: 5 additions & 4 deletions cmd/keytransparency-client/cmd/post.go
Expand Up @@ -75,9 +75,7 @@ User email MUST match the OAuth account used to authorize the update.
return fmt.Errorf("hex.Decode(%v): %v", data, err)
}
userID := args[0]
timeout := viper.GetDuration("timeout")
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
ctx := context.Background()

// Create client.
userCreds, err := userCreds(ctx)
Expand Down Expand Up @@ -107,7 +105,10 @@ User email MUST match the OAuth account used to authorize the update.
PublicKeyData: profileData,
AuthorizedKeys: authorizedKeys.Keyset(),
}
if _, err := c.Update(ctx, u, []tink.Signer{signer},
timeout := viper.GetDuration("timeout")
cctx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
if _, err := c.Update(cctx, u, []tink.Signer{signer},
grpc.PerRPCCredentials(userCreds)); err != nil {
return fmt.Errorf("update failed: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion core/client/multi/writer.go
Expand Up @@ -48,7 +48,7 @@ func (m *writer) Write(p []byte) (n int, err error) {
for _, w := range m.writers {
n, err = w.Write(p)
if err != nil {
multiError = multiError + fmt.Sprintf("%v bytes written to %v: %v", n, w, err)
multiError += fmt.Sprintf("%v bytes written to %v: %v", n, w, err)
}
minBytesWritten = min(n, minBytesWritten)
}
Expand Down
2 changes: 1 addition & 1 deletion core/crypto/tinkio/pem.go
Expand Up @@ -20,7 +20,7 @@ import (
"errors"
"fmt"

"github.com/gogo/protobuf/proto"
"github.com/golang/protobuf/proto"
"github.com/google/tink/go/signature"
"github.com/google/tink/go/testutil"
"github.com/google/tink/go/tink"
Expand Down
2 changes: 1 addition & 1 deletion core/crypto/tinkio/protofile.go
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io/ioutil"

"github.com/gogo/protobuf/proto"
"github.com/golang/protobuf/proto"

tinkpb "github.com/google/tink/proto/tink_go_proto"
)
Expand Down

0 comments on commit 798d185

Please sign in to comment.