diff --git a/.cloudbuild/scripts/cmd/integration-tests/args.go b/.cloudbuild/scripts/cmd/integration-tests/args.go index 9a560b61a5a24..657926dbe44ab 100644 --- a/.cloudbuild/scripts/cmd/integration-tests/args.go +++ b/.cloudbuild/scripts/cmd/integration-tests/args.go @@ -20,9 +20,10 @@ import ( "flag" "path/filepath" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/.cloudbuild/scripts/internal/artifacts" "github.com/gravitational/teleport/.cloudbuild/scripts/internal/customflag" - "github.com/gravitational/trace" ) type commandlineArgs struct { diff --git a/.cloudbuild/scripts/internal/git/configure.go b/.cloudbuild/scripts/internal/git/configure.go index 63d2fdb54e9b2..7819d60aa4b95 100644 --- a/.cloudbuild/scripts/internal/git/configure.go +++ b/.cloudbuild/scripts/internal/git/configure.go @@ -6,10 +6,11 @@ import ( "os" "os/exec" - "github.com/gravitational/teleport/.cloudbuild/scripts/internal/github" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/.cloudbuild/scripts/internal/github" ) // Config represents a git repository that has been configured to use a diff --git a/.golangci.yml b/.golangci.yml index e12be77820793..542782777ffe7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -21,6 +21,7 @@ linters: enable: - bodyclose - depguard + - gci - goimports - gosimple - govet @@ -42,6 +43,13 @@ linters-settings: - go.uber.org/atomic: 'use "sync/atomic" instead' misspell: locale: US + gci: + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - prefix(github.com/gravitational/teleport) # Custom section: groups all imports with the specified Prefix. + skip-generated: true # Skip generated files. + custom-order: true # Required for "sections" to take effect. output: uniq-by-line: false diff --git a/Makefile b/Makefile index fba87f9181b10..014e9a8aed4ae 100644 --- a/Makefile +++ b/Makefile @@ -698,6 +698,15 @@ lint-go: GO_LINT_FLAGS ?= lint-go: golangci-lint run -c .golangci.yml --build-tags='$(LIBFIDO2_TEST_TAG) $(TOUCHID_TAG) $(PIV_TEST_TAG)' $(GO_LINT_FLAGS) +.PHONY: fix-imports +fix-imports: GOLANG_LINT_ARGS = --build-tags='$(LIBFIDO2_TEST_TAG) $(TOUCHID_TAG) $(PIV_TEST_TAG)' --fix +fix-imports: + golangci-lint run -c .golangci.yml $(GOLANG_LINT_ARGS) + cd api/ && golangci-lint run -c ../.golangci.yml $(GOLANG_LINT_ARGS) + cd build.assets/tooling && golangci-lint run -c ../../.golangci.yml $(GOLANG_LINT_ARGS) + cd .cloudbuild/scripts && golangci-lint run -c ../../.golangci.yml $(GOLANG_LINT_ARGS) + cd assets/backport && golangci-lint run -c ../../.golangci.yml $(GOLANG_LINT_ARGS) + .PHONY: lint-build-tooling lint-build-tooling: GO_LINT_FLAGS ?= lint-build-tooling: diff --git a/api/breaker/breaker.go b/api/breaker/breaker.go index 4130bcc872366..702dfa83a9f54 100644 --- a/api/breaker/breaker.go +++ b/api/breaker/breaker.go @@ -20,14 +20,14 @@ import ( "sync" "time" - "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/utils/retryutils" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/utils/retryutils" ) // Metrics tallies success and failure counts diff --git a/api/client/auditstreamer.go b/api/client/auditstreamer.go index d4025c2faa279..40e89cdacb105 100644 --- a/api/client/auditstreamer.go +++ b/api/client/auditstreamer.go @@ -20,13 +20,13 @@ import ( "context" "sync" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types/events" - "github.com/gravitational/trace" "github.com/gravitational/trace/trail" "google.golang.org/grpc" ggzip "google.golang.org/grpc/encoding/gzip" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types/events" ) // createOrResumeAuditStream creates or resumes audit stream described in the request. diff --git a/api/client/client.go b/api/client/client.go index c145e08da208e..d9ee080628b7a 100644 --- a/api/client/client.go +++ b/api/client/client.go @@ -28,17 +28,6 @@ import ( "sync/atomic" "time" - "github.com/gravitational/teleport/api/breaker" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/metadata" - "github.com/gravitational/teleport/api/observability/tracing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/api/types/events" - "github.com/gravitational/teleport/api/types/wrappers" - "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/trace" "github.com/gravitational/trace/trail" "github.com/jonboulle/clockwork" @@ -50,6 +39,17 @@ import ( ggzip "google.golang.org/grpc/encoding/gzip" "google.golang.org/grpc/keepalive" "google.golang.org/protobuf/types/known/emptypb" + + "github.com/gravitational/teleport/api/breaker" + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/metadata" + "github.com/gravitational/teleport/api/observability/tracing" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/api/types/events" + "github.com/gravitational/teleport/api/types/wrappers" + "github.com/gravitational/teleport/api/utils" ) func init() { diff --git a/api/client/client_test.go b/api/client/client_test.go index 3da473e581e00..3bece7e4086b6 100644 --- a/api/client/client_test.go +++ b/api/client/client_test.go @@ -24,10 +24,6 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/types" - "github.com/google/go-cmp/cmp" "github.com/gravitational/trace" "github.com/gravitational/trace/trail" @@ -38,6 +34,10 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" ) // mockServer mocks an Auth Server. diff --git a/api/client/contextdialer.go b/api/client/contextdialer.go index 77a74cff7574d..ba9e07813c20c 100644 --- a/api/client/contextdialer.go +++ b/api/client/contextdialer.go @@ -22,7 +22,9 @@ import ( "net" "time" + "github.com/gravitational/trace" oteltrace "go.opentelemetry.io/otel/trace" + "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/client/proxy" "github.com/gravitational/teleport/api/client/webclient" @@ -30,9 +32,6 @@ import ( "github.com/gravitational/teleport/api/observability/tracing" tracessh "github.com/gravitational/teleport/api/observability/tracing/ssh" "github.com/gravitational/teleport/api/utils/sshutils" - - "github.com/gravitational/trace" - "golang.org/x/crypto/ssh" ) // ContextDialer represents network dialer interface that uses context diff --git a/api/client/credentials.go b/api/client/credentials.go index dfb4c2389e101..4815519fcb366 100644 --- a/api/client/credentials.go +++ b/api/client/credentials.go @@ -21,14 +21,14 @@ import ( "crypto/x509" "os" + "github.com/gravitational/trace" + "golang.org/x/crypto/ssh" + "golang.org/x/net/http2" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/identityfile" "github.com/gravitational/teleport/api/profile" "github.com/gravitational/teleport/api/utils" - - "github.com/gravitational/trace" - "golang.org/x/crypto/ssh" - "golang.org/x/net/http2" ) // Credentials are used to authenticate the API auth client. Some Credentials diff --git a/api/client/credentials_test.go b/api/client/credentials_test.go index 1f6b6dea31989..5cf6d63ae1b82 100644 --- a/api/client/credentials_test.go +++ b/api/client/credentials_test.go @@ -25,14 +25,13 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/identityfile" "github.com/gravitational/teleport/api/profile" "github.com/gravitational/teleport/api/utils/keys" "github.com/gravitational/teleport/api/utils/sshutils" - - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) func TestLoadTLS(t *testing.T) { diff --git a/api/client/events.go b/api/client/events.go index 2bfc74f06687c..a7d2c24c748ff 100644 --- a/api/client/events.go +++ b/api/client/events.go @@ -15,9 +15,10 @@ package client import ( + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" ) // EventToGRPC converts types.Event to proto.Event diff --git a/api/client/inventory.go b/api/client/inventory.go index 16a2130e8f809..af7667e6c75a6 100644 --- a/api/client/inventory.go +++ b/api/client/inventory.go @@ -21,9 +21,10 @@ import ( "io" "sync" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" "github.com/gravitational/trace/trail" + + "github.com/gravitational/teleport/api/client/proto" ) // DownstreamInventoryControlStream is the client/agent side of a bidirectional stream established diff --git a/api/client/inventory_test.go b/api/client/inventory_test.go index fa99979cc65eb..cf2d51108235e 100644 --- a/api/client/inventory_test.go +++ b/api/client/inventory_test.go @@ -21,9 +21,10 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/client/proto" ) // TestInventoryControlStreamPipe is a sanity-check to make sure that the in-memory diff --git a/api/client/joinservice.go b/api/client/joinservice.go index 50e99d7e49f89..09341f9749144 100644 --- a/api/client/joinservice.go +++ b/api/client/joinservice.go @@ -19,8 +19,9 @@ package client import ( "context" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/client/proto" ) // JoinServiceClient is a client for the JoinService, which runs on both the diff --git a/api/client/keepaliver.go b/api/client/keepaliver.go index 7b70513fc6c05..1731c7f3b3d00 100644 --- a/api/client/keepaliver.go +++ b/api/client/keepaliver.go @@ -20,11 +20,11 @@ import ( "context" "sync" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace/trail" "google.golang.org/protobuf/types/known/emptypb" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" ) // NewKeepAliver returns a new instance of keep aliver. diff --git a/api/client/proto/types.go b/api/client/proto/types.go index 4ceed66177e24..3d36b3a0ee68b 100644 --- a/api/client/proto/types.go +++ b/api/client/proto/types.go @@ -20,10 +20,10 @@ package proto import ( "time" + "github.com/gravitational/trace" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" - - "github.com/gravitational/trace" ) // Duration is a wrapper around duration diff --git a/api/client/sessions.go b/api/client/sessions.go index 230ae6b48df27..b9d22428651ee 100644 --- a/api/client/sessions.go +++ b/api/client/sessions.go @@ -19,12 +19,11 @@ package client import ( "context" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/gravitational/trace/trail" - "google.golang.org/protobuf/types/known/emptypb" + + "github.com/gravitational/teleport/api/types" ) // GetWebSession returns the web session for the specified request. diff --git a/api/client/streamwatcher.go b/api/client/streamwatcher.go index 6d0669f8d4d35..e30aead233b01 100644 --- a/api/client/streamwatcher.go +++ b/api/client/streamwatcher.go @@ -20,11 +20,11 @@ import ( "context" "sync" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/gravitational/trace/trail" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" ) // NewWatcher returns a new streamWatcher diff --git a/api/identityfile/identityfile.go b/api/identityfile/identityfile.go index 2ac4596ca8f2e..7cc41d02810ce 100644 --- a/api/identityfile/identityfile.go +++ b/api/identityfile/identityfile.go @@ -28,12 +28,12 @@ import ( "regexp" "strings" + "github.com/gravitational/trace" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/utils/keypaths" "github.com/gravitational/teleport/api/utils/keys" "github.com/gravitational/teleport/api/utils/sshutils" - - "github.com/gravitational/trace" - "golang.org/x/crypto/ssh" ) const ( diff --git a/api/metadata/metadata.go b/api/metadata/metadata.go index ac246b37d5712..0f9983f078ef7 100644 --- a/api/metadata/metadata.go +++ b/api/metadata/metadata.go @@ -19,9 +19,10 @@ package metadata import ( "context" - "github.com/gravitational/teleport/api" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + + "github.com/gravitational/teleport/api" ) const ( diff --git a/api/observability/tracing/ssh/ssh.go b/api/observability/tracing/ssh/ssh.go index 1f43fd58f7be1..cab328923e948 100644 --- a/api/observability/tracing/ssh/ssh.go +++ b/api/observability/tracing/ssh/ssh.go @@ -21,17 +21,16 @@ import ( "net" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/propagation" semconv "go.opentelemetry.io/otel/semconv/v1.10.0" oteltrace "go.opentelemetry.io/otel/trace" + "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/observability/tracing" "github.com/gravitational/teleport/api/utils/sshutils" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) const ( diff --git a/api/profile/profile.go b/api/profile/profile.go index 93b8110683527..0f8c7265d1617 100644 --- a/api/profile/profile.go +++ b/api/profile/profile.go @@ -27,13 +27,13 @@ import ( "path/filepath" "strings" - "github.com/gravitational/teleport/api/utils/keypaths" - "github.com/gravitational/teleport/api/utils/keys" - "github.com/gravitational/teleport/api/utils/sshutils" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" "gopkg.in/yaml.v2" + + "github.com/gravitational/teleport/api/utils/keypaths" + "github.com/gravitational/teleport/api/utils/keys" + "github.com/gravitational/teleport/api/utils/sshutils" ) const ( diff --git a/api/profile/profile_test.go b/api/profile/profile_test.go index e167015d1ae99..6d22e436ae655 100644 --- a/api/profile/profile_test.go +++ b/api/profile/profile_test.go @@ -22,10 +22,10 @@ import ( "path/filepath" "testing" - "github.com/gravitational/teleport/api/profile" "github.com/gravitational/trace" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/profile" ) // TestProfileBasics verifies basic profile operations such as diff --git a/api/types/access_request.go b/api/types/access_request.go index dfabdb57c866a..22e8db023c8b8 100644 --- a/api/types/access_request.go +++ b/api/types/access_request.go @@ -23,9 +23,9 @@ import ( "sort" "time" - "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/utils" ) // AccessRequest is a request for temporarily granted roles diff --git a/api/types/appserver.go b/api/types/appserver.go index 297f4d3e2d6c6..12d361e9d27a1 100644 --- a/api/types/appserver.go +++ b/api/types/appserver.go @@ -21,10 +21,10 @@ import ( "sort" "time" - "github.com/gravitational/teleport/api" - "github.com/gogo/protobuf/proto" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api" ) // AppServer represents a single proxied web app. diff --git a/api/types/authentication.go b/api/types/authentication.go index 4c7f397427514..d3e6a6e14167d 100644 --- a/api/types/authentication.go +++ b/api/types/authentication.go @@ -26,12 +26,11 @@ import ( "github.com/gogo/protobuf/jsonpb" "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/utils/keys" "github.com/gravitational/teleport/api/utils/tlsutils" - - log "github.com/sirupsen/logrus" ) // AuthPreference defines the authentication preferences for a specific diff --git a/api/types/authentication_authpreference_test.go b/api/types/authentication_authpreference_test.go index 5a6352700ca2c..0f95b7849fb45 100644 --- a/api/types/authentication_authpreference_test.go +++ b/api/types/authentication_authpreference_test.go @@ -22,10 +22,11 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/types" ) const ( diff --git a/api/types/authority.go b/api/types/authority.go index 749c6491b4547..e03dddbed7600 100644 --- a/api/types/authority.go +++ b/api/types/authority.go @@ -20,11 +20,11 @@ import ( "fmt" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/utils" - "github.com/gogo/protobuf/proto" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/utils" ) // CertAuthority is a host or user certificate authority that diff --git a/api/types/connection_diagnostic.go b/api/types/connection_diagnostic.go index b51dcce334f65..4c6ad7e34e835 100644 --- a/api/types/connection_diagnostic.go +++ b/api/types/connection_diagnostic.go @@ -17,8 +17,9 @@ limitations under the License. package types import ( - "github.com/gravitational/teleport/api/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/utils" ) const ( diff --git a/api/types/databaseserver.go b/api/types/databaseserver.go index d78f78e92f8bc..11c3c859ade93 100644 --- a/api/types/databaseserver.go +++ b/api/types/databaseserver.go @@ -21,10 +21,10 @@ import ( "sort" "time" - "github.com/gravitational/teleport/api" - "github.com/gogo/protobuf/proto" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api" ) // DatabaseServer represents a database access server. diff --git a/api/types/desktop.go b/api/types/desktop.go index 7ad10b37a5ced..454491acba904 100644 --- a/api/types/desktop.go +++ b/api/types/desktop.go @@ -19,8 +19,9 @@ package types import ( "sort" - "github.com/gravitational/teleport/api/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/utils" ) // WindowsDesktopService represents a Windows desktop service instance. diff --git a/api/types/duration.go b/api/types/duration.go index 2ecb8529e71a0..c07476b9f6a59 100644 --- a/api/types/duration.go +++ b/api/types/duration.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/constants" ) // Duration is a wrapper around duration to set up custom marshal/unmarshal diff --git a/api/types/jwt.go b/api/types/jwt.go index 1aa802fdb4e25..02fa838e667da 100644 --- a/api/types/jwt.go +++ b/api/types/jwt.go @@ -19,8 +19,9 @@ package types import ( "time" - "github.com/gravitational/teleport/api/types/wrappers" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/types/wrappers" ) // GenerateAppTokenRequest are the parameters used to generate an application token. diff --git a/api/types/kubernetes.go b/api/types/kubernetes.go index 79047f0529d20..47de8b1c3e993 100644 --- a/api/types/kubernetes.go +++ b/api/types/kubernetes.go @@ -22,8 +22,9 @@ import ( "time" "github.com/gogo/protobuf/proto" - "github.com/gravitational/teleport/api/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/utils" ) // KubeCluster represents a kubernetes cluster. diff --git a/api/types/kubernetes_server.go b/api/types/kubernetes_server.go index 57b2f0bb361ef..e6b0fa0f0d714 100644 --- a/api/types/kubernetes_server.go +++ b/api/types/kubernetes_server.go @@ -22,8 +22,9 @@ import ( "time" "github.com/gogo/protobuf/proto" - "github.com/gravitational/teleport/api" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api" ) // KubeServer represents a single Kubernetes server. diff --git a/api/types/lock.go b/api/types/lock.go index 4b1c455f0008b..a63744980deba 100644 --- a/api/types/lock.go +++ b/api/types/lock.go @@ -20,11 +20,11 @@ import ( "strings" "time" - "github.com/gravitational/teleport/api/utils" - "github.com/gogo/protobuf/proto" "github.com/google/go-cmp/cmp" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/utils" ) // Lock configures locking out of a particular access vector. diff --git a/api/types/namespace.go b/api/types/namespace.go index 2b5860fab5b24..0e26de854335b 100644 --- a/api/types/namespace.go +++ b/api/types/namespace.go @@ -20,8 +20,9 @@ import ( "regexp" "time" - "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/defaults" ) // NewNamespace returns new namespace diff --git a/api/types/networking.go b/api/types/networking.go index cf0efb312cf7f..08cffd419fe6a 100644 --- a/api/types/networking.go +++ b/api/types/networking.go @@ -20,10 +20,10 @@ import ( "strings" "time" - "github.com/gravitational/teleport/api/defaults" - "github.com/gogo/protobuf/proto" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/defaults" ) // ClusterNetworkingConfig defines cluster networking configuration. This is diff --git a/api/types/presence.go b/api/types/presence.go index 6118cac4f6d7a..163f647d23592 100644 --- a/api/types/presence.go +++ b/api/types/presence.go @@ -19,10 +19,10 @@ package types import ( "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/defaults" - - "github.com/gravitational/trace" ) // Site represents a cluster of teleport nodes who collectively trust the same diff --git a/api/types/provisioning.go b/api/types/provisioning.go index e45c62aac3bb1..dbafac1c2f0c3 100644 --- a/api/types/provisioning.go +++ b/api/types/provisioning.go @@ -20,10 +20,10 @@ import ( "fmt" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/defaults" apiutils "github.com/gravitational/teleport/api/utils" - - "github.com/gravitational/trace" ) // JoinMethod is the method used for new nodes to join the cluster. diff --git a/api/types/resource.go b/api/types/resource.go index fdde2d663e9f6..4f449d421810f 100644 --- a/api/types/resource.go +++ b/api/types/resource.go @@ -21,10 +21,10 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/utils" - - "github.com/gravitational/trace" ) // Resource represents common properties for all resources. diff --git a/api/types/resource_ids.go b/api/types/resource_ids.go index aca9b45c45fec..a228a65f3693b 100644 --- a/api/types/resource_ids.go +++ b/api/types/resource_ids.go @@ -21,8 +21,9 @@ import ( "fmt" "strings" - "github.com/gravitational/teleport/api/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/utils" ) func (id *ResourceID) CheckAndSetDefaults() error { diff --git a/api/types/role.go b/api/types/role.go index c72c75546d34e..576df33a8d53c 100644 --- a/api/types/role.go +++ b/api/types/role.go @@ -21,14 +21,14 @@ import ( "fmt" "time" + "github.com/gogo/protobuf/proto" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types/wrappers" "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/api/utils/keys" - - "github.com/gogo/protobuf/proto" - "github.com/gravitational/trace" ) const ( diff --git a/api/types/semaphore.go b/api/types/semaphore.go index 456ea293c4ec9..d0742acd5f84d 100644 --- a/api/types/semaphore.go +++ b/api/types/semaphore.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/constants" ) // SemaphoreKindConnection is the semaphore kind used by diff --git a/api/types/server.go b/api/types/server.go index 52a0c2d736047..0f3b4e3bb910f 100644 --- a/api/types/server.go +++ b/api/types/server.go @@ -23,11 +23,11 @@ import ( "strings" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/utils" - "github.com/gogo/protobuf/proto" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/utils" ) // Server represents a Node, Proxy or Auth server in a Teleport cluster diff --git a/api/types/session.go b/api/types/session.go index 7ed84931ffada..65b465a81ed42 100644 --- a/api/types/session.go +++ b/api/types/session.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/defaults" ) // WebSessionsGetter provides access to web sessions diff --git a/api/types/session_tracker.go b/api/types/session_tracker.go index b4736d5e56519..f2a39cef3b4ea 100644 --- a/api/types/session_tracker.go +++ b/api/types/session_tracker.go @@ -19,9 +19,9 @@ package types import ( "time" - "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/defaults" ) const ( diff --git a/api/types/sessionrecording.go b/api/types/sessionrecording.go index 827a084867478..7cc532fe2fbb3 100644 --- a/api/types/sessionrecording.go +++ b/api/types/sessionrecording.go @@ -20,9 +20,9 @@ import ( "strings" "time" - "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/utils" ) // SessionRecordingConfig defines session recording configuration. This is diff --git a/api/types/trustedcluster.go b/api/types/trustedcluster.go index 29bfa6b73cbb6..ba2822b38044d 100644 --- a/api/types/trustedcluster.go +++ b/api/types/trustedcluster.go @@ -21,10 +21,9 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/gravitational/trace" "github.com/gravitational/teleport/api/utils" - - "github.com/gravitational/trace" ) // TrustedCluster holds information needed for a cluster that can not be directly diff --git a/api/types/tunnel_strategy.go b/api/types/tunnel_strategy.go index 3036f5b9c7944..76ea42345e447 100644 --- a/api/types/tunnel_strategy.go +++ b/api/types/tunnel_strategy.go @@ -19,9 +19,9 @@ package types import ( "encoding/json" - "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/utils" ) const ( diff --git a/api/types/tunnelconn.go b/api/types/tunnelconn.go index 0de0daece87f3..3f45f477f6a78 100644 --- a/api/types/tunnelconn.go +++ b/api/types/tunnelconn.go @@ -21,9 +21,9 @@ import ( "strings" "time" - "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/defaults" ) // TunnelConnection is SSH reverse tunnel connection diff --git a/api/types/user.go b/api/types/user.go index 95cf9588145a5..ddacbf17b18b2 100644 --- a/api/types/user.go +++ b/api/types/user.go @@ -20,10 +20,10 @@ import ( "fmt" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/utils" - - "github.com/gravitational/trace" ) // User represents teleport embedded user or external user diff --git a/api/utils/sshutils/chconn.go b/api/utils/sshutils/chconn.go index 0de68696a5f0b..954e3e067942a 100644 --- a/api/utils/sshutils/chconn.go +++ b/api/utils/sshutils/chconn.go @@ -22,10 +22,10 @@ import ( "sync" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/constants" ) type Conn interface { diff --git a/api/utils/sshutils/checker.go b/api/utils/sshutils/checker.go index 6d8c43d731ae4..50bb38baf6b1d 100644 --- a/api/utils/sshutils/checker.go +++ b/api/utils/sshutils/checker.go @@ -20,10 +20,10 @@ import ( "crypto/rsa" "net" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/constants" ) // CertChecker is a drop-in replacement for ssh.CertChecker. In FIPS mode, diff --git a/api/utils/sshutils/checker_test.go b/api/utils/sshutils/checker_test.go index f3849907938ad..53db4cfe32852 100644 --- a/api/utils/sshutils/checker_test.go +++ b/api/utils/sshutils/checker_test.go @@ -23,10 +23,10 @@ import ( "crypto/rsa" "testing" - "github.com/gravitational/teleport/api/constants" - "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/constants" ) // TestCheckerValidate checks what algorithm are supported in regular (non-FIPS) mode. diff --git a/api/utils/sshutils/conn.go b/api/utils/sshutils/conn.go index 8d1210191c8f3..288e5553811d3 100644 --- a/api/utils/sshutils/conn.go +++ b/api/utils/sshutils/conn.go @@ -22,11 +22,11 @@ import ( "fmt" "io" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/types" ) // ConnectProxyTransport opens a channel over the remote tunnel and connects diff --git a/api/utils/sshutils/conn_test.go b/api/utils/sshutils/conn_test.go index a644d34c53d1c..a61250f309577 100644 --- a/api/utils/sshutils/conn_test.go +++ b/api/utils/sshutils/conn_test.go @@ -25,9 +25,10 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/constants" "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/constants" ) type server struct { diff --git a/api/utils/sshutils/ssh.go b/api/utils/sshutils/ssh.go index fd5578a742e21..97dcf63025aa8 100644 --- a/api/utils/sshutils/ssh.go +++ b/api/utils/sshutils/ssh.go @@ -24,10 +24,10 @@ import ( "io" "net" - "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/defaults" ) const ( diff --git a/api/utils/sshutils/test.go b/api/utils/sshutils/test.go index 50e89c9d56e82..4b1652d046838 100644 --- a/api/utils/sshutils/test.go +++ b/api/utils/sshutils/test.go @@ -21,10 +21,10 @@ import ( "crypto/rsa" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/constants" ) // MakeTestSSHCA generates a new SSH certificate authority for tests. diff --git a/assets/backport/github/github.go b/assets/backport/github/github.go index fbc4a28c65e73..b7176359e8ff8 100644 --- a/assets/backport/github/github.go +++ b/assets/backport/github/github.go @@ -20,9 +20,8 @@ import ( "context" "fmt" - "github.com/gravitational/trace" - go_github "github.com/google/go-github/v41/github" + "github.com/gravitational/trace" "golang.org/x/oauth2" ) diff --git a/build.assets/gomod/update-api-import-path/main.go b/build.assets/gomod/update-api-import-path/main.go index 0163e9c66ceaf..0186b88f16666 100644 --- a/build.assets/gomod/update-api-import-path/main.go +++ b/build.assets/gomod/update-api-import-path/main.go @@ -27,16 +27,16 @@ import ( "path/filepath" "strings" - "github.com/gravitational/teleport/api" - "github.com/gravitational/teleport/build.assets/gomod" - "github.com/gravitational/teleport/lib/utils" - "github.com/coreos/go-semver/semver" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "golang.org/x/mod/modfile" "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/packages" + + "github.com/gravitational/teleport/api" + "github.com/gravitational/teleport/build.assets/gomod" + "github.com/gravitational/teleport/lib/utils" ) func init() { diff --git a/build.assets/gomod/update-api-import-path/main_test.go b/build.assets/gomod/update-api-import-path/main_test.go index fd78013a935cd..0970424638291 100644 --- a/build.assets/gomod/update-api-import-path/main_test.go +++ b/build.assets/gomod/update-api-import-path/main_test.go @@ -21,10 +21,10 @@ import ( "strings" "testing" - "github.com/gravitational/teleport/build.assets/gomod" - "github.com/coreos/go-semver/semver" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/build.assets/gomod" ) func TestUpdateGoPkgs(t *testing.T) { diff --git a/build.assets/tooling/cmd/check/main.go b/build.assets/tooling/cmd/check/main.go index ac1b8fe3172b6..1e029f0641982 100644 --- a/build.assets/tooling/cmd/check/main.go +++ b/build.assets/tooling/cmd/check/main.go @@ -27,10 +27,10 @@ import ( "strings" "time" + "github.com/gravitational/trace" "golang.org/x/mod/semver" "github.com/gravitational/teleport/build.assets/tooling/lib/github" - "github.com/gravitational/trace" ) func main() { diff --git a/build.assets/tooling/cmd/query-latest/main.go b/build.assets/tooling/cmd/query-latest/main.go index 0cdf1fe4a247c..23d872322cab4 100644 --- a/build.assets/tooling/cmd/query-latest/main.go +++ b/build.assets/tooling/cmd/query-latest/main.go @@ -34,9 +34,10 @@ import ( "strings" "time" - "github.com/gravitational/teleport/build.assets/tooling/lib/github" "github.com/gravitational/trace" "golang.org/x/mod/semver" + + "github.com/gravitational/teleport/build.assets/tooling/lib/github" ) func main() { diff --git a/e b/e index 162d1fe239f9d..b31931384aa68 160000 --- a/e +++ b/e @@ -1 +1 @@ -Subproject commit 162d1fe239f9d7034dfae886b6d6091936480f09 +Subproject commit b31931384aa68e0898c7a159198679abdf86097b diff --git a/integration/agent_forwarding_test.go b/integration/agent_forwarding_test.go index 12e97faddc3f5..5964924c52914 100644 --- a/integration/agent_forwarding_test.go +++ b/integration/agent_forwarding_test.go @@ -23,9 +23,10 @@ import ( "syscall" "testing" - "github.com/gravitational/teleport/lib/teleagent" "github.com/stretchr/testify/require" "golang.org/x/sys/unix" + + "github.com/gravitational/teleport/lib/teleagent" ) func TestAgentSocketPermissions(t *testing.T) { diff --git a/integration/appaccess/appaccess_test.go b/integration/appaccess/appaccess_test.go index 6cfcd5988867e..830a0c408fa2e 100644 --- a/integration/appaccess/appaccess_test.go +++ b/integration/appaccess/appaccess_test.go @@ -30,6 +30,9 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/google/uuid" "github.com/gravitational/oxy/forward" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" @@ -37,8 +40,6 @@ import ( "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/web/app" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) // TestAppAccess runs the full application access integration test suite. diff --git a/integration/appaccess/fixtures.go b/integration/appaccess/fixtures.go index 79045a937d08d..7e778989f015e 100644 --- a/integration/appaccess/fixtures.go +++ b/integration/appaccess/fixtures.go @@ -25,6 +25,7 @@ import ( "github.com/google/uuid" "github.com/gorilla/websocket" + "github.com/stretchr/testify/require" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" @@ -33,8 +34,6 @@ import ( "github.com/gravitational/teleport/lib/auth/testauthority" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/utils" - - "github.com/stretchr/testify/require" ) type AppTestOptions struct { diff --git a/integration/appaccess/jwt.go b/integration/appaccess/jwt.go index bae1f2ca2619d..d9d6011a37921 100644 --- a/integration/appaccess/jwt.go +++ b/integration/appaccess/jwt.go @@ -19,11 +19,12 @@ import ( "net/http" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types/wrappers" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/jwt" "github.com/gravitational/teleport/lib/web" - "github.com/stretchr/testify/require" ) func verifyJWT(t *testing.T, pack *Pack, token, appURI string) { diff --git a/integration/client_test.go b/integration/client_test.go index fc3f15fd03c9b..85b7e4ec10154 100644 --- a/integration/client_test.go +++ b/integration/client_test.go @@ -22,12 +22,13 @@ import ( "time" "github.com/google/uuid" + "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/integration/helpers" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" - "google.golang.org/grpc" ) // TestClientWithExpiredCredentialsAndDetailedErrorMessage creates and connects to the Auth service diff --git a/integration/ec2_test.go b/integration/ec2_test.go index 74c90b8b061d4..d5861fd4b1ba0 100644 --- a/integration/ec2_test.go +++ b/integration/ec2_test.go @@ -28,6 +28,7 @@ import ( "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/sts" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" @@ -44,7 +45,6 @@ import ( "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) func newSilentLogger() utils.Logger { diff --git a/integration/helpers/discard.go b/integration/helpers/discard.go index f04ac6b75e128..6ae9e16b35ca6 100644 --- a/integration/helpers/discard.go +++ b/integration/helpers/discard.go @@ -20,10 +20,11 @@ import ( "context" "fmt" - "github.com/gravitational/teleport/lib/sshutils" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/lib/sshutils" + "github.com/gravitational/teleport/lib/utils" ) // DiscardServer is a SSH server that discards SSH exec requests and starts diff --git a/integration/helpers/fixture.go b/integration/helpers/fixture.go index ad6f7206f5032..25e4a033604ee 100644 --- a/integration/helpers/fixture.go +++ b/integration/helpers/fixture.go @@ -19,11 +19,12 @@ import ( "os/user" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/auth/testauthority" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) const ( diff --git a/integration/helpers/kube.go b/integration/helpers/kube.go index c485595872fce..78052776bdd62 100644 --- a/integration/helpers/kube.go +++ b/integration/helpers/kube.go @@ -21,6 +21,10 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + apiclient "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" @@ -32,9 +36,6 @@ import ( "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) func EnableKubernetesService(t *testing.T, config *service.Config) { diff --git a/integration/helpers/ports.go b/integration/helpers/ports.go index a25f7c280e717..44abe363dde79 100644 --- a/integration/helpers/ports.go +++ b/integration/helpers/ports.go @@ -21,8 +21,9 @@ import ( "strconv" "testing" - "github.com/gravitational/teleport/lib/service" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/service" ) // InstanceListeners represents the listener configuration for a test cluster. diff --git a/integration/helpers/usercreds.go b/integration/helpers/usercreds.go index 3c94cc9440223..5699a1548ddf5 100644 --- a/integration/helpers/usercreds.go +++ b/integration/helpers/usercreds.go @@ -18,14 +18,15 @@ import ( "context" "time" + "github.com/gravitational/trace" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth/testauthority" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" - "golang.org/x/crypto/ssh" ) // UserCreds holds user client credentials diff --git a/integration/hostuser_test.go b/integration/hostuser_test.go index b747d7263868b..ace73ca5adc46 100644 --- a/integration/hostuser_test.go +++ b/integration/hostuser_test.go @@ -28,6 +28,10 @@ import ( "path/filepath" "testing" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/backend/lite" @@ -35,10 +39,6 @@ import ( "github.com/gravitational/teleport/lib/services/local" "github.com/gravitational/teleport/lib/srv" "github.com/gravitational/teleport/lib/utils/host" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" - - log "github.com/sirupsen/logrus" ) const testuser = "teleport-testuser" diff --git a/integration/kube/fixtures.go b/integration/kube/fixtures.go index e7e824cbe78f1..d5ca3d814f18a 100644 --- a/integration/kube/fixtures.go +++ b/integration/kube/fixtures.go @@ -18,15 +18,16 @@ import ( "context" "time" + "github.com/gravitational/trace" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/integration/helpers" "github.com/gravitational/teleport/lib/auth/native" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" ) // For this test suite to work, the target Kubernetes cluster must have the diff --git a/integration/kube_integration_test.go b/integration/kube_integration_test.go index 6185f33265987..70315399a8cce 100644 --- a/integration/kube_integration_test.go +++ b/integration/kube_integration_test.go @@ -32,8 +32,24 @@ import ( "testing" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "golang.org/x/net/http2" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + streamspdy "k8s.io/apimachinery/pkg/util/httpstream/spdy" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/portforward" + "k8s.io/client-go/tools/remotecommand" + "k8s.io/client-go/transport" + "k8s.io/client-go/transport/spdy" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/profile" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/integration/helpers" @@ -42,30 +58,12 @@ import ( "github.com/gravitational/teleport/lib/auth/testauthority" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/events" + kubeutils "github.com/gravitational/teleport/lib/kube/utils" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - apidefaults "github.com/gravitational/teleport/api/defaults" - kubeutils "github.com/gravitational/teleport/lib/kube/utils" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" - "golang.org/x/net/http2" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/portforward" - "k8s.io/client-go/tools/remotecommand" - "k8s.io/client-go/transport" - "k8s.io/client-go/transport/spdy" - - log "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - streamspdy "k8s.io/apimachinery/pkg/util/httpstream/spdy" ) type KubeSuite struct { diff --git a/integration/port_forwarding_test.go b/integration/port_forwarding_test.go index 03e5cdfd4233b..e797e9bc700eb 100644 --- a/integration/port_forwarding_test.go +++ b/integration/port_forwarding_test.go @@ -26,14 +26,14 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/integration/helpers" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/client" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) func extractPort(svr *httptest.Server) (int, error) { diff --git a/integration/proxy/proxy_test.go b/integration/proxy/proxy_test.go index ac48f9497538e..11a2ac02f8355 100644 --- a/integration/proxy/proxy_test.go +++ b/integration/proxy/proxy_test.go @@ -38,6 +38,7 @@ import ( "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/integration/appaccess" + dbhelpers "github.com/gravitational/teleport/integration/db" "github.com/gravitational/teleport/integration/helpers" "github.com/gravitational/teleport/integration/kube" "github.com/gravitational/teleport/lib" @@ -53,8 +54,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/postgres" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - dbhelpers "github.com/gravitational/teleport/integration/db" ) // TestALPNSNIProxyMultiCluster tests SSH connection in multi-cluster setup with. diff --git a/integration/proxy/proxy_tunnel_strategy_test.go b/integration/proxy/proxy_tunnel_strategy_test.go index 2a236c2d6fdf3..1262df4de993e 100644 --- a/integration/proxy/proxy_tunnel_strategy_test.go +++ b/integration/proxy/proxy_tunnel_strategy_test.go @@ -23,6 +23,13 @@ import ( "testing" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jackc/pgconn" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/integration/helpers" "github.com/gravitational/teleport/lib" @@ -35,14 +42,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/postgres" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - apidefaults "github.com/gravitational/teleport/api/defaults" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/jackc/pgconn" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) type proxyTunnelStrategy struct { diff --git a/lib/auth/access_request_test.go b/lib/auth/access_request_test.go index fa8602fd4d390..12cdca053f5ed 100644 --- a/lib/auth/access_request_test.go +++ b/lib/auth/access_request_test.go @@ -24,6 +24,10 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/constants" @@ -34,10 +38,6 @@ import ( "github.com/gravitational/teleport/lib/modules" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) type accessRequestTestPack struct { diff --git a/lib/auth/api.go b/lib/auth/api.go index d270997172581..1b67041d87b47 100644 --- a/lib/auth/api.go +++ b/lib/auth/api.go @@ -20,11 +20,12 @@ import ( "context" "io" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" ) // Announcer specifies interface responsible for announcing presence diff --git a/lib/auth/apiserver.go b/lib/auth/apiserver.go index 7350ef6f23b5b..5b0c1d2139ab6 100644 --- a/lib/auth/apiserver.go +++ b/lib/auth/apiserver.go @@ -25,6 +25,10 @@ import ( "strconv" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/julienschmidt/httprouter" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" @@ -36,10 +40,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/julienschmidt/httprouter" ) type APIConfig struct { diff --git a/lib/auth/apiserver_test.go b/lib/auth/apiserver_test.go index 51fc45ab4acf9..404b3d4c1d84a 100644 --- a/lib/auth/apiserver_test.go +++ b/lib/auth/apiserver_test.go @@ -24,14 +24,14 @@ import ( "net/http/httptest" "testing" - apidefaults "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/julienschmidt/httprouter" "github.com/stretchr/testify/require" + + apidefaults "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" ) func TestUpsertServer(t *testing.T) { diff --git a/lib/auth/auth.go b/lib/auth/auth.go index 510f65cf7f4c1..3671760852189 100644 --- a/lib/auth/auth.go +++ b/lib/auth/auth.go @@ -41,8 +41,6 @@ import ( "sync" "time" - "github.com/gravitational/teleport/lib/githubactions" - "github.com/coreos/go-oidc/jose" "github.com/coreos/go-oidc/oauth2" "github.com/coreos/go-oidc/oidc" @@ -72,6 +70,7 @@ import ( "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/events" + "github.com/gravitational/teleport/lib/githubactions" "github.com/gravitational/teleport/lib/inventory" kubeutils "github.com/gravitational/teleport/lib/kube/utils" "github.com/gravitational/teleport/lib/limiter" diff --git a/lib/auth/auth_login_test.go b/lib/auth/auth_login_test.go index 1d8858b9d5017..f882d5667ce33 100644 --- a/lib/auth/auth_login_test.go +++ b/lib/auth/auth_login_test.go @@ -26,9 +26,8 @@ import ( "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth/mocku2f" - "github.com/gravitational/teleport/lib/defaults" - wanlib "github.com/gravitational/teleport/lib/auth/webauthn" + "github.com/gravitational/teleport/lib/defaults" ) func TestServer_CreateAuthenticateChallenge_authPreference(t *testing.T) { diff --git a/lib/auth/auth_test.go b/lib/auth/auth_test.go index 4ab96b026731f..b9af5bf8fdb5b 100644 --- a/lib/auth/auth_test.go +++ b/lib/auth/auth_test.go @@ -30,9 +30,14 @@ import ( "testing" "time" - "golang.org/x/crypto/ssh" - + "github.com/coreos/go-oidc/jose" "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + reporting "github.com/gravitational/reporting/types" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" @@ -58,14 +63,6 @@ import ( "github.com/gravitational/teleport/lib/services/suite" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - reporting "github.com/gravitational/reporting/types" - "github.com/gravitational/trace" - - "github.com/coreos/go-oidc/jose" - "github.com/google/uuid" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) type testPack struct { diff --git a/lib/auth/auth_with_roles.go b/lib/auth/auth_with_roles.go index 5afb750d95b10..13e67078a514f 100644 --- a/lib/auth/auth_with_roles.go +++ b/lib/auth/auth_with_roles.go @@ -23,6 +23,12 @@ import ( "strings" "time" + "github.com/coreos/go-semver/semver" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + collectortracev1 "go.opentelemetry.io/proto/otlp/collector/trace/v1" + otlpcommonv1 "go.opentelemetry.io/proto/otlp/common/v1" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" @@ -40,12 +46,6 @@ import ( "github.com/gravitational/teleport/lib/services/local" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/coreos/go-semver/semver" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - collectortracev1 "go.opentelemetry.io/proto/otlp/collector/trace/v1" - otlpcommonv1 "go.opentelemetry.io/proto/otlp/common/v1" ) // ServerWithRoles is a wrapper around auth service diff --git a/lib/auth/auth_with_roles_test.go b/lib/auth/auth_with_roles_test.go index d3b6a708d4a2d..07eeae8e43c4a 100644 --- a/lib/auth/auth_with_roles_test.go +++ b/lib/auth/auth_with_roles_test.go @@ -24,6 +24,12 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/constants" @@ -42,12 +48,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) // TestLocalUserCanReissueCerts tests that local users can reissue diff --git a/lib/auth/clt.go b/lib/auth/clt.go index 067f5bab82949..455dc0ea3d7fe 100644 --- a/lib/auth/clt.go +++ b/lib/auth/clt.go @@ -28,6 +28,10 @@ import ( "strings" "time" + "github.com/gravitational/roundtrip" + "github.com/gravitational/trace" + "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" "github.com/gravitational/teleport/api/client" @@ -43,10 +47,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/roundtrip" - "github.com/gravitational/trace" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) const ( diff --git a/lib/auth/db.go b/lib/auth/db.go index 9987ce2cc6188..b1770c1778a91 100644 --- a/lib/auth/db.go +++ b/lib/auth/db.go @@ -27,6 +27,8 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -37,8 +39,6 @@ import ( "github.com/gravitational/teleport/lib/modules" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" ) // GenerateDatabaseCert generates client certificate used by a database diff --git a/lib/auth/desktop_test.go b/lib/auth/desktop_test.go index 1c9c42e876414..9b4629ed48229 100644 --- a/lib/auth/desktop_test.go +++ b/lib/auth/desktop_test.go @@ -18,9 +18,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/lib/modules" - "github.com/stretchr/testify/require" ) // TestDesktopAccessDisabled makes sure desktop access can be disabled via modules. diff --git a/lib/auth/github_test.go b/lib/auth/github_test.go index 7805709d242c5..3a9a9c2c3f126 100644 --- a/lib/auth/github_test.go +++ b/lib/auth/github_test.go @@ -26,6 +26,10 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" "github.com/gravitational/teleport/api/types" @@ -38,12 +42,6 @@ import ( "github.com/gravitational/teleport/lib/modules" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - - "github.com/google/go-cmp/cmp" - "github.com/google/uuid" - "github.com/jonboulle/clockwork" ) type githubContext struct { diff --git a/lib/auth/helpers_mfa.go b/lib/auth/helpers_mfa.go index aac8a4ebeebe9..e1e2ae09ff45e 100644 --- a/lib/auth/helpers_mfa.go +++ b/lib/auth/helpers_mfa.go @@ -20,14 +20,15 @@ import ( "context" "time" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth/mocku2f" - wanlib "github.com/gravitational/teleport/lib/auth/webauthn" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/pquerna/otp" "github.com/pquerna/otp/totp" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/auth/mocku2f" + wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) // TestDevice is a test MFA device. diff --git a/lib/auth/init_test.go b/lib/auth/init_test.go index d1bfb852fbab9..4b08e3425fc5b 100644 --- a/lib/auth/init_test.go +++ b/lib/auth/init_test.go @@ -22,6 +22,15 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + kyaml "k8s.io/apimachinery/pkg/util/yaml" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" @@ -37,15 +46,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/proxy" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" - kyaml "k8s.io/apimachinery/pkg/util/yaml" ) // TestReadIdentity makes parses identity from private key and certificate diff --git a/lib/auth/join.go b/lib/auth/join.go index 5acbf7cc019b1..8058282feccc9 100644 --- a/lib/auth/join.go +++ b/lib/auth/join.go @@ -21,11 +21,12 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/trace" ) // tokenJoinMethod returns the join method of the token with the given tokenName diff --git a/lib/auth/join_ec2.go b/lib/auth/join_ec2.go index 2ccedc52bc08c..4ffb34a28c11d 100644 --- a/lib/auth/join_ec2.go +++ b/lib/auth/join_ec2.go @@ -24,13 +24,6 @@ import ( "fmt" "time" - "github.com/gravitational/teleport/api/types" - apiutils "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials/stscreds" @@ -38,8 +31,14 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ec2" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/aws/aws-sdk-go-v2/service/sts" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "go.mozilla.org/pkcs7" + + "github.com/gravitational/teleport/api/types" + apiutils "github.com/gravitational/teleport/api/utils" + "github.com/gravitational/teleport/lib/services" + "github.com/gravitational/teleport/lib/utils" ) type ec2Client interface { diff --git a/lib/auth/join_github.go b/lib/auth/join_github.go index d6a784258bb60..9a3242c69b622 100644 --- a/lib/auth/join_github.go +++ b/lib/auth/join_github.go @@ -19,10 +19,11 @@ package auth import ( "context" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/githubactions" "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/githubactions" ) type ghaIDTokenValidator interface { diff --git a/lib/auth/join_github_test.go b/lib/auth/join_github_test.go index dbc0d2d012e3a..103a5889db5ce 100644 --- a/lib/auth/join_github_test.go +++ b/lib/auth/join_github_test.go @@ -22,12 +22,13 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth/testauthority" - "github.com/gravitational/teleport/lib/githubactions" "github.com/gravitational/trace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/auth/testauthority" + "github.com/gravitational/teleport/lib/githubactions" ) type mockIDTokenValidator struct { diff --git a/lib/auth/join_iam.go b/lib/auth/join_iam.go index 0897ad1c2df55..8c4471823162b 100644 --- a/lib/auth/join_iam.go +++ b/lib/auth/join_iam.go @@ -30,6 +30,13 @@ import ( "regexp" "strings" + awssdk "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/endpoints" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/sts" + "github.com/coreos/go-semver/semver" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" @@ -37,13 +44,6 @@ import ( apiutils "github.com/gravitational/teleport/api/utils" cloudaws "github.com/gravitational/teleport/lib/cloud/aws" "github.com/gravitational/teleport/lib/utils/aws" - - awssdk "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/sts" - "github.com/coreos/go-semver/semver" - "github.com/gravitational/trace" ) const ( diff --git a/lib/auth/join_test.go b/lib/auth/join_test.go index 81c98fda45988..1434bb7eee4b9 100644 --- a/lib/auth/join_test.go +++ b/lib/auth/join_test.go @@ -21,8 +21,6 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" @@ -33,6 +31,7 @@ import ( "github.com/gravitational/teleport/api/types/wrappers" "github.com/gravitational/teleport/api/utils/sshutils" "github.com/gravitational/teleport/lib/auth/testauthority" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" ) diff --git a/lib/auth/keystore/common.go b/lib/auth/keystore/common.go index b4481b6b571bc..877ce77f9beb3 100644 --- a/lib/auth/keystore/common.go +++ b/lib/auth/keystore/common.go @@ -19,12 +19,13 @@ package keystore import ( "crypto/x509/pkix" + "github.com/gravitational/trace" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "golang.org/x/crypto/ssh" ) func newSSHKeyPair(keyStore KeyStore) (*types.SSHKeyPair, error) { diff --git a/lib/auth/keystore/keystore.go b/lib/auth/keystore/keystore.go index 2d33f13c89006..2face24be220b 100644 --- a/lib/auth/keystore/keystore.go +++ b/lib/auth/keystore/keystore.go @@ -20,12 +20,11 @@ import ( "bytes" "crypto" + "github.com/gravitational/trace" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/modules" - - "github.com/gravitational/trace" ) var pkcs11Prefix = []byte("pkcs11:") diff --git a/lib/auth/keystore/keystore_test.go b/lib/auth/keystore/keystore_test.go index 697568f287476..b285ef6daeb55 100644 --- a/lib/auth/keystore/keystore_test.go +++ b/lib/auth/keystore/keystore_test.go @@ -26,15 +26,15 @@ import ( "os" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth/native" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/modules" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" - - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) var ( diff --git a/lib/auth/keystore/pkcs11.go b/lib/auth/keystore/pkcs11.go index 861d222f82f66..fa6dbbac4d061 100644 --- a/lib/auth/keystore/pkcs11.go +++ b/lib/auth/keystore/pkcs11.go @@ -21,15 +21,14 @@ import ( "crypto/rsa" "encoding/json" + "github.com/ThalesIgnite/crypto11" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" - - "github.com/ThalesIgnite/crypto11" - "github.com/google/uuid" - "github.com/sirupsen/logrus" ) // PKCS11Config is used to pass PKCS11 HSM client configuration parameters. diff --git a/lib/auth/keystore/software.go b/lib/auth/keystore/software.go index 2e0b0ed38b543..d0e71c9a7c3f8 100644 --- a/lib/auth/keystore/software.go +++ b/lib/auth/keystore/software.go @@ -17,12 +17,11 @@ package keystore import ( "crypto" + "github.com/gravitational/trace" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) type softwareKeyStore struct { diff --git a/lib/auth/kube.go b/lib/auth/kube.go index 697b5c07c2f49..ad9d3633e796d 100644 --- a/lib/auth/kube.go +++ b/lib/auth/kube.go @@ -20,14 +20,14 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/modules" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" ) // KubeCSR is a kubernetes CSR request diff --git a/lib/auth/kube_test.go b/lib/auth/kube_test.go index 681f2e250043e..1edbb7baebd87 100644 --- a/lib/auth/kube_test.go +++ b/lib/auth/kube_test.go @@ -23,11 +23,12 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/modules" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) func TestProcessKubeCSR(t *testing.T) { diff --git a/lib/auth/middleware.go b/lib/auth/middleware.go index 56f8a64dea0ce..b362b01368f0f 100644 --- a/lib/auth/middleware.go +++ b/lib/auth/middleware.go @@ -25,6 +25,16 @@ import ( "net/http" "time" + "github.com/gravitational/oxy/ratelimit" + "github.com/gravitational/trace" + om "github.com/grpc-ecosystem/go-grpc-middleware/providers/openmetrics/v2" + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" + "golang.org/x/net/http2" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/peer" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -36,16 +46,6 @@ import ( "github.com/gravitational/teleport/lib/observability/metrics" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/oxy/ratelimit" - "github.com/gravitational/trace" - om "github.com/grpc-ecosystem/go-grpc-middleware/providers/openmetrics/v2" - "github.com/prometheus/client_golang/prometheus" - "github.com/sirupsen/logrus" - "golang.org/x/net/http2" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/peer" ) // TLSServerConfig is a configuration for TLS server diff --git a/lib/auth/middleware_test.go b/lib/auth/middleware_test.go index ece06f54fcd44..6428ba87e1193 100644 --- a/lib/auth/middleware_test.go +++ b/lib/auth/middleware_test.go @@ -23,13 +23,13 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/teleport/lib/tlsca" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" + "github.com/gravitational/teleport/lib/tlsca" ) func TestMiddlewareGetUser(t *testing.T) { diff --git a/lib/auth/native/native.go b/lib/auth/native/native.go index e80e8b2676c70..25fd013909051 100644 --- a/lib/auth/native/native.go +++ b/lib/auth/native/native.go @@ -27,6 +27,9 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -38,11 +41,6 @@ import ( "github.com/gravitational/teleport/lib/modules" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/lib/auth/native/native_test.go b/lib/auth/native/native_test.go index 5c1c897a1afa8..14e71eaa02d74 100644 --- a/lib/auth/native/native_test.go +++ b/lib/auth/native/native_test.go @@ -26,7 +26,9 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" @@ -35,9 +37,6 @@ import ( "github.com/gravitational/teleport/lib/auth/test" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/jonboulle/clockwork" - "golang.org/x/crypto/ssh" ) func TestMain(m *testing.M) { diff --git a/lib/auth/oidc_google.go b/lib/auth/oidc_google.go index 8cf646b386f72..fd2595890a23c 100644 --- a/lib/auth/oidc_google.go +++ b/lib/auth/oidc_google.go @@ -19,9 +19,6 @@ import ( "fmt" "os" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/api/utils" - "github.com/coreos/go-oidc/jose" "github.com/gravitational/trace" "golang.org/x/oauth2" @@ -29,6 +26,9 @@ import ( directory "google.golang.org/api/admin/directory/v1" "google.golang.org/api/cloudidentity/v1" "google.golang.org/api/option" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/api/utils" ) const ( diff --git a/lib/auth/password_test.go b/lib/auth/password_test.go index b6dcac160fbdb..c6da5248a78e6 100644 --- a/lib/auth/password_test.go +++ b/lib/auth/password_test.go @@ -26,6 +26,11 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/pquerna/otp/totp" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" @@ -41,12 +46,6 @@ import ( "github.com/gravitational/teleport/lib/events/eventstest" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/services/suite" - - "github.com/gravitational/trace" - - "github.com/jonboulle/clockwork" - "github.com/pquerna/otp/totp" - "github.com/stretchr/testify/require" ) type passwordSuite struct { diff --git a/lib/auth/permissions.go b/lib/auth/permissions.go index bad9259df4724..4245c3e6ed735 100644 --- a/lib/auth/permissions.go +++ b/lib/auth/permissions.go @@ -22,15 +22,15 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/vulcand/predicate/builder" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" - "github.com/vulcand/predicate/builder" ) // NewAdminContext returns new admin auth context diff --git a/lib/auth/register.go b/lib/auth/register.go index f679baadfd923..681caf6e01c33 100644 --- a/lib/auth/register.go +++ b/lib/auth/register.go @@ -21,7 +21,11 @@ import ( "crypto/x509" "time" - "github.com/gravitational/teleport/lib/githubactions" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "golang.org/x/net/http2" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" @@ -32,15 +36,10 @@ import ( "github.com/gravitational/teleport/lib" "github.com/gravitational/teleport/lib/auth/native" "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/githubactions" "github.com/gravitational/teleport/lib/srv/alpnproxy/common" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "golang.org/x/net/http2" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" ) // LocalRegister is used to generate host keys when a node or proxy is running diff --git a/lib/auth/rotate_test.go b/lib/auth/rotate_test.go index 4309664328c76..c73439533b83b 100644 --- a/lib/auth/rotate_test.go +++ b/lib/auth/rotate_test.go @@ -26,10 +26,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" ) func Test_findDuplicatedCertificates(t *testing.T) { diff --git a/lib/auth/session_access.go b/lib/auth/session_access.go index eb42f718d8ef1..e526d23ac5ac2 100644 --- a/lib/auth/session_access.go +++ b/lib/auth/session_access.go @@ -22,11 +22,12 @@ import ( "strings" "github.com/coreos/go-semver/semver" + "github.com/gravitational/trace" + "github.com/vulcand/predicate" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/vulcand/predicate" ) var MinSupportedModeratedSessionsVersion = semver.New(utils.VersionBeforeAlpha("9.0.0")) diff --git a/lib/auth/session_access_test.go b/lib/auth/session_access_test.go index 02ebdd80097a1..bf3658d50b4d1 100644 --- a/lib/auth/session_access_test.go +++ b/lib/auth/session_access_test.go @@ -19,8 +19,9 @@ package auth import ( "testing" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) type startTestCase struct { diff --git a/lib/auth/sessions.go b/lib/auth/sessions.go index 720d726143dcb..c71375d33c908 100644 --- a/lib/auth/sessions.go +++ b/lib/auth/sessions.go @@ -20,6 +20,10 @@ import ( "context" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/keys" @@ -30,10 +34,6 @@ import ( "github.com/gravitational/teleport/lib/services/local" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" ) // CreateAppSession creates and inserts a services.WebSession into the diff --git a/lib/auth/sso_diag_context_test.go b/lib/auth/sso_diag_context_test.go index ca9fc6a5d65ae..e29d5d5db767a 100644 --- a/lib/auth/sso_diag_context_test.go +++ b/lib/auth/sso_diag_context_test.go @@ -20,8 +20,9 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func Test_ssoDiagContext_writeToBackend(t *testing.T) { diff --git a/lib/auth/state.go b/lib/auth/state.go index 82eab666d5add..a21d8d011fe2a 100644 --- a/lib/auth/state.go +++ b/lib/auth/state.go @@ -21,12 +21,12 @@ import ( "encoding/json" "strings" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // stateBackend implements abstraction over local or remote storage backend methods diff --git a/lib/auth/state_unix.go b/lib/auth/state_unix.go index 3cc7c74a1480a..c76587b4661ab 100644 --- a/lib/auth/state_unix.go +++ b/lib/auth/state_unix.go @@ -22,10 +22,11 @@ package auth import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/backend/kubernetes" "github.com/gravitational/teleport/lib/backend/lite" - "github.com/gravitational/trace" ) // NewProcessStorage returns a new instance of the process storage. diff --git a/lib/auth/state_unix_test.go b/lib/auth/state_unix_test.go index 117684bdd3034..6fcb5bc1347ce 100644 --- a/lib/auth/state_unix_test.go +++ b/lib/auth/state_unix_test.go @@ -25,9 +25,10 @@ import ( "sort" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/backend/lite" - "github.com/stretchr/testify/require" ) // simple test to verify that compatibility layer is reading and dumping the keys. diff --git a/lib/auth/test/suite.go b/lib/auth/test/suite.go index 757650b7c9406..bc55ad6929afe 100644 --- a/lib/auth/test/suite.go +++ b/lib/auth/test/suite.go @@ -21,6 +21,10 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -30,12 +34,6 @@ import ( "github.com/gravitational/teleport/api/utils/sshutils" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/sshca" - - "github.com/gravitational/trace" - - "github.com/google/go-cmp/cmp" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) type AuthSuite struct { diff --git a/lib/auth/tls_test.go b/lib/auth/tls_test.go index 8357327f5f964..51477c5115163 100644 --- a/lib/auth/tls_test.go +++ b/lib/auth/tls_test.go @@ -30,14 +30,13 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/pquerna/otp/totp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" - "github.com/gravitational/trace" - "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" "github.com/gravitational/teleport/api/client" diff --git a/lib/auth/touchid/api.go b/lib/auth/touchid/api.go index f2af713f7ee0b..294cb5a7f562a 100644 --- a/lib/auth/touchid/api.go +++ b/lib/auth/touchid/api.go @@ -36,9 +36,9 @@ import ( "github.com/duo-labs/webauthn/protocol/webauthncose" "github.com/fxamacker/cbor/v2" "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" - log "github.com/sirupsen/logrus" ) var ( diff --git a/lib/auth/touchid/api_test.go b/lib/auth/touchid/api_test.go index e09c146918ad5..aca1689849a2f 100644 --- a/lib/auth/touchid/api_test.go +++ b/lib/auth/touchid/api_test.go @@ -31,10 +31,10 @@ import ( "github.com/duo-labs/webauthn/protocol/webauthncose" "github.com/duo-labs/webauthn/webauthn" "github.com/google/uuid" - "github.com/gravitational/teleport/lib/auth/touchid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/auth/touchid" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) diff --git a/lib/auth/webauthn/attestation.go b/lib/auth/webauthn/attestation.go index bfdb0ce225a98..0cf4730432780 100644 --- a/lib/auth/webauthn/attestation.go +++ b/lib/auth/webauthn/attestation.go @@ -19,11 +19,11 @@ import ( "encoding/pem" "github.com/duo-labs/webauthn/protocol" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/api/utils" "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/api/utils" ) // x5cFormats enumerates all attestation formats that supply an attestation diff --git a/lib/auth/webauthn/attestation_test.go b/lib/auth/webauthn/attestation_test.go index 74f1c5189e847..fbd2bed85eec3 100644 --- a/lib/auth/webauthn/attestation_test.go +++ b/lib/auth/webauthn/attestation_test.go @@ -28,10 +28,10 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/duo-labs/webauthn/protocol/webauthncose" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) diff --git a/lib/auth/webauthn/config.go b/lib/auth/webauthn/config.go index 8ddae6efba72e..8e2b03a9dd2a8 100644 --- a/lib/auth/webauthn/config.go +++ b/lib/auth/webauthn/config.go @@ -18,10 +18,10 @@ package webauthn import ( "github.com/duo-labs/webauthn/protocol" + wan "github.com/duo-labs/webauthn/webauthn" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" - - wan "github.com/duo-labs/webauthn/webauthn" ) const ( diff --git a/lib/auth/webauthn/device.go b/lib/auth/webauthn/device.go index 87818a950bf17..feda5879a55b6 100644 --- a/lib/auth/webauthn/device.go +++ b/lib/auth/webauthn/device.go @@ -21,12 +21,12 @@ import ( "crypto/x509" "github.com/duo-labs/webauthn/protocol/webauthncose" + wan "github.com/duo-labs/webauthn/webauthn" "github.com/fxamacker/cbor/v2" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" - - wan "github.com/duo-labs/webauthn/webauthn" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" ) // curveP256CBOR is the constant for the P-256 curve in CBOR. diff --git a/lib/auth/webauthn/fuzz_test.go b/lib/auth/webauthn/fuzz_test.go index 5d2bb238e612a..160df8ab37ed4 100644 --- a/lib/auth/webauthn/fuzz_test.go +++ b/lib/auth/webauthn/fuzz_test.go @@ -20,9 +20,8 @@ import ( "bytes" "testing" - "github.com/stretchr/testify/require" - "github.com/duo-labs/webauthn/protocol" + "github.com/stretchr/testify/require" ) func FuzzParseCredentialCreationResponseBody(f *testing.F) { diff --git a/lib/auth/webauthn/httpserver/main.go b/lib/auth/webauthn/httpserver/main.go index b76c28575c8ca..4a009d704a40c 100644 --- a/lib/auth/webauthn/httpserver/main.go +++ b/lib/auth/webauthn/httpserver/main.go @@ -17,6 +17,7 @@ package main import ( "bytes" "context" + _ "embed" // enable embed "encoding/json" "flag" "fmt" @@ -25,14 +26,12 @@ import ( "net/http" "sync" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" apiclient "github.com/gravitational/teleport/api/client" + "github.com/gravitational/teleport/api/client/proto" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" libclient "github.com/gravitational/teleport/lib/client" - - _ "embed" // enable embed ) //go:embed index.html diff --git a/lib/auth/webauthn/login.go b/lib/auth/webauthn/login.go index 603a76f204e27..b72b7ebf7b3cc 100644 --- a/lib/auth/webauthn/login.go +++ b/lib/auth/webauthn/login.go @@ -25,12 +25,12 @@ import ( "time" "github.com/duo-labs/webauthn/protocol" - "github.com/gravitational/teleport/api/types" + wan "github.com/duo-labs/webauthn/webauthn" "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" - wan "github.com/duo-labs/webauthn/webauthn" + "github.com/gravitational/teleport/api/types" wantypes "github.com/gravitational/teleport/api/types/webauthn" - log "github.com/sirupsen/logrus" ) // loginIdentity contains the subset of services.Identity methods used by diff --git a/lib/auth/webauthn/login_mfa.go b/lib/auth/webauthn/login_mfa.go index 677001b40f5e6..ff0f44c6d5554 100644 --- a/lib/auth/webauthn/login_mfa.go +++ b/lib/auth/webauthn/login_mfa.go @@ -18,9 +18,9 @@ import ( "context" "errors" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" wantypes "github.com/gravitational/teleport/api/types/webauthn" ) diff --git a/lib/auth/webauthn/login_passwordless.go b/lib/auth/webauthn/login_passwordless.go index b7c88dca0c5d5..71584305ecf25 100644 --- a/lib/auth/webauthn/login_passwordless.go +++ b/lib/auth/webauthn/login_passwordless.go @@ -20,7 +20,6 @@ import ( "errors" "github.com/gravitational/teleport/api/types" - wantypes "github.com/gravitational/teleport/api/types/webauthn" ) diff --git a/lib/auth/webauthn/login_test.go b/lib/auth/webauthn/login_test.go index 573e99278dffd..51142ac0bdb91 100644 --- a/lib/auth/webauthn/login_test.go +++ b/lib/auth/webauthn/login_test.go @@ -26,12 +26,12 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/gogo/protobuf/proto" "github.com/google/go-cmp/cmp" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth/mocku2f" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" wantypes "github.com/gravitational/teleport/api/types/webauthn" + "github.com/gravitational/teleport/lib/auth/mocku2f" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) diff --git a/lib/auth/webauthn/messages_test.go b/lib/auth/webauthn/messages_test.go index 891239c285525..a0b693dcebc5a 100644 --- a/lib/auth/webauthn/messages_test.go +++ b/lib/auth/webauthn/messages_test.go @@ -22,9 +22,10 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/duo-labs/webauthn/protocol/webauthncose" "github.com/google/go-cmp/cmp" - wanlib "github.com/gravitational/teleport/lib/auth/webauthn" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) func TestCredentialAssertionResponse_json(t *testing.T) { diff --git a/lib/auth/webauthn/origin.go b/lib/auth/webauthn/origin.go index ba6d00720520e..6fb149b3ff737 100644 --- a/lib/auth/webauthn/origin.go +++ b/lib/auth/webauthn/origin.go @@ -18,8 +18,9 @@ import ( "net/url" "strings" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) func validateOrigin(origin, rpID string) error { diff --git a/lib/auth/webauthn/register.go b/lib/auth/webauthn/register.go index 917d72ba4c1a4..8fa69b01fbb11 100644 --- a/lib/auth/webauthn/register.go +++ b/lib/auth/webauthn/register.go @@ -23,13 +23,13 @@ import ( "time" "github.com/duo-labs/webauthn/protocol" + wan "github.com/duo-labs/webauthn/webauthn" "github.com/google/uuid" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" - wan "github.com/duo-labs/webauthn/webauthn" + "github.com/gravitational/teleport/api/types" wantypes "github.com/gravitational/teleport/api/types/webauthn" - log "github.com/sirupsen/logrus" ) // RegistrationIdentity represents the subset of Identity methods used by diff --git a/lib/auth/webauthn/register_test.go b/lib/auth/webauthn/register_test.go index 8023971738025..b09f673d32ea2 100644 --- a/lib/auth/webauthn/register_test.go +++ b/lib/auth/webauthn/register_test.go @@ -23,11 +23,11 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/google/go-cmp/cmp" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth/mocku2f" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/auth/mocku2f" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) diff --git a/lib/auth/webauthn/session.go b/lib/auth/webauthn/session.go index 001eb2443ae42..dee06d0abf78f 100644 --- a/lib/auth/webauthn/session.go +++ b/lib/auth/webauthn/session.go @@ -20,9 +20,9 @@ import ( "encoding/base64" "github.com/duo-labs/webauthn/protocol" + wan "github.com/duo-labs/webauthn/webauthn" "github.com/gravitational/trace" - wan "github.com/duo-labs/webauthn/webauthn" wantypes "github.com/gravitational/teleport/api/types/webauthn" ) diff --git a/lib/auth/webauthn/user.go b/lib/auth/webauthn/user.go index e65271d1599d5..a4fbbbf95ecc6 100644 --- a/lib/auth/webauthn/user.go +++ b/lib/auth/webauthn/user.go @@ -17,9 +17,9 @@ limitations under the License. package webauthn import ( - "github.com/gravitational/teleport/api/types" - wan "github.com/duo-labs/webauthn/webauthn" + + "github.com/gravitational/teleport/api/types" ) // webUser implements a WebAuthn protocol user. diff --git a/lib/auth/webauthncli/api.go b/lib/auth/webauthncli/api.go index 674e54a4abaf8..cae7255e6d964 100644 --- a/lib/auth/webauthncli/api.go +++ b/lib/auth/webauthncli/api.go @@ -19,13 +19,13 @@ import ( "errors" "strings" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/lib/auth/touchid" - "github.com/gravitational/teleport/lib/auth/webauthnwin" "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/lib/auth/touchid" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" - log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/lib/auth/webauthnwin" ) // AuthenticatorAttachment allows callers to choose a specific attachment. diff --git a/lib/auth/webauthncli/fido2.go b/lib/auth/webauthncli/fido2.go index cf6c1e7745703..d7e42adf5536c 100644 --- a/lib/auth/webauthncli/fido2.go +++ b/lib/auth/webauthncli/fido2.go @@ -31,13 +31,13 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/duo-labs/webauthn/protocol/webauthncose" "github.com/fxamacker/cbor/v2" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" "github.com/keys-pub/go-libfido2" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" wanpb "github.com/gravitational/teleport/api/types/webauthn" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" - log "github.com/sirupsen/logrus" ) // User-friendly device filter errors. diff --git a/lib/auth/webauthncli/fido2_common.go b/lib/auth/webauthncli/fido2_common.go index 0c627b86b8d97..e7118eb6a5b46 100644 --- a/lib/auth/webauthncli/fido2_common.go +++ b/lib/auth/webauthncli/fido2_common.go @@ -21,9 +21,9 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/duo-labs/webauthn/protocol/webauthncose" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) diff --git a/lib/auth/webauthncli/fido2_other.go b/lib/auth/webauthncli/fido2_other.go index f984521c16810..4b2505f4a67d6 100644 --- a/lib/auth/webauthncli/fido2_other.go +++ b/lib/auth/webauthncli/fido2_other.go @@ -22,7 +22,6 @@ import ( "errors" "github.com/gravitational/teleport/api/client/proto" - wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) diff --git a/lib/auth/webauthncli/fido2_test.go b/lib/auth/webauthncli/fido2_test.go index 9f5af3c2d86f4..62dc1eedcaed6 100644 --- a/lib/auth/webauthncli/fido2_test.go +++ b/lib/auth/webauthncli/fido2_test.go @@ -31,13 +31,13 @@ import ( "github.com/duo-labs/webauthn/protocol/webauthncose" "github.com/fxamacker/cbor/v2" "github.com/google/go-cmp/cmp" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/lib/auth/mocku2f" "github.com/keys-pub/go-libfido2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" wanpb "github.com/gravitational/teleport/api/types/webauthn" + "github.com/gravitational/teleport/lib/auth/mocku2f" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" wancli "github.com/gravitational/teleport/lib/auth/webauthncli" ) diff --git a/lib/auth/webauthncli/prompt.go b/lib/auth/webauthncli/prompt.go index 2de926b2c0fa5..8de2e969cda8b 100644 --- a/lib/auth/webauthncli/prompt.go +++ b/lib/auth/webauthncli/prompt.go @@ -22,9 +22,10 @@ import ( "sort" "strconv" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/auth/touchid" "github.com/gravitational/teleport/lib/utils/prompt" - "github.com/gravitational/trace" ) // DefaultPrompt is a default implementation for LoginPrompt and diff --git a/lib/auth/webauthncli/prompt_test.go b/lib/auth/webauthncli/prompt_test.go index 44b587c94d4b5..bfd25efa4bc2b 100644 --- a/lib/auth/webauthncli/prompt_test.go +++ b/lib/auth/webauthncli/prompt_test.go @@ -20,12 +20,12 @@ import ( "strings" "testing" - "github.com/gravitational/teleport/lib/utils/prompt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/gravitational/teleport/lib/auth/touchid" wancli "github.com/gravitational/teleport/lib/auth/webauthncli" + "github.com/gravitational/teleport/lib/utils/prompt" ) func TestDefaultPrompt_PromptCredential(t *testing.T) { diff --git a/lib/auth/webauthncli/u2f.go b/lib/auth/webauthncli/u2f.go index c0c6c26926806..f7018e63f45ec 100644 --- a/lib/auth/webauthncli/u2f.go +++ b/lib/auth/webauthncli/u2f.go @@ -23,7 +23,6 @@ import ( "github.com/flynn/u2f/u2fhid" "github.com/flynn/u2f/u2ftoken" "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) diff --git a/lib/auth/webauthncli/u2f_login.go b/lib/auth/webauthncli/u2f_login.go index f739fd6ca7d32..08dd9f4e0ee84 100644 --- a/lib/auth/webauthncli/u2f_login.go +++ b/lib/auth/webauthncli/u2f_login.go @@ -24,9 +24,9 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/flynn/u2f/u2ftoken" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) diff --git a/lib/auth/webauthncli/u2f_login_test.go b/lib/auth/webauthncli/u2f_login_test.go index a939dd7da2046..ae6226a24a116 100644 --- a/lib/auth/webauthncli/u2f_login_test.go +++ b/lib/auth/webauthncli/u2f_login_test.go @@ -29,12 +29,12 @@ import ( "github.com/flynn/hid" "github.com/flynn/u2f/u2fhid" "github.com/flynn/u2f/u2ftoken" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth/mocku2f" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" wantypes "github.com/gravitational/teleport/api/types/webauthn" + "github.com/gravitational/teleport/lib/auth/mocku2f" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" wancli "github.com/gravitational/teleport/lib/auth/webauthncli" ) diff --git a/lib/auth/webauthncli/u2f_register.go b/lib/auth/webauthncli/u2f_register.go index e1863ac75f4a3..dd11ad29619c3 100644 --- a/lib/auth/webauthncli/u2f_register.go +++ b/lib/auth/webauthncli/u2f_register.go @@ -31,11 +31,11 @@ import ( "github.com/duo-labs/webauthn/protocol/webauthncose" "github.com/flynn/u2f/u2ftoken" "github.com/fxamacker/cbor/v2" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" - log "github.com/sirupsen/logrus" ) // U2FRegister implements Register for U2F/CTAP1 devices. diff --git a/lib/auth/webauthncli/u2f_register_test.go b/lib/auth/webauthncli/u2f_register_test.go index db4f683a5aea3..0e6d8ce41b222 100644 --- a/lib/auth/webauthncli/u2f_register_test.go +++ b/lib/auth/webauthncli/u2f_register_test.go @@ -21,9 +21,9 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/duo-labs/webauthn/protocol/webauthncose" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" wancli "github.com/gravitational/teleport/lib/auth/webauthncli" ) diff --git a/lib/auth/webauthnwin/api.go b/lib/auth/webauthnwin/api.go index fd2f671f6560b..bec43293564f7 100644 --- a/lib/auth/webauthnwin/api.go +++ b/lib/auth/webauthnwin/api.go @@ -27,9 +27,10 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/duo-labs/webauthn/protocol/webauthncose" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" - "github.com/gravitational/trace" ) // LoginOpts groups non-mandatory options for Login. diff --git a/lib/auth/webauthnwin/api_test.go b/lib/auth/webauthnwin/api_test.go index a1ac29dce7bdb..6a9df9bad1e7f 100644 --- a/lib/auth/webauthnwin/api_test.go +++ b/lib/auth/webauthnwin/api_test.go @@ -22,10 +22,11 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/duo-labs/webauthn/protocol/webauthncose" - "github.com/gravitational/teleport/api/types/webauthn" - wanlib "github.com/gravitational/teleport/lib/auth/webauthn" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types/webauthn" + wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) func init() { diff --git a/lib/backend/buffer.go b/lib/backend/buffer.go index 3f861535771cb..3e89990f92e70 100644 --- a/lib/backend/buffer.go +++ b/lib/backend/buffer.go @@ -24,13 +24,13 @@ import ( "sync" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/types" - radix "github.com/armon/go-radix" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/types" ) type bufferConfig struct { diff --git a/lib/backend/buffer_test.go b/lib/backend/buffer_test.go index 84ea4c320db10..13c6d3774174e 100644 --- a/lib/backend/buffer_test.go +++ b/lib/backend/buffer_test.go @@ -22,9 +22,10 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/gravitational/teleport/api/types" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) // TestWatcherSimple tests scenarios with watchers diff --git a/lib/backend/dynamo/dynamodbbk.go b/lib/backend/dynamo/dynamodbbk.go index b5f15ea4aa8fc..bda42fa96af7f 100644 --- a/lib/backend/dynamo/dynamodbbk.go +++ b/lib/backend/dynamo/dynamodbbk.go @@ -26,11 +26,6 @@ import ( "sync/atomic" "time" - "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/teleport/lib/defaults" - dynamometrics "github.com/gravitational/teleport/lib/observability/metrics/dynamo" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" @@ -44,6 +39,11 @@ import ( "github.com/gravitational/trace" "github.com/jonboulle/clockwork" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/utils" + "github.com/gravitational/teleport/lib/backend" + "github.com/gravitational/teleport/lib/defaults" + dynamometrics "github.com/gravitational/teleport/lib/observability/metrics/dynamo" ) // Config structure represents DynamoDB configuration as appears in `storage` section diff --git a/lib/backend/dynamo/shards.go b/lib/backend/dynamo/shards.go index cbde4e820889c..469f42f9e8d5a 100644 --- a/lib/backend/dynamo/shards.go +++ b/lib/backend/dynamo/shards.go @@ -21,15 +21,15 @@ import ( "io" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/api/utils/retryutils" - "github.com/gravitational/teleport/lib/backend" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" "github.com/aws/aws-sdk-go/service/dynamodbstreams" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/api/utils/retryutils" + "github.com/gravitational/teleport/lib/backend" ) type shardEvent struct { diff --git a/lib/backend/etcdbk/etcd.go b/lib/backend/etcdbk/etcd.go index 16dfb6fabb9fb..d9851441f331d 100644 --- a/lib/backend/etcdbk/etcd.go +++ b/lib/backend/etcdbk/etcd.go @@ -28,15 +28,6 @@ import ( "strings" "time" - apidefaults "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/types" - apiutils "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/teleport/lib/observability/metrics" - "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/teleport/lib/utils" - cq "github.com/gravitational/teleport/lib/utils/concurrentqueue" - "github.com/coreos/go-semver/semver" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" @@ -50,6 +41,14 @@ import ( "google.golang.org/grpc/status" "github.com/gravitational/teleport" + apidefaults "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" + apiutils "github.com/gravitational/teleport/api/utils" + "github.com/gravitational/teleport/lib/backend" + "github.com/gravitational/teleport/lib/observability/metrics" + "github.com/gravitational/teleport/lib/tlsca" + "github.com/gravitational/teleport/lib/utils" + cq "github.com/gravitational/teleport/lib/utils/concurrentqueue" ) var ( diff --git a/lib/backend/etcdbk/etcd_test.go b/lib/backend/etcdbk/etcd_test.go index 7693f2ed0b602..987817796012c 100644 --- a/lib/backend/etcdbk/etcd_test.go +++ b/lib/backend/etcdbk/etcd_test.go @@ -24,13 +24,13 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/teleport/lib/backend/test" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/backend" + "github.com/gravitational/teleport/lib/backend/test" + "github.com/gravitational/teleport/lib/utils" ) const ( diff --git a/lib/backend/firestore/firestorebk.go b/lib/backend/firestore/firestorebk.go index df24fc2659d82..1d2859ecfb9c7 100644 --- a/lib/backend/firestore/firestorebk.go +++ b/lib/backend/firestore/firestorebk.go @@ -23,7 +23,10 @@ import ( "cloud.google.com/go/firestore" apiv1 "cloud.google.com/go/firestore/apiv1/admin" + "github.com/gravitational/trace" "github.com/gravitational/trace/trail" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" "google.golang.org/api/option" adminpb "google.golang.org/genproto/googleapis/firestore/admin/v1" "google.golang.org/grpc" @@ -36,11 +39,6 @@ import ( "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/defaults" - - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" - - "github.com/gravitational/trace" ) // Config structure represents Firestore configuration as appears in `storage` section of Teleport YAML diff --git a/lib/backend/firestore/firestorebk_test.go b/lib/backend/firestore/firestorebk_test.go index 4abc43527e3ba..c9a118764214e 100644 --- a/lib/backend/firestore/firestorebk_test.go +++ b/lib/backend/firestore/firestorebk_test.go @@ -25,9 +25,6 @@ import ( "time" "cloud.google.com/go/firestore" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/teleport/lib/backend/test" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" @@ -42,6 +39,10 @@ import ( "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/gravitational/teleport/lib/backend" + "github.com/gravitational/teleport/lib/backend/test" + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/backend/kubernetes/kubernetes.go b/lib/backend/kubernetes/kubernetes.go index aa195a320702b..c945f7c1d9024 100644 --- a/lib/backend/kubernetes/kubernetes.go +++ b/lib/backend/kubernetes/kubernetes.go @@ -23,14 +23,15 @@ import ( "strings" "sync" - "github.com/gravitational/teleport/lib/backend" - kubeutils "github.com/gravitational/teleport/lib/kube/utils" "github.com/gravitational/trace" corev1 "k8s.io/api/core/v1" kubeerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" applyconfigv1 "k8s.io/client-go/applyconfigurations/core/v1" "k8s.io/client-go/kubernetes" + + "github.com/gravitational/teleport/lib/backend" + kubeutils "github.com/gravitational/teleport/lib/kube/utils" ) const ( diff --git a/lib/backend/kubernetes/kubernetes_test.go b/lib/backend/kubernetes/kubernetes_test.go index 0136046e634bb..c4549198fa494 100644 --- a/lib/backend/kubernetes/kubernetes_test.go +++ b/lib/backend/kubernetes/kubernetes_test.go @@ -20,7 +20,6 @@ import ( "context" "testing" - "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/trace" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" @@ -29,6 +28,8 @@ import ( "k8s.io/client-go/kubernetes/fake" fakecorev1 "k8s.io/client-go/kubernetes/typed/core/v1/fake" k8stesting "k8s.io/client-go/testing" + + "github.com/gravitational/teleport/lib/backend" ) func TestBackend_Exists(t *testing.T) { diff --git a/lib/backend/lite/lite.go b/lib/backend/lite/lite.go index ed0ff24223697..57be996d719cc 100644 --- a/lib/backend/lite/lite.go +++ b/lib/backend/lite/lite.go @@ -30,14 +30,14 @@ import ( "sync/atomic" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" sqlite3 "github.com/mattn/go-sqlite3" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/api/utils" + "github.com/gravitational/teleport/lib/backend" ) const ( diff --git a/lib/backend/lite/lite_test.go b/lib/backend/lite/lite_test.go index 1164f73901042..dd06d8c122e93 100644 --- a/lib/backend/lite/lite_test.go +++ b/lib/backend/lite/lite_test.go @@ -22,13 +22,13 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/teleport/lib/backend/test" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" - "github.com/jonboulle/clockwork" + "github.com/gravitational/teleport/lib/backend" + "github.com/gravitational/teleport/lib/backend/test" + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/backend/lite/periodic.go b/lib/backend/lite/periodic.go index 4c7ce975550c2..6c17502144d25 100644 --- a/lib/backend/lite/periodic.go +++ b/lib/backend/lite/periodic.go @@ -20,9 +20,9 @@ import ( "database/sql" "time" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/backend" ) const notSet = -2 diff --git a/lib/backend/memory/item.go b/lib/backend/memory/item.go index 83f5f84b17eaa..95fb5ee1e43fc 100644 --- a/lib/backend/memory/item.go +++ b/lib/backend/memory/item.go @@ -19,9 +19,9 @@ package memory import ( "bytes" - "github.com/gravitational/teleport/lib/backend" - "github.com/google/btree" + + "github.com/gravitational/teleport/lib/backend" ) // btreeItem is a copy of a backend item diff --git a/lib/backend/memory/memory.go b/lib/backend/memory/memory.go index 0c2fa6251782c..0632dfd5ab9a4 100644 --- a/lib/backend/memory/memory.go +++ b/lib/backend/memory/memory.go @@ -23,14 +23,14 @@ import ( "sync/atomic" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/backend" - "github.com/google/btree" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/backend" ) // GetName is a part of backend API and it returns in-memory backend type diff --git a/lib/backend/memory/memory_test.go b/lib/backend/memory/memory_test.go index a955c95d8f121..093ab26fffc68 100644 --- a/lib/backend/memory/memory_test.go +++ b/lib/backend/memory/memory_test.go @@ -20,12 +20,12 @@ import ( "os" "testing" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/backend/test" "github.com/gravitational/teleport/lib/utils" - "github.com/jonboulle/clockwork" - - "github.com/gravitational/trace" ) func TestMain(m *testing.M) { diff --git a/lib/backend/report_test.go b/lib/backend/report_test.go index 1e09e147a749a..a521eeafdddc0 100644 --- a/lib/backend/report_test.go +++ b/lib/backend/report_test.go @@ -19,9 +19,10 @@ import ( "sync/atomic" "testing" - "github.com/gravitational/teleport/api/types" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestReporterTopRequestsLimit(t *testing.T) { diff --git a/lib/backend/sanitize.go b/lib/backend/sanitize.go index f6c751035b9fc..4bfb5fc635350 100644 --- a/lib/backend/sanitize.go +++ b/lib/backend/sanitize.go @@ -23,7 +23,6 @@ import ( "unicode/utf8" "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" ) diff --git a/lib/backend/test/suite.go b/lib/backend/test/suite.go index 17649937cc788..c6781474547c2 100644 --- a/lib/backend/test/suite.go +++ b/lib/backend/test/suite.go @@ -29,14 +29,13 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/backend" - - "github.com/gravitational/trace" - "github.com/google/uuid" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/backend" ) var ( diff --git a/lib/benchmark/benchmark.go b/lib/benchmark/benchmark.go index 8e9e1d6f12136..a92f848c14465 100644 --- a/lib/benchmark/benchmark.go +++ b/lib/benchmark/benchmark.go @@ -28,14 +28,14 @@ import ( "syscall" "time" + "github.com/HdrHistogram/hdrhistogram-go" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/profile" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/observability/tracing" "github.com/gravitational/teleport/lib/utils" - - "github.com/HdrHistogram/hdrhistogram-go" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) const ( diff --git a/lib/bpf/common.go b/lib/bpf/common.go index 446a5a7abcf97..8ae6a2c8174da 100644 --- a/lib/bpf/common.go +++ b/lib/bpf/common.go @@ -21,14 +21,13 @@ import "C" import ( "context" + "github.com/coreos/go-semver/semver" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - - "github.com/coreos/go-semver/semver" ) // BPF implements an interface to open and close a recording session. diff --git a/lib/bpf/common_test.go b/lib/bpf/common_test.go index 581058895b3d8..156829458df3d 100644 --- a/lib/bpf/common_test.go +++ b/lib/bpf/common_test.go @@ -20,9 +20,10 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/lib/cache/cache.go b/lib/cache/cache.go index b6adba3459ebc..b8d4a37da9a09 100644 --- a/lib/cache/cache.go +++ b/lib/cache/cache.go @@ -23,6 +23,15 @@ import ( "sync/atomic" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + oteltrace "go.opentelemetry.io/otel/trace" + "golang.org/x/sync/errgroup" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -36,15 +45,6 @@ import ( "github.com/gravitational/teleport/lib/services/local" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/interval" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/prometheus/client_golang/prometheus" - log "github.com/sirupsen/logrus" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - oteltrace "go.opentelemetry.io/otel/trace" - "golang.org/x/sync/errgroup" ) var ( diff --git a/lib/cache/collections.go b/lib/cache/collections.go index 8dd0f5594e91b..cf7cdaa121852 100644 --- a/lib/cache/collections.go +++ b/lib/cache/collections.go @@ -20,10 +20,10 @@ import ( "context" "fmt" + "github.com/gravitational/trace" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" - - "github.com/gravitational/trace" ) // collection is responsible for managing collection diff --git a/lib/cgroup/cgroup.go b/lib/cgroup/cgroup.go index 76821e52f9125..7918a585adf39 100644 --- a/lib/cgroup/cgroup.go +++ b/lib/cgroup/cgroup.go @@ -34,15 +34,13 @@ import ( "strconv" "strings" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/defaults" - - "github.com/gravitational/trace" - - "github.com/google/uuid" - "github.com/sirupsen/logrus" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/lib/cgroup/cgroup_test.go b/lib/cgroup/cgroup_test.go index a41bddb9f3a6e..95d3b1aa58fa5 100644 --- a/lib/cgroup/cgroup_test.go +++ b/lib/cgroup/cgroup_test.go @@ -24,10 +24,10 @@ import ( "path" "testing" - "github.com/gravitational/teleport/lib/utils" - "github.com/google/uuid" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/client/api.go b/lib/client/api.go index 0b5f66d47b0b5..82a5ac6ea63ac 100644 --- a/lib/client/api.go +++ b/lib/client/api.go @@ -39,6 +39,15 @@ import ( "time" "unicode/utf8" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "go.opentelemetry.io/otel/attribute" + oteltrace "go.opentelemetry.io/otel/trace" + "golang.org/x/crypto/ssh" + "golang.org/x/crypto/ssh/agent" + "golang.org/x/sync/errgroup" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/client/webclient" @@ -75,15 +84,6 @@ import ( "github.com/gravitational/teleport/lib/utils/agentconn" "github.com/gravitational/teleport/lib/utils/prompt" "github.com/gravitational/teleport/lib/utils/proxy" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "go.opentelemetry.io/otel/attribute" - oteltrace "go.opentelemetry.io/otel/trace" - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" - "golang.org/x/sync/errgroup" ) const ( diff --git a/lib/client/ca_export.go b/lib/client/ca_export.go index 6a795f7b9b666..cca6649739729 100644 --- a/lib/client/ca_export.go +++ b/lib/client/ca_export.go @@ -22,12 +22,13 @@ import ( "strings" "time" + "github.com/gravitational/trace" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/sshutils" - "github.com/gravitational/trace" ) // ExportAuthoritiesRequest has the required fields to create an export authorities request. diff --git a/lib/client/ca_export_test.go b/lib/client/ca_export_test.go index ec7a0b386c3c4..0fc1219f76a65 100644 --- a/lib/client/ca_export_test.go +++ b/lib/client/ca_export_test.go @@ -23,10 +23,11 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/services" - "github.com/stretchr/testify/require" ) type mockAuthClient struct { diff --git a/lib/client/client.go b/lib/client/client.go index 8bd419195262f..72c3d6dda938e 100644 --- a/lib/client/client.go +++ b/lib/client/client.go @@ -30,7 +30,13 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/moby/term" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/propagation" + oteltrace "go.opentelemetry.io/otel/trace" + "golang.org/x/crypto/ssh" + "golang.org/x/crypto/ssh/agent" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" @@ -50,13 +56,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils/sftp" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/socks" - - "github.com/gravitational/trace" - "github.com/moby/term" - "go.opentelemetry.io/otel/attribute" - oteltrace "go.opentelemetry.io/otel/trace" - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" ) // ProxyClient implements ssh client to a teleport proxy diff --git a/lib/client/client_test.go b/lib/client/client_test.go index 5cfcfccb76921..604d38a10a505 100644 --- a/lib/client/client_test.go +++ b/lib/client/client_test.go @@ -26,14 +26,14 @@ import ( "testing" "time" - tracessh "github.com/gravitational/teleport/api/observability/tracing/ssh" - "github.com/gravitational/teleport/lib/observability/tracing" - "github.com/gravitational/teleport/lib/sshutils" - "github.com/google/go-cmp/cmp" "github.com/gravitational/trace" "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" + + tracessh "github.com/gravitational/teleport/api/observability/tracing/ssh" + "github.com/gravitational/teleport/lib/observability/tracing" + "github.com/gravitational/teleport/lib/sshutils" ) func TestHelperFunctions(t *testing.T) { diff --git a/lib/client/conntest/connection_tester.go b/lib/client/conntest/connection_tester.go index 3af46ba4d937a..a96bc3df55acf 100644 --- a/lib/client/conntest/connection_tester.go +++ b/lib/client/conntest/connection_tester.go @@ -20,10 +20,11 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/trace" ) // TestConnectionRequest contains diff --git a/lib/client/conntest/kube.go b/lib/client/conntest/kube.go index 60ced466e24ea..b9cd76c463c11 100644 --- a/lib/client/conntest/kube.go +++ b/lib/client/conntest/kube.go @@ -24,15 +24,16 @@ import ( "time" "github.com/google/uuid" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/client" "github.com/gravitational/trace" kubeerrors "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/client" ) // KubeConnectionTesterConfig defines the config fields for KubeConnectionTester. diff --git a/lib/client/db/mysql/optionfile.go b/lib/client/db/mysql/optionfile.go index f88da68986504..37423ca763c4b 100644 --- a/lib/client/db/mysql/optionfile.go +++ b/lib/client/db/mysql/optionfile.go @@ -22,10 +22,10 @@ import ( "strconv" "strings" - "github.com/gravitational/teleport/lib/client/db/profile" - "github.com/gravitational/trace" "gopkg.in/ini.v1" + + "github.com/gravitational/teleport/lib/client/db/profile" ) // OptionFile represents MySQL option file. diff --git a/lib/client/db/mysql/optionfile_test.go b/lib/client/db/mysql/optionfile_test.go index 8b4051d8e46f7..9254938044b4b 100644 --- a/lib/client/db/mysql/optionfile_test.go +++ b/lib/client/db/mysql/optionfile_test.go @@ -20,10 +20,10 @@ import ( "path/filepath" "testing" - "github.com/gravitational/teleport/lib/client/db/profile" - "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/client/db/profile" ) func TestOptionFile(t *testing.T) { diff --git a/lib/client/db/postgres/connstring_test.go b/lib/client/db/postgres/connstring_test.go index 567c67beb47fa..53d7a91076c67 100644 --- a/lib/client/db/postgres/connstring_test.go +++ b/lib/client/db/postgres/connstring_test.go @@ -19,9 +19,9 @@ package postgres import ( "testing" - "github.com/gravitational/teleport/lib/client/db/profile" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/client/db/profile" ) // TestConnString verifies creating Postgres connection string from profile. diff --git a/lib/client/db/postgres/servicefile.go b/lib/client/db/postgres/servicefile.go index 1b92158e1b64a..2018d4d0363c0 100644 --- a/lib/client/db/postgres/servicefile.go +++ b/lib/client/db/postgres/servicefile.go @@ -22,10 +22,10 @@ import ( "strconv" "strings" - "github.com/gravitational/teleport/lib/client/db/profile" - "github.com/gravitational/trace" "gopkg.in/ini.v1" + + "github.com/gravitational/teleport/lib/client/db/profile" ) // ServiceFile represents Postgres connection service file. diff --git a/lib/client/db/postgres/servicefile_test.go b/lib/client/db/postgres/servicefile_test.go index 6bbb366a10a76..d5f1118a9ca0f 100644 --- a/lib/client/db/postgres/servicefile_test.go +++ b/lib/client/db/postgres/servicefile_test.go @@ -21,10 +21,10 @@ import ( "strconv" "testing" - "github.com/gravitational/teleport/lib/client/db/profile" - "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/client/db/profile" ) func TestServiceFile(t *testing.T) { diff --git a/lib/client/db/profile.go b/lib/client/db/profile.go index 300f076087319..af63e4c1c2a49 100644 --- a/lib/client/db/profile.go +++ b/lib/client/db/profile.go @@ -30,14 +30,14 @@ import ( "context" "fmt" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/client/db/mysql" "github.com/gravitational/teleport/lib/client/db/postgres" "github.com/gravitational/teleport/lib/client/db/profile" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" ) // Add updates database connection profile file. diff --git a/lib/client/db/profile_test.go b/lib/client/db/profile_test.go index 33957c5160773..88a8d16a31d7e 100644 --- a/lib/client/db/profile_test.go +++ b/lib/client/db/profile_test.go @@ -19,14 +19,14 @@ package db import ( "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/client/db/profile" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/observability/tracing" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) // TestAddProfile verifies that connection profile is populated with correct diff --git a/lib/client/https_client.go b/lib/client/https_client.go index 32b54deea2364..4e7f4c8e43e08 100644 --- a/lib/client/https_client.go +++ b/lib/client/https_client.go @@ -23,17 +23,17 @@ import ( "net/http" "net/url" + "github.com/gravitational/roundtrip" + "github.com/gravitational/trace" + "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + "golang.org/x/net/http/httpproxy" + "github.com/gravitational/teleport" apiproxy "github.com/gravitational/teleport/api/client/proxy" "github.com/gravitational/teleport/api/observability/tracing" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/httplib" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/roundtrip" - "github.com/gravitational/trace" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" - "golang.org/x/net/http/httpproxy" ) func NewInsecureWebClient() *http.Client { diff --git a/lib/client/identityfile/identity_test.go b/lib/client/identityfile/identity_test.go index 8a9456d42790f..0d6f4e07d51a2 100644 --- a/lib/client/identityfile/identity_test.go +++ b/lib/client/identityfile/identity_test.go @@ -26,6 +26,7 @@ import ( "github.com/gravitational/trace" "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/utils/keypaths" @@ -36,8 +37,6 @@ import ( "github.com/gravitational/teleport/lib/kube/kubeconfig" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/stretchr/testify/require" ) func newSelfSignedCA(priv crypto.Signer) (*tlsca.CertAuthority, auth.TrustedCerts, error) { diff --git a/lib/client/identityfile/inmemory_config_writer.go b/lib/client/identityfile/inmemory_config_writer.go index bc20e9b51faf8..3c0f6274a50cf 100644 --- a/lib/client/identityfile/inmemory_config_writer.go +++ b/lib/client/identityfile/inmemory_config_writer.go @@ -22,8 +22,9 @@ import ( "sync" "time" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) // NewInMemoryConfigWriter creates a new virtual file system diff --git a/lib/client/interfaces.go b/lib/client/interfaces.go index 7f44c1621a514..458475997fb47 100644 --- a/lib/client/interfaces.go +++ b/lib/client/interfaces.go @@ -24,6 +24,10 @@ import ( "fmt" "time" + "github.com/gravitational/trace" + "golang.org/x/crypto/ssh" + "golang.org/x/crypto/ssh/agent" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/identityfile" @@ -35,10 +39,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" ) // KeyIndex helps to identify a key in the store. diff --git a/lib/client/keyagent.go b/lib/client/keyagent.go index fc55b8113035e..9dec99d3089e4 100644 --- a/lib/client/keyagent.go +++ b/lib/client/keyagent.go @@ -26,19 +26,17 @@ import ( "runtime" "strings" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" - "github.com/gravitational/trace" - "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/utils/sshutils" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils/prompt" - - "github.com/sirupsen/logrus" ) // LocalKeyAgent holds Teleport certificates for a user connected to a cluster. diff --git a/lib/client/keyagent_test.go b/lib/client/keyagent_test.go index 2bf19fd219ba6..86c8c72c60700 100644 --- a/lib/client/keyagent_test.go +++ b/lib/client/keyagent_test.go @@ -27,11 +27,12 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" - "github.com/stretchr/testify/require" - "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/keypaths" @@ -41,10 +42,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - - "github.com/jonboulle/clockwork" ) type KeyAgentTestSuite struct { diff --git a/lib/client/keystore.go b/lib/client/keystore.go index 81c407ec74078..87299897b10ce 100644 --- a/lib/client/keystore.go +++ b/lib/client/keystore.go @@ -29,6 +29,8 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -40,10 +42,6 @@ import ( "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" - - "github.com/sirupsen/logrus" - - "github.com/gravitational/trace" ) const ( diff --git a/lib/client/keystore_test.go b/lib/client/keystore_test.go index 6dfb149f25d00..3c78be9de94fc 100644 --- a/lib/client/keystore_test.go +++ b/lib/client/keystore_test.go @@ -28,7 +28,11 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/keypaths" @@ -41,11 +45,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) func TestListKeys(t *testing.T) { diff --git a/lib/client/known_hosts_migrate.go b/lib/client/known_hosts_migrate.go index 6246115a61c3d..694e5aabba602 100644 --- a/lib/client/known_hosts_migrate.go +++ b/lib/client/known_hosts_migrate.go @@ -19,10 +19,11 @@ package client import ( "bytes" - "github.com/gravitational/teleport" "github.com/gravitational/trace" "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport" ) // knownHostEntry is a parsed entry from a Teleport/OpenSSH known_hosts file, diff --git a/lib/client/known_hosts_migrate_test.go b/lib/client/known_hosts_migrate_test.go index 4c7d9c9afb848..61e5a62ed919f 100644 --- a/lib/client/known_hosts_migrate_test.go +++ b/lib/client/known_hosts_migrate_test.go @@ -22,10 +22,11 @@ import ( "strings" "testing" - "github.com/gravitational/teleport/lib/auth/testauthority" - "github.com/gravitational/teleport/lib/services" "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/lib/auth/testauthority" + "github.com/gravitational/teleport/lib/services" ) type knownHostsMigrateTest struct { diff --git a/lib/client/kubesession.go b/lib/client/kubesession.go index 0b778fd19fef4..3450c4d0880f2 100644 --- a/lib/client/kubesession.go +++ b/lib/client/kubesession.go @@ -24,14 +24,14 @@ import ( "io" "time" + "github.com/gorilla/websocket" + "github.com/gravitational/trace" + "k8s.io/client-go/tools/remotecommand" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client/terminal" "github.com/gravitational/teleport/lib/kube/proxy/streamproto" "github.com/gravitational/teleport/lib/utils" - - "github.com/gorilla/websocket" - "github.com/gravitational/trace" - "k8s.io/client-go/tools/remotecommand" ) const mfaChallengeInterval = time.Second * 30 diff --git a/lib/client/player.go b/lib/client/player.go index c36e9af052c2c..3ea4030e1f07c 100644 --- a/lib/client/player.go +++ b/lib/client/player.go @@ -23,11 +23,11 @@ import ( "sync" "time" - "github.com/gravitational/teleport/lib/client/terminal" - "github.com/gravitational/teleport/lib/events" - "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/client/terminal" + "github.com/gravitational/teleport/lib/events" ) type tshPlayerState int diff --git a/lib/client/player_test.go b/lib/client/player_test.go index bfd1b0cbae953..02fe170b6404a 100644 --- a/lib/client/player_test.go +++ b/lib/client/player_test.go @@ -21,10 +21,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/client/terminal" - "github.com/gravitational/teleport/lib/events" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/client/terminal" + "github.com/gravitational/teleport/lib/events" ) // TestEmptyPlay verifies that a playback of 0 events diff --git a/lib/client/presence.go b/lib/client/presence.go index 3646ce11411d9..41705c084afec 100644 --- a/lib/client/presence.go +++ b/lib/client/presence.go @@ -22,9 +22,10 @@ import ( "io" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/trace" ) func runPresenceTask(ctx context.Context, term io.Writer, auth auth.ClientI, tc *TeleportClient, sessionID string) error { diff --git a/lib/client/redirect.go b/lib/client/redirect.go index 71fe9b8cffa5c..419d69ff0bb2a 100644 --- a/lib/client/redirect.go +++ b/lib/client/redirect.go @@ -24,12 +24,12 @@ import ( "net/http/httptest" "net/url" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/secret" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" ) const ( diff --git a/lib/client/session.go b/lib/client/session.go index a17e16f37261a..6a893f319ec99 100644 --- a/lib/client/session.go +++ b/lib/client/session.go @@ -29,7 +29,10 @@ import ( "syscall" "time" + "github.com/gravitational/trace" oteltrace "go.opentelemetry.io/otel/trace" + "golang.org/x/crypto/ssh" + "golang.org/x/crypto/ssh/agent" "github.com/gravitational/teleport" tracessh "github.com/gravitational/teleport/api/observability/tracing/ssh" @@ -42,10 +45,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/sshutils/x11" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" ) const ( diff --git a/lib/client/terminal/terminal_common.go b/lib/client/terminal/terminal_common.go index f9989169a9d92..ca6748581d666 100644 --- a/lib/client/terminal/terminal_common.go +++ b/lib/client/terminal/terminal_common.go @@ -18,9 +18,10 @@ package terminal import ( "sync" - "github.com/gravitational/teleport" "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/lib/client/weblogin.go b/lib/client/weblogin.go index 367f7c6fa498f..728a5b57ab468 100644 --- a/lib/client/weblogin.go +++ b/lib/client/weblogin.go @@ -32,6 +32,8 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/gravitational/roundtrip" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" @@ -40,13 +42,9 @@ import ( "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/keys" "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/defaults" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - wanlib "github.com/gravitational/teleport/lib/auth/webauthn" wancli "github.com/gravitational/teleport/lib/auth/webauthncli" + "github.com/gravitational/teleport/lib/defaults" ) const ( diff --git a/lib/client/weblogin_test.go b/lib/client/weblogin_test.go index f58af624c5cd7..a562966a06e58 100644 --- a/lib/client/weblogin_test.go +++ b/lib/client/weblogin_test.go @@ -26,14 +26,14 @@ import ( "testing" "time" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" wancli "github.com/gravitational/teleport/lib/auth/webauthncli" "github.com/gravitational/teleport/lib/client" - "github.com/jonboulle/clockwork" - - "github.com/stretchr/testify/require" ) func TestPlainHttpFallback(t *testing.T) { diff --git a/lib/cloud/aws/identity.go b/lib/cloud/aws/identity.go index c0aa1e76be1ce..869a0f017ffd2 100644 --- a/lib/cloud/aws/identity.go +++ b/lib/cloud/aws/identity.go @@ -25,7 +25,6 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/sts" "github.com/aws/aws-sdk-go/service/sts/stsiface" - "github.com/gravitational/trace" ) diff --git a/lib/cloud/aws/identity_test.go b/lib/cloud/aws/identity_test.go index 15eaeb45cc8c5..6b98b96fea3eb 100644 --- a/lib/cloud/aws/identity_test.go +++ b/lib/cloud/aws/identity_test.go @@ -24,7 +24,6 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/sts" "github.com/aws/aws-sdk-go/service/sts/stsiface" - "github.com/stretchr/testify/require" ) diff --git a/lib/cloud/aws/policy.go b/lib/cloud/aws/policy.go index d6a759f0f779d..d788d729ab2ea 100644 --- a/lib/cloud/aws/policy.go +++ b/lib/cloud/aws/policy.go @@ -26,9 +26,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/iam/iamiface" - log "github.com/sirupsen/logrus" - "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" ) // Policy represents an AWS IAM policy. diff --git a/lib/cloud/azure/errors.go b/lib/cloud/azure/errors.go index 85c14e7273f02..c9698009d49cf 100644 --- a/lib/cloud/azure/errors.go +++ b/lib/cloud/azure/errors.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/gravitational/trace" ) diff --git a/lib/cloud/azure/imds.go b/lib/cloud/azure/imds.go index 25906e1571a94..7d6d9f5678ec5 100644 --- a/lib/cloud/azure/imds.go +++ b/lib/cloud/azure/imds.go @@ -20,11 +20,12 @@ import ( "net/http" "sync" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) const ( diff --git a/lib/cloud/azure/mysql.go b/lib/cloud/azure/mysql.go index 8ce17af8186fd..784a17f2f7086 100644 --- a/lib/cloud/azure/mysql.go +++ b/lib/cloud/azure/mysql.go @@ -20,9 +20,8 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" - log "github.com/sirupsen/logrus" - "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" ) var _ DBServersClient = (*mySQLClient)(nil) diff --git a/lib/cloud/azure/postgres.go b/lib/cloud/azure/postgres.go index 0ef28cc06ba78..a0ad949bbb7ca 100644 --- a/lib/cloud/azure/postgres.go +++ b/lib/cloud/azure/postgres.go @@ -20,7 +20,6 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" - "github.com/gravitational/trace" ) diff --git a/lib/cloud/azure/redis.go b/lib/cloud/azure/redis.go index 4659e9c11665e..33f378e46104a 100644 --- a/lib/cloud/azure/redis.go +++ b/lib/cloud/azure/redis.go @@ -23,9 +23,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v2" - "github.com/sirupsen/logrus" - "github.com/gravitational/trace" + "github.com/sirupsen/logrus" ) // armRedisClient is an interface defines a subset of functions of armredis.Client. diff --git a/lib/cloud/azure/redis_enterprise.go b/lib/cloud/azure/redis_enterprise.go index abf80aec04857..6358efd0b2767 100644 --- a/lib/cloud/azure/redis_enterprise.go +++ b/lib/cloud/azure/redis_enterprise.go @@ -24,9 +24,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise" - "github.com/sirupsen/logrus" - "github.com/gravitational/trace" + "github.com/sirupsen/logrus" ) // armRedisEnterpriseDatabaseClient is an interface defines a subset of diff --git a/lib/cloud/azure/subscriptions.go b/lib/cloud/azure/subscriptions.go index 247a859877fe7..256c559baa805 100644 --- a/lib/cloud/azure/subscriptions.go +++ b/lib/cloud/azure/subscriptions.go @@ -21,7 +21,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" - "github.com/gravitational/trace" ) diff --git a/lib/cloud/clients.go b/lib/cloud/clients.go index 669c5ffa250c2..325043da8689e 100644 --- a/lib/cloud/clients.go +++ b/lib/cloud/clients.go @@ -21,6 +21,7 @@ import ( "io" "sync" + gcpcredentials "cloud.google.com/go/iam/credentials/apiv1" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" @@ -28,8 +29,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" - - gcpcredentials "cloud.google.com/go/iam/credentials/apiv1" "github.com/aws/aws-sdk-go/aws" awssession "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" @@ -52,13 +51,13 @@ import ( "github.com/aws/aws-sdk-go/service/ssm/ssmiface" "github.com/aws/aws-sdk-go/service/sts" "github.com/aws/aws-sdk-go/service/sts/stsiface" - "google.golang.org/grpc/credentials/insecure" - - "github.com/gravitational/teleport/lib/cloud/azure" "github.com/gravitational/trace" "github.com/sirupsen/logrus" "google.golang.org/api/option" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + + "github.com/gravitational/teleport/lib/cloud/azure" ) // Clients provides interface for obtaining cloud provider clients. diff --git a/lib/cloud/gcp.go b/lib/cloud/gcp.go index 1ab497c81f090..8765286e1c68d 100644 --- a/lib/cloud/gcp.go +++ b/lib/cloud/gcp.go @@ -25,12 +25,12 @@ import ( "fmt" "time" + "github.com/gravitational/trace" + sqladmin "google.golang.org/api/sqladmin/v1beta4" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" - - sqladmin "google.golang.org/api/sqladmin/v1beta4" ) // GCPSQLAdminClient defines an interface providing access to the GCP Cloud SQL API. diff --git a/lib/cloud/imds.go b/lib/cloud/imds.go index 5599b6fc7fb71..bababe093a151 100644 --- a/lib/cloud/imds.go +++ b/lib/cloud/imds.go @@ -19,10 +19,11 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/cloud/aws" "github.com/gravitational/teleport/lib/cloud/azure" - "github.com/gravitational/trace" ) const ( diff --git a/lib/config/configuration_test.go b/lib/config/configuration_test.go index 95561b482a357..7e27feb194c26 100644 --- a/lib/config/configuration_test.go +++ b/lib/config/configuration_test.go @@ -29,7 +29,12 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" + "google.golang.org/protobuf/testing/protocmp" "github.com/gravitational/teleport/api/constants" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -45,12 +50,6 @@ import ( "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/testing/protocmp" ) type testConfigFiles struct { diff --git a/lib/config/database.go b/lib/config/database.go index c780c4beca394..f85b31349d9cf 100644 --- a/lib/config/database.go +++ b/lib/config/database.go @@ -20,10 +20,11 @@ import ( "strings" "text/template" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" ) // databaseConfigTemplateFunc list of template functions used on the database diff --git a/lib/config/fileconf.go b/lib/config/fileconf.go index d7ba925aa5e51..20ea5a21bae5f 100644 --- a/lib/config/fileconf.go +++ b/lib/config/fileconf.go @@ -30,8 +30,11 @@ import ( "strings" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" "golang.org/x/crypto/acme" "golang.org/x/crypto/ssh" + "gopkg.in/yaml.v2" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" @@ -49,10 +52,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/sshutils/x11" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" - "gopkg.in/yaml.v2" ) // FileConfig structre represents the teleport configuration stored in a config file diff --git a/lib/config/openssh/openssh.go b/lib/config/openssh/openssh.go index 2a1d52fabbbb4..77bd619bcbe7d 100644 --- a/lib/config/openssh/openssh.go +++ b/lib/config/openssh/openssh.go @@ -27,10 +27,11 @@ import ( "text/template" "github.com/coreos/go-semver/semver" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/utils" ) // TODO(jakule): remove PubkeyAcceptedKeyTypes once we finish deprecating SHA1. diff --git a/lib/config/openssh/openssh_test.go b/lib/config/openssh/openssh_test.go index 40a53bea55e1e..fc611dbe2a1d2 100644 --- a/lib/config/openssh/openssh_test.go +++ b/lib/config/openssh/openssh_test.go @@ -23,9 +23,10 @@ import ( "testing" "github.com/coreos/go-semver/semver" - "github.com/gravitational/teleport/lib/utils/golden" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils/golden" ) func TestParseSSHVersion(t *testing.T) { diff --git a/lib/config/systemd_test.go b/lib/config/systemd_test.go index d28aa0db65f04..3225ff23e0999 100644 --- a/lib/config/systemd_test.go +++ b/lib/config/systemd_test.go @@ -20,8 +20,9 @@ import ( "bytes" "testing" - "github.com/gravitational/teleport/lib/utils/golden" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils/golden" ) func TestWriteSystemdUnitFile(t *testing.T) { diff --git a/lib/configurators/databases/aws.go b/lib/configurators/databases/aws.go index ca0be4aece319..8f28da5ce592b 100644 --- a/lib/configurators/databases/aws.go +++ b/lib/configurators/databases/aws.go @@ -19,13 +19,6 @@ import ( "fmt" "strings" - awsutils "github.com/gravitational/teleport/api/utils/aws" - awslib "github.com/gravitational/teleport/lib/cloud/aws" - "github.com/gravitational/teleport/lib/config" - "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/teleport/lib/srv/db/secrets" - "github.com/gravitational/trace" - "github.com/aws/aws-sdk-go/aws/arn" awssession "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/iam" @@ -33,6 +26,13 @@ import ( "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/sts" "github.com/aws/aws-sdk-go/service/sts/stsiface" + "github.com/gravitational/trace" + + awsutils "github.com/gravitational/teleport/api/utils/aws" + awslib "github.com/gravitational/teleport/lib/cloud/aws" + "github.com/gravitational/teleport/lib/config" + "github.com/gravitational/teleport/lib/services" + "github.com/gravitational/teleport/lib/srv/db/secrets" ) const ( diff --git a/lib/configurators/databases/aws_test.go b/lib/configurators/databases/aws_test.go index 0b7718d131b5f..7109fa29fa781 100644 --- a/lib/configurators/databases/aws_test.go +++ b/lib/configurators/databases/aws_test.go @@ -25,12 +25,12 @@ import ( "github.com/aws/aws-sdk-go/service/sts" "github.com/aws/aws-sdk-go/service/sts/stsiface" "github.com/google/go-cmp/cmp" + "github.com/gravitational/trace" "github.com/stretchr/testify/require" "github.com/gravitational/teleport/api/types" awslib "github.com/gravitational/teleport/lib/cloud/aws" "github.com/gravitational/teleport/lib/config" - "github.com/gravitational/trace" ) func TestAWSIAMDocuments(t *testing.T) { diff --git a/lib/defaults/defaults.go b/lib/defaults/defaults.go index 59e3ae2facef9..1cd3ae000accb 100644 --- a/lib/defaults/defaults.go +++ b/lib/defaults/defaults.go @@ -25,16 +25,15 @@ import ( "strings" "time" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" + "gopkg.in/square/go-jose.v2" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/defaults" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/limiter" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "gopkg.in/square/go-jose.v2" ) // Default port numbers used by all teleport tools diff --git a/lib/events/api.go b/lib/events/api.go index 199d95f1602c4..2635eea5d709c 100644 --- a/lib/events/api.go +++ b/lib/events/api.go @@ -23,12 +23,12 @@ import ( "math" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) const ( diff --git a/lib/events/auditlog_test.go b/lib/events/auditlog_test.go index 72246ecf0fc31..c8c957f8ba291 100644 --- a/lib/events/auditlog_test.go +++ b/lib/events/auditlog_test.go @@ -26,15 +26,15 @@ import ( "testing" "time" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/events/eventstest" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/lib/events/auditwriter.go b/lib/events/auditwriter.go index 7e65a4454d371..ecf0116b248ea 100644 --- a/lib/events/auditwriter.go +++ b/lib/events/auditwriter.go @@ -23,17 +23,16 @@ import ( "sync/atomic" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + logrus "github.com/sirupsen/logrus" + apidefaults "github.com/gravitational/teleport/api/defaults" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - - logrus "github.com/sirupsen/logrus" ) // NewAuditWriter returns a new instance of session writer diff --git a/lib/events/auditwriter_test.go b/lib/events/auditwriter_test.go index 7494bbe08c716..6bbea834e802c 100644 --- a/lib/events/auditwriter_test.go +++ b/lib/events/auditwriter_test.go @@ -27,13 +27,12 @@ import ( "time" "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" apidefaults "github.com/gravitational/teleport/api/defaults" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/session" - - log "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) // TestAuditWriter tests audit writer - a component used for diff --git a/lib/events/complete.go b/lib/events/complete.go index 5be17fa5b7f16..2aab8a5cf2cb5 100644 --- a/lib/events/complete.go +++ b/lib/events/complete.go @@ -21,6 +21,11 @@ import ( "fmt" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types/events" apiutils "github.com/gravitational/teleport/api/utils" @@ -29,12 +34,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/interval" - - "github.com/gravitational/trace" - - "github.com/google/uuid" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) // UploadCompleterConfig specifies configuration for the uploader diff --git a/lib/events/discard.go b/lib/events/discard.go index 7f7432c270c3e..80c7784a57348 100644 --- a/lib/events/discard.go +++ b/lib/events/discard.go @@ -20,10 +20,11 @@ import ( "context" "time" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/session" - log "github.com/sirupsen/logrus" ) // DiscardAuditLog is do-nothing, discard-everything implementation diff --git a/lib/events/dynamic.go b/lib/events/dynamic.go index bb0f2b9c0910f..59af780cf3fae 100644 --- a/lib/events/dynamic.go +++ b/lib/events/dynamic.go @@ -17,14 +17,14 @@ limitations under the License. package events import ( + "encoding/json" + "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/types/events" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/utils" - - "encoding/json" ) // FromEventFields converts from the typed dynamic representation diff --git a/lib/events/dynamic_test.go b/lib/events/dynamic_test.go index e0cee4741eead..01c964ea14944 100644 --- a/lib/events/dynamic_test.go +++ b/lib/events/dynamic_test.go @@ -19,8 +19,9 @@ package events import ( "testing" - "github.com/gravitational/teleport/api/types/events" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types/events" ) // TestDynamicTypeUnknown checks that we correctly translate unknown events strings into the correct proto type. diff --git a/lib/events/dynamoevents/dynamoevents.go b/lib/events/dynamoevents/dynamoevents.go index 10782780f6205..21c8e776dff9f 100644 --- a/lib/events/dynamoevents/dynamoevents.go +++ b/lib/events/dynamoevents/dynamoevents.go @@ -30,20 +30,9 @@ import ( "strings" "time" - "github.com/aws/aws-sdk-go/aws/request" - - "github.com/gravitational/teleport" - apidefaults "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/types" - apievents "github.com/gravitational/teleport/api/types/events" - "github.com/gravitational/teleport/lib/backend/dynamo" - "github.com/gravitational/teleport/lib/events" - dynamometrics "github.com/gravitational/teleport/lib/observability/metrics/dynamo" - "github.com/gravitational/teleport/lib/session" - "github.com/gravitational/teleport/lib/utils" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" awssession "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/applicationautoscaling" "github.com/aws/aws-sdk-go/service/dynamodb" @@ -53,6 +42,16 @@ import ( "github.com/gravitational/trace" "github.com/jonboulle/clockwork" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" + apidefaults "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" + apievents "github.com/gravitational/teleport/api/types/events" + "github.com/gravitational/teleport/lib/backend/dynamo" + "github.com/gravitational/teleport/lib/events" + dynamometrics "github.com/gravitational/teleport/lib/observability/metrics/dynamo" + "github.com/gravitational/teleport/lib/session" + "github.com/gravitational/teleport/lib/utils" ) const ( diff --git a/lib/events/dynamoevents/dynamoevents_test.go b/lib/events/dynamoevents/dynamoevents_test.go index 3680f50e0c1ae..7194f7e1a4664 100644 --- a/lib/events/dynamoevents/dynamoevents_test.go +++ b/lib/events/dynamoevents/dynamoevents_test.go @@ -27,6 +27,10 @@ import ( "testing" "time" + "github.com/google/uuid" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -34,10 +38,6 @@ import ( "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/events/test" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) const dynamoDBLargeQueryRetries int = 10 diff --git a/lib/events/emitter.go b/lib/events/emitter.go index c9ffb33876095..c66424b0a1fae 100644 --- a/lib/events/emitter.go +++ b/lib/events/emitter.go @@ -22,15 +22,15 @@ import ( "io" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) // AsyncEmitterConfig provides parameters for emitter diff --git a/lib/events/emitter_test.go b/lib/events/emitter_test.go index 6289990e97877..07137482dd867 100644 --- a/lib/events/emitter_test.go +++ b/lib/events/emitter_test.go @@ -26,15 +26,15 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/events/eventstest" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/go-cmp/cmp" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) // TestProtoStreamer tests edge cases of proto streamer implementation diff --git a/lib/events/events_test.go b/lib/events/events_test.go index b464d77d8a2cf..73be1f9dc6313 100644 --- a/lib/events/events_test.go +++ b/lib/events/events_test.go @@ -22,9 +22,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" ) // TestJSON tests JSON marshal events diff --git a/lib/events/eventstest/channel.go b/lib/events/eventstest/channel.go index 86090967a7540..ebb2c53221e61 100644 --- a/lib/events/eventstest/channel.go +++ b/lib/events/eventstest/channel.go @@ -19,10 +19,11 @@ package eventstest import ( "context" - "github.com/gravitational/teleport/api/types/events" - "github.com/gravitational/teleport/lib/session" "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types/events" + "github.com/gravitational/teleport/lib/session" ) // ChannelEmitter emits audit events by writing them to a channel. diff --git a/lib/events/fields.go b/lib/events/fields.go index 20e0d3bf15e87..f0a13b13a6950 100644 --- a/lib/events/fields.go +++ b/lib/events/fields.go @@ -17,10 +17,10 @@ limitations under the License. package events import ( + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" - - "github.com/gravitational/trace" ) // ValidateServerMetadata checks that event server ID of the event diff --git a/lib/events/filelog.go b/lib/events/filelog.go index 5d1a1cca9edbf..bc5d21f01fbf3 100644 --- a/lib/events/filelog.go +++ b/lib/events/filelog.go @@ -30,6 +30,10 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -37,10 +41,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) // FileLogConfig is a configuration for file log diff --git a/lib/events/filelog_test.go b/lib/events/filelog_test.go index 5e3915bd82022..5d6c6bc43ea25 100644 --- a/lib/events/filelog_test.go +++ b/lib/events/filelog_test.go @@ -23,12 +23,12 @@ import ( "testing" "time" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/types/events" - - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) func TestFileLogPagination(t *testing.T) { diff --git a/lib/events/filesessions/fileasync.go b/lib/events/filesessions/fileasync.go index ff7e9abe9d221..42629d8120c8e 100644 --- a/lib/events/filesessions/fileasync.go +++ b/lib/events/filesessions/fileasync.go @@ -25,6 +25,10 @@ import ( "path/filepath" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" apievents "github.com/gravitational/teleport/api/types/events" @@ -33,10 +37,6 @@ import ( "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) // UploaderConfig sets up configuration for uploader service diff --git a/lib/events/filesessions/fileasync_chaos_test.go b/lib/events/filesessions/fileasync_chaos_test.go index 641df7a7006d9..a515da0b3ba70 100644 --- a/lib/events/filesessions/fileasync_chaos_test.go +++ b/lib/events/filesessions/fileasync_chaos_test.go @@ -29,6 +29,7 @@ import ( "testing" "time" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" @@ -36,8 +37,6 @@ import ( apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/session" - - "github.com/gravitational/trace" ) // TestChaosUpload introduces failures in all stages of the async diff --git a/lib/events/filesessions/fileasync_test.go b/lib/events/filesessions/fileasync_test.go index 796a55f6b105f..d7d527579e505 100644 --- a/lib/events/filesessions/fileasync_test.go +++ b/lib/events/filesessions/fileasync_test.go @@ -26,6 +26,7 @@ import ( "testing" "time" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" @@ -33,8 +34,6 @@ import ( apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/session" - - "github.com/gravitational/trace" ) // TestUploadOK tests async file uploads scenarios diff --git a/lib/events/filesessions/filestream.go b/lib/events/filesessions/filestream.go index 8011d8887f552..84d91e7f3680a 100644 --- a/lib/events/filesessions/filestream.go +++ b/lib/events/filesessions/filestream.go @@ -27,13 +27,13 @@ import ( "strings" "sync" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" ) var ( diff --git a/lib/events/filesessions/filestream_test.go b/lib/events/filesessions/filestream_test.go index 34cbe7fd7a8ae..848712d9669d8 100644 --- a/lib/events/filesessions/filestream_test.go +++ b/lib/events/filesessions/filestream_test.go @@ -21,10 +21,10 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/session" - - "github.com/stretchr/testify/require" ) func TestReserveUploadPart(t *testing.T) { diff --git a/lib/events/filesessions/fileuploader.go b/lib/events/filesessions/fileuploader.go index ed05e114fe7be..c380b1858ce8d 100644 --- a/lib/events/filesessions/fileuploader.go +++ b/lib/events/filesessions/fileuploader.go @@ -24,13 +24,13 @@ import ( "path/filepath" "strings" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) // Config is a file uploader configuration diff --git a/lib/events/filesessions/fileuploader_test.go b/lib/events/filesessions/fileuploader_test.go index 1ae1339cff82c..e691e05e7e644 100644 --- a/lib/events/filesessions/fileuploader_test.go +++ b/lib/events/filesessions/fileuploader_test.go @@ -23,12 +23,12 @@ import ( "sync/atomic" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/events/test" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/lib/events/fips.go b/lib/events/fips.go index fe16222a1ee44..e8a2952ad6755 100644 --- a/lib/events/fips.go +++ b/lib/events/fips.go @@ -15,9 +15,9 @@ package events import ( - "github.com/gravitational/teleport/api/types" - "github.com/aws/aws-sdk-go/aws/endpoints" + + "github.com/gravitational/teleport/api/types" ) const ( diff --git a/lib/events/firestoreevents/firestoreevents.go b/lib/events/firestoreevents/firestoreevents.go index 8317e3270cfa1..ff9ff7e2adc6e 100644 --- a/lib/events/firestoreevents/firestoreevents.go +++ b/lib/events/firestoreevents/firestoreevents.go @@ -23,32 +23,28 @@ import ( "strings" "time" + "cloud.google.com/go/firestore" + apiv1 "cloud.google.com/go/firestore/apiv1/admin" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" "google.golang.org/genproto/googleapis/firestore/admin/v1" + "github.com/gravitational/teleport" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" + apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/teleport/lib/observability/metrics" - - "github.com/gravitational/teleport" - apidefaults "github.com/gravitational/teleport/api/defaults" - apiutils "github.com/gravitational/teleport/api/utils" firestorebk "github.com/gravitational/teleport/lib/backend/firestore" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/events" + "github.com/gravitational/teleport/lib/observability/metrics" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "cloud.google.com/go/firestore" - - apiv1 "cloud.google.com/go/firestore/apiv1/admin" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) var ( diff --git a/lib/events/gcssessions/gcshandler.go b/lib/events/gcssessions/gcshandler.go index 60389331afe5c..a60cb7ca7d0a2 100644 --- a/lib/events/gcssessions/gcshandler.go +++ b/lib/events/gcssessions/gcshandler.go @@ -25,19 +25,17 @@ import ( "strings" "time" + "cloud.google.com/go/storage" "github.com/gravitational/trace" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" + "google.golang.org/api/option" + "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/observability/metrics" "github.com/gravitational/teleport/lib/session" - - "cloud.google.com/go/storage" - "github.com/prometheus/client_golang/prometheus" - "google.golang.org/api/option" - "google.golang.org/grpc" - - log "github.com/sirupsen/logrus" ) var ( diff --git a/lib/events/gcssessions/gcshandler_test.go b/lib/events/gcssessions/gcshandler_test.go index 6953c8663f36b..919d9fe01ed54 100644 --- a/lib/events/gcssessions/gcshandler_test.go +++ b/lib/events/gcssessions/gcshandler_test.go @@ -20,12 +20,12 @@ import ( "os" "testing" - "github.com/gravitational/teleport/lib/events/test" - "github.com/gravitational/teleport/lib/utils" - "github.com/fsouza/fake-gcs-server/fakestorage" "github.com/google/uuid" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/events/test" + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/events/gcssessions/gcsstream.go b/lib/events/gcssessions/gcsstream.go index f80a8429e81bf..a807c32069956 100644 --- a/lib/events/gcssessions/gcsstream.go +++ b/lib/events/gcssessions/gcsstream.go @@ -27,15 +27,14 @@ import ( "strings" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/events" - "github.com/gravitational/teleport/lib/session" - "cloud.google.com/go/storage" "github.com/google/uuid" + "github.com/gravitational/trace" "google.golang.org/api/iterator" - "github.com/gravitational/trace" + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/events" + "github.com/gravitational/teleport/lib/session" ) // CreateUpload creates a multipart upload diff --git a/lib/events/gcssessions/gcsstream_test.go b/lib/events/gcssessions/gcsstream_test.go index a2dcf64f8b01b..0d155766fc1cd 100644 --- a/lib/events/gcssessions/gcsstream_test.go +++ b/lib/events/gcssessions/gcsstream_test.go @@ -24,13 +24,12 @@ import ( "sync/atomic" "testing" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/events/test" - "cloud.google.com/go/storage" + "github.com/gravitational/trace" "github.com/stretchr/testify/require" - "github.com/gravitational/trace" + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/events/test" ) func TestUploadFromPath(t *testing.T) { diff --git a/lib/events/generate.go b/lib/events/generate.go index 8b8b20c4476c2..557f630c1ee2b 100644 --- a/lib/events/generate.go +++ b/lib/events/generate.go @@ -21,8 +21,9 @@ import ( "time" "github.com/google/uuid" - apievents "github.com/gravitational/teleport/api/types/events" "github.com/jonboulle/clockwork" + + apievents "github.com/gravitational/teleport/api/types/events" ) // SessionParams specifies optional parameters diff --git a/lib/events/multilog.go b/lib/events/multilog.go index 2acc76ac2c3b4..354b70214302b 100644 --- a/lib/events/multilog.go +++ b/lib/events/multilog.go @@ -20,11 +20,11 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/session" - - "github.com/gravitational/trace" ) // NewMultiLog returns a new instance of a multi logger diff --git a/lib/events/playback.go b/lib/events/playback.go index e1c7ba484cdb4..b1c6685e0e62f 100644 --- a/lib/events/playback.go +++ b/lib/events/playback.go @@ -27,13 +27,13 @@ import ( "os" "path/filepath" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) // Header returns information about playback diff --git a/lib/events/s3sessions/s3handler.go b/lib/events/s3sessions/s3handler.go index 80f66ddc43f16..f6e8f81ea388a 100644 --- a/lib/events/s3sessions/s3handler.go +++ b/lib/events/s3sessions/s3handler.go @@ -27,12 +27,6 @@ import ( "strings" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/events" - s3metrics "github.com/gravitational/teleport/lib/observability/metrics/s3" - "github.com/gravitational/teleport/lib/session" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" @@ -43,6 +37,12 @@ import ( "github.com/aws/aws-sdk-go/service/s3/s3manager/s3manageriface" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/events" + s3metrics "github.com/gravitational/teleport/lib/observability/metrics/s3" + "github.com/gravitational/teleport/lib/session" ) // s3AllowedACL is the set of canned ACLs that S3 accepts diff --git a/lib/events/s3sessions/s3handler_config_test.go b/lib/events/s3sessions/s3handler_config_test.go index 81c67ab9a1e2b..1ea68664275de 100644 --- a/lib/events/s3sessions/s3handler_config_test.go +++ b/lib/events/s3sessions/s3handler_config_test.go @@ -19,10 +19,10 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/lib/events/s3sessions/s3handler_thirdparty_test.go b/lib/events/s3sessions/s3handler_thirdparty_test.go index 3bf1761ae6ca0..d4aba60f10197 100644 --- a/lib/events/s3sessions/s3handler_thirdparty_test.go +++ b/lib/events/s3sessions/s3handler_thirdparty_test.go @@ -23,15 +23,14 @@ import ( "net/http/httptest" "testing" - "github.com/gravitational/teleport/lib/events/test" - "github.com/aws/aws-sdk-go/aws/credentials" "github.com/google/uuid" + "github.com/gravitational/trace" "github.com/johannesboyne/gofakes3" "github.com/johannesboyne/gofakes3/backend/s3mem" "github.com/stretchr/testify/require" - "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/events/test" ) // TestThirdpartyStreams tests various streaming upload scenarios diff --git a/lib/events/s3sessions/s3stream.go b/lib/events/s3sessions/s3stream.go index 1258fa7867cc7..6595d4fff6d43 100644 --- a/lib/events/s3sessions/s3stream.go +++ b/lib/events/s3sessions/s3stream.go @@ -24,15 +24,15 @@ import ( "strings" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/events" - "github.com/gravitational/teleport/lib/session" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/gravitational/trace" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/events" + "github.com/gravitational/teleport/lib/session" ) // CreateUpload creates a multipart upload diff --git a/lib/events/sessionlog.go b/lib/events/sessionlog.go index e6da7c806d5ec..a9a0f15b8b4b9 100644 --- a/lib/events/sessionlog.go +++ b/lib/events/sessionlog.go @@ -23,9 +23,9 @@ import ( "path/filepath" "sync" - "github.com/gravitational/teleport/lib/session" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/session" ) const ( diff --git a/lib/events/sizelimit.go b/lib/events/sizelimit.go index 9fdab06d6995e..2ccea5a1371bb 100644 --- a/lib/events/sizelimit.go +++ b/lib/events/sizelimit.go @@ -17,9 +17,9 @@ limitations under the License. package events import ( - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) // This is the max size of all the events we return when searching for events. diff --git a/lib/events/stream.go b/lib/events/stream.go index a0a59743ce39f..c7cdcdcb68f41 100644 --- a/lib/events/stream.go +++ b/lib/events/stream.go @@ -28,16 +28,16 @@ import ( "sync/atomic" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) const ( diff --git a/lib/events/stream_test.go b/lib/events/stream_test.go index 8e15a6f06541c..a10ad600872a6 100644 --- a/lib/events/stream_test.go +++ b/lib/events/stream_test.go @@ -21,9 +21,9 @@ import ( "time" "github.com/google/uuid" - "github.com/gravitational/teleport/lib/session" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/session" ) // TestStreamerCompleteEmpty makes sure that streamer Complete function diff --git a/lib/events/test/streamsuite.go b/lib/events/test/streamsuite.go index 119d92caa53f1..a9ba3df13d543 100644 --- a/lib/events/test/streamsuite.go +++ b/lib/events/test/streamsuite.go @@ -20,10 +20,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/session" - - "github.com/stretchr/testify/require" ) // StreamParams configures parameters of a stream test suite diff --git a/lib/events/test/suite.go b/lib/events/test/suite.go index 681101d039577..9950b5ab70ece 100644 --- a/lib/events/test/suite.go +++ b/lib/events/test/suite.go @@ -25,6 +25,10 @@ import ( "testing" "time" + "github.com/google/uuid" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" @@ -33,10 +37,6 @@ import ( "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/fixtures" "github.com/gravitational/teleport/lib/session" - - "github.com/google/uuid" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) // UploadDownload tests uploads and downloads diff --git a/lib/events/writer.go b/lib/events/writer.go index bb32d210d4f63..829729de6c10f 100644 --- a/lib/events/writer.go +++ b/lib/events/writer.go @@ -21,13 +21,13 @@ import ( "io" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" ) // NewWriterLog returns a new instance of writer log diff --git a/lib/fixtures/keys.go b/lib/fixtures/keys.go index a3f1b833dbe30..b8b6a1a987db2 100644 --- a/lib/fixtures/keys.go +++ b/lib/fixtures/keys.go @@ -20,9 +20,8 @@ import ( "net/http" "strings" - "golang.org/x/net/http2" - "github.com/gravitational/trace" + "golang.org/x/net/http2" ) var PEMBytes = map[string][]byte{ diff --git a/lib/httplib/csrf/csrf.go b/lib/httplib/csrf/csrf.go index fb3906a59da77..1b0f21ed336c3 100644 --- a/lib/httplib/csrf/csrf.go +++ b/lib/httplib/csrf/csrf.go @@ -21,8 +21,9 @@ import ( "encoding/hex" "net/http" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) const ( diff --git a/lib/httplib/grpccreds.go b/lib/httplib/grpccreds.go index 5916d07d522a6..0cbca46dcca36 100644 --- a/lib/httplib/grpccreds.go +++ b/lib/httplib/grpccreds.go @@ -22,9 +22,8 @@ import ( "net" "syscall" - "google.golang.org/grpc/credentials" - "github.com/gravitational/trace" + "google.golang.org/grpc/credentials" ) // TLSCreds is the credentials required for authenticating a connection using TLS. diff --git a/lib/httplib/httplib.go b/lib/httplib/httplib.go index 61e8457d56f9e..be712365a66fc 100644 --- a/lib/httplib/httplib.go +++ b/lib/httplib/httplib.go @@ -28,16 +28,16 @@ import ( "regexp" "strconv" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/observability/tracing" - "github.com/gravitational/teleport/lib/httplib/csrf" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/roundtrip" "github.com/gravitational/trace" "github.com/julienschmidt/httprouter" log "github.com/sirupsen/logrus" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/observability/tracing" + "github.com/gravitational/teleport/lib/httplib/csrf" + "github.com/gravitational/teleport/lib/utils" ) // timeoutMessage is a generic "timeout" error message that is displayed as a more user-friendly alternative to diff --git a/lib/inventory/controller.go b/lib/inventory/controller.go index d574ca9ddb931..8b34151da7f8a 100644 --- a/lib/inventory/controller.go +++ b/lib/inventory/controller.go @@ -20,6 +20,9 @@ import ( "context" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -27,10 +30,6 @@ import ( "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/interval" - - "github.com/gravitational/trace" - - log "github.com/sirupsen/logrus" ) // Auth is an interface representing the subset of the auth API that must be made available diff --git a/lib/inventory/controller_test.go b/lib/inventory/controller_test.go index 92f991a0dc395..e9f38584caf68 100644 --- a/lib/inventory/controller_test.go +++ b/lib/inventory/controller_test.go @@ -22,13 +22,13 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) type fakeAuth struct { diff --git a/lib/inventory/inventory.go b/lib/inventory/inventory.go index 421648ee67872..7b748f7797bf3 100644 --- a/lib/inventory/inventory.go +++ b/lib/inventory/inventory.go @@ -21,14 +21,14 @@ import ( "sync" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) // DownstreamCreateFunc is a function that creates a downstream inventory control stream. diff --git a/lib/inventory/store_test.go b/lib/inventory/store_test.go index 6cead5c54ff80..fdabebf77f794 100644 --- a/lib/inventory/store_test.go +++ b/lib/inventory/store_test.go @@ -21,8 +21,9 @@ import ( "sync" "testing" - "github.com/gravitational/teleport/api/client/proto" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/client/proto" ) /* diff --git a/lib/joinserver/joinserver.go b/lib/joinserver/joinserver.go index 0d26d4b119ac9..e79611a84a244 100644 --- a/lib/joinserver/joinserver.go +++ b/lib/joinserver/joinserver.go @@ -22,13 +22,13 @@ import ( "context" "time" - "github.com/gravitational/teleport/api/client" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" "google.golang.org/grpc/peer" + + "github.com/gravitational/teleport/api/client" + "github.com/gravitational/teleport/api/client/proto" ) const iamJoinRequestTimeout = time.Minute diff --git a/lib/joinserver/joinserver_test.go b/lib/joinserver/joinserver_test.go index 76ae02901ce18..7e9440fb2b3d8 100644 --- a/lib/joinserver/joinserver_test.go +++ b/lib/joinserver/joinserver_test.go @@ -24,16 +24,16 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/client" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/lib/utils" - "github.com/jonboulle/clockwork" - "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/test/bufconn" + + "github.com/gravitational/teleport/api/client" + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/lib/utils" ) type mockJoinServiceClient struct { diff --git a/lib/jwt/jwk.go b/lib/jwt/jwk.go index c5fbdc81520da..4a07fb57eb332 100644 --- a/lib/jwt/jwk.go +++ b/lib/jwt/jwk.go @@ -22,9 +22,10 @@ import ( "encoding/base64" "math/big" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) // JWK is a JSON Web Key, described in detail in RFC 7517. diff --git a/lib/jwt/jwt.go b/lib/jwt/jwt.go index bebdb7a351a12..d8c1471c6a896 100644 --- a/lib/jwt/jwt.go +++ b/lib/jwt/jwt.go @@ -28,17 +28,16 @@ import ( "strings" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/types/wrappers" - "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/ThalesIgnite/crypto11" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "gopkg.in/square/go-jose.v2" "gopkg.in/square/go-jose.v2/cryptosigner" "gopkg.in/square/go-jose.v2/jwt" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/types/wrappers" + "github.com/gravitational/teleport/lib/utils" ) // Config defines the clock and PEM encoded bytes of a public and private diff --git a/lib/jwt/jwt_test.go b/lib/jwt/jwt_test.go index 6e32f50597f11..89201abd91c96 100644 --- a/lib/jwt/jwt_test.go +++ b/lib/jwt/jwt_test.go @@ -20,13 +20,13 @@ import ( "testing" "time" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + josejwt "gopkg.in/square/go-jose.v2/jwt" + "github.com/gravitational/teleport/api/types/wrappers" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - josejwt "gopkg.in/square/go-jose.v2/jwt" - - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) func TestSignAndVerify(t *testing.T) { diff --git a/lib/kube/kubeconfig/kubeconfig.go b/lib/kube/kubeconfig/kubeconfig.go index adc87e4d394bf..740ceab08bdcb 100644 --- a/lib/kube/kubeconfig/kubeconfig.go +++ b/lib/kube/kubeconfig/kubeconfig.go @@ -22,15 +22,14 @@ import ( "path/filepath" "strings" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/client" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/client" + "github.com/gravitational/teleport/lib/utils" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/lib/kube/kubeconfig/kubeconfig_test.go b/lib/kube/kubeconfig/kubeconfig_test.go index 9b99a38a80198..38a4b12f4a924 100644 --- a/lib/kube/kubeconfig/kubeconfig_test.go +++ b/lib/kube/kubeconfig/kubeconfig_test.go @@ -22,19 +22,18 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/auth/testauthority" - "github.com/gravitational/teleport/lib/client" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/auth/testauthority" + "github.com/gravitational/teleport/lib/client" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/tlsca" ) func setup(t *testing.T) (string, clientcmdapi.Config) { diff --git a/lib/kube/proxy/auth.go b/lib/kube/proxy/auth.go index 2342426767ebe..45c537954c7d4 100644 --- a/lib/kube/proxy/auth.go +++ b/lib/kube/proxy/auth.go @@ -14,23 +14,19 @@ package proxy +//nolint:goimports import ( "context" "fmt" "net" "net/url" - "github.com/gravitational/teleport/api/types" - kubeutils "github.com/gravitational/teleport/lib/kube/utils" "github.com/gravitational/trace" - "github.com/sirupsen/logrus" authzapi "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" authztypes "k8s.io/client-go/kubernetes/typed/authorization/v1" - "k8s.io/client-go/rest" - // Load kubeconfig auth plugins for gcp and azure. // Without this, users can't provide a kubeconfig using those. // @@ -38,6 +34,10 @@ import ( // support for popular hosting providers and minimizing attack surface. _ "k8s.io/client-go/plugin/pkg/client/auth/azure" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + "k8s.io/client-go/rest" + + "github.com/gravitational/teleport/api/types" + kubeutils "github.com/gravitational/teleport/lib/kube/utils" ) // ImpersonationPermissionsChecker describes a function that can be used to check diff --git a/lib/kube/proxy/auth_test.go b/lib/kube/proxy/auth_test.go index 4542dd761d20f..53d58fc1f6ae6 100644 --- a/lib/kube/proxy/auth_test.go +++ b/lib/kube/proxy/auth_test.go @@ -22,17 +22,16 @@ import ( "os" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/utils" - + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" authzapi "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" authztypes "k8s.io/client-go/kubernetes/typed/authorization/v1" "k8s.io/client-go/transport" - "github.com/google/go-cmp/cmp" - "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/utils" ) func TestCheckImpersonationPermissions(t *testing.T) { diff --git a/lib/kube/proxy/cluster_details.go b/lib/kube/proxy/cluster_details.go index 76c0031cd2e02..68fd250f1155f 100644 --- a/lib/kube/proxy/cluster_details.go +++ b/lib/kube/proxy/cluster_details.go @@ -23,14 +23,15 @@ import ( "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/sts" "github.com/aws/aws-sdk-go/service/sts/stsiface" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/cloud" - "github.com/gravitational/teleport/lib/cloud/azure" - "github.com/gravitational/teleport/lib/labels" "github.com/gravitational/trace" "github.com/sirupsen/logrus" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/cloud" + "github.com/gravitational/teleport/lib/cloud/azure" + "github.com/gravitational/teleport/lib/labels" ) // kubeDetails contain the cluster-related details including authentication. diff --git a/lib/kube/proxy/exec_test.go b/lib/kube/proxy/exec_test.go index 172a02282a43c..d536aaa6aef85 100644 --- a/lib/kube/proxy/exec_test.go +++ b/lib/kube/proxy/exec_test.go @@ -25,14 +25,14 @@ import ( "net/url" "testing" - testingkubemock "github.com/gravitational/teleport/lib/kube/proxy/testing/kube_server" - "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" "k8s.io/client-go/tools/remotecommand" "k8s.io/kubectl/pkg/scheme" + + testingkubemock "github.com/gravitational/teleport/lib/kube/proxy/testing/kube_server" ) var ( diff --git a/lib/kube/proxy/forwarder.go b/lib/kube/proxy/forwarder.go index 72338df4bd561..76f89f191457e 100644 --- a/lib/kube/proxy/forwarder.go +++ b/lib/kube/proxy/forwarder.go @@ -35,6 +35,26 @@ import ( "sync" "time" + "github.com/google/uuid" + "github.com/gorilla/websocket" + "github.com/gravitational/oxy/forward" + fwdutils "github.com/gravitational/oxy/utils" + "github.com/gravitational/trace" + "github.com/gravitational/ttlmap" + "github.com/jonboulle/clockwork" + "github.com/julienschmidt/httprouter" + "github.com/sirupsen/logrus" + "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + "golang.org/x/crypto/ssh" + "golang.org/x/net/http2" + kubeerrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/httpstream" + "k8s.io/client-go/tools/remotecommand" + "k8s.io/client-go/transport/spdy" + kubeexec "k8s.io/client-go/util/exec" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -56,26 +76,6 @@ import ( "github.com/gravitational/teleport/lib/srv" "github.com/gravitational/teleport/lib/sshca" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gorilla/websocket" - "github.com/gravitational/oxy/forward" - fwdutils "github.com/gravitational/oxy/utils" - "github.com/gravitational/trace" - "github.com/gravitational/ttlmap" - "github.com/jonboulle/clockwork" - "github.com/julienschmidt/httprouter" - "github.com/sirupsen/logrus" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" - "golang.org/x/crypto/ssh" - "golang.org/x/net/http2" - kubeerrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/httpstream" - "k8s.io/client-go/tools/remotecommand" - "k8s.io/client-go/transport/spdy" - kubeexec "k8s.io/client-go/util/exec" ) // KubeServiceType specifies a Teleport service type which can forward Kubernetes requests diff --git a/lib/kube/proxy/forwarder_test.go b/lib/kube/proxy/forwarder_test.go index c6fc3149c58fe..4d3d4818daf55 100644 --- a/lib/kube/proxy/forwarder_test.go +++ b/lib/kube/proxy/forwarder_test.go @@ -32,6 +32,16 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/gravitational/trace" + "github.com/gravitational/ttlmap" + "github.com/jonboulle/clockwork" + "github.com/julienschmidt/httprouter" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "k8s.io/client-go/transport" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" @@ -44,18 +54,6 @@ import ( "github.com/gravitational/teleport/lib/services/local" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/gravitational/ttlmap" - - "k8s.io/client-go/transport" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/jonboulle/clockwork" - "github.com/julienschmidt/httprouter" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) var ( diff --git a/lib/kube/proxy/kube_creds.go b/lib/kube/proxy/kube_creds.go index 1834060936acf..9ad14433f7b62 100644 --- a/lib/kube/proxy/kube_creds.go +++ b/lib/kube/proxy/kube_creds.go @@ -23,12 +23,13 @@ import ( "sync" "time" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" "github.com/sirupsen/logrus" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/transport" + + "github.com/gravitational/teleport/api/types" ) type kubeCreds interface { diff --git a/lib/kube/proxy/portforward.go b/lib/kube/proxy/portforward.go index fe051e64c5731..ad58f67f4bed7 100644 --- a/lib/kube/proxy/portforward.go +++ b/lib/kube/proxy/portforward.go @@ -26,13 +26,13 @@ import ( "sync" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/events" - "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/util/httpstream" spdystream "k8s.io/apimachinery/pkg/util/httpstream/spdy" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/events" ) // portForwardRequest is a request that specifies port forwarding diff --git a/lib/kube/proxy/remotecommand.go b/lib/kube/proxy/remotecommand.go index e153a2146e5d4..7a9d39855a746 100644 --- a/lib/kube/proxy/remotecommand.go +++ b/lib/kube/proxy/remotecommand.go @@ -25,7 +25,6 @@ import ( "strings" "time" - apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -36,6 +35,8 @@ import ( "k8s.io/apiserver/pkg/util/wsstream" "k8s.io/client-go/tools/remotecommand" utilexec "k8s.io/client-go/util/exec" + + apievents "github.com/gravitational/teleport/api/types/events" ) // remoteCommandRequest is a request to execute a remote command diff --git a/lib/kube/proxy/roundtrip.go b/lib/kube/proxy/roundtrip.go index 3e912a1074e75..20e2b2a277325 100644 --- a/lib/kube/proxy/roundtrip.go +++ b/lib/kube/proxy/roundtrip.go @@ -29,10 +29,8 @@ import ( "strings" "time" - "github.com/gravitational/teleport/lib/utils" - log "github.com/sirupsen/logrus" - "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -41,6 +39,8 @@ import ( streamspdy "k8s.io/apimachinery/pkg/util/httpstream/spdy" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/third_party/forked/golang/netutil" + + "github.com/gravitational/teleport/lib/utils" ) // SpdyRoundTripper knows how to upgrade an HTTP request to one that supports diff --git a/lib/kube/proxy/server.go b/lib/kube/proxy/server.go index 5e0611f3b7b99..8876a21d0bc91 100644 --- a/lib/kube/proxy/server.go +++ b/lib/kube/proxy/server.go @@ -24,6 +24,11 @@ import ( "sort" "sync" + "github.com/gravitational/trace" + logrus "github.com/sirupsen/logrus" + "golang.org/x/exp/maps" + "golang.org/x/net/http2" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -38,12 +43,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - - logrus "github.com/sirupsen/logrus" - "golang.org/x/exp/maps" - "golang.org/x/net/http2" ) // TLSServerConfig is a configuration for TLS server diff --git a/lib/kube/proxy/sess.go b/lib/kube/proxy/sess.go index 6cfd9d4d5a35d..26c1b978ecce1 100644 --- a/lib/kube/proxy/sess.go +++ b/lib/kube/proxy/sess.go @@ -27,6 +27,12 @@ import ( "sync" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + log "github.com/sirupsen/logrus" + "k8s.io/client-go/tools/remotecommand" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" @@ -36,12 +42,6 @@ import ( tsession "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/srv" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" - log "github.com/sirupsen/logrus" - "k8s.io/client-go/tools/remotecommand" ) const sessionRecorderID = "session-recorder" diff --git a/lib/kube/proxy/streamproto/proto.go b/lib/kube/proxy/streamproto/proto.go index 34a7c5c131739..f69cb61846e86 100644 --- a/lib/kube/proxy/streamproto/proto.go +++ b/lib/kube/proxy/streamproto/proto.go @@ -23,11 +23,12 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "k8s.io/client-go/tools/remotecommand" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/utils" ) // metaMessage is a control message containing one or more payloads. diff --git a/lib/kube/proxy/streamproto/proto_test.go b/lib/kube/proxy/streamproto/proto_test.go index c521c94adfa9b..30bc01c6f756b 100644 --- a/lib/kube/proxy/streamproto/proto_test.go +++ b/lib/kube/proxy/streamproto/proto_test.go @@ -25,9 +25,10 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) var upgrader = websocket.Upgrader{} diff --git a/lib/kube/proxy/testing/kube_server/kube_mock.go b/lib/kube/proxy/testing/kube_server/kube_mock.go index db90b78773bbe..6a01562be7e88 100644 --- a/lib/kube/proxy/testing/kube_server/kube_mock.go +++ b/lib/kube/proxy/testing/kube_server/kube_mock.go @@ -28,24 +28,22 @@ import ( "net/http/httptest" "time" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/httplib" - "github.com/gravitational/teleport/lib/utils" - - "golang.org/x/net/http2" - - "k8s.io/apiserver/pkg/util/wsstream" - "k8s.io/client-go/tools/remotecommand" - "github.com/gravitational/trace" "github.com/julienschmidt/httprouter" log "github.com/sirupsen/logrus" + "golang.org/x/net/http2" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/httpstream" spdystream "k8s.io/apimachinery/pkg/util/httpstream/spdy" + "k8s.io/apiserver/pkg/util/wsstream" + "k8s.io/client-go/tools/remotecommand" + + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/httplib" + "github.com/gravitational/teleport/lib/utils" ) const ( diff --git a/lib/kube/proxy/watcher.go b/lib/kube/proxy/watcher.go index 3a6395db42961..8322134481fbf 100644 --- a/lib/kube/proxy/watcher.go +++ b/lib/kube/proxy/watcher.go @@ -21,9 +21,10 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" ) // startReconciler starts reconciler that registers/unregisters proxied diff --git a/lib/kube/proxy/watcher_test.go b/lib/kube/proxy/watcher_test.go index cdb22ed734602..3675ce1e0beb5 100644 --- a/lib/kube/proxy/watcher_test.go +++ b/lib/kube/proxy/watcher_test.go @@ -22,15 +22,15 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - testingkubemock "github.com/gravitational/teleport/lib/kube/proxy/testing/kube_server" - "github.com/gravitational/teleport/lib/services" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/require" + "k8s.io/client-go/tools/clientcmd" + clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + + "github.com/gravitational/teleport/api/types" + testingkubemock "github.com/gravitational/teleport/lib/kube/proxy/testing/kube_server" + "github.com/gravitational/teleport/lib/services" ) // TestWatcher verifies that kubernetes agent properly detects and applies diff --git a/lib/kube/proxy/websocket_client_test.go b/lib/kube/proxy/websocket_client_test.go index 9ecf471e322e5..286d9788bbf79 100644 --- a/lib/kube/proxy/websocket_client_test.go +++ b/lib/kube/proxy/websocket_client_test.go @@ -28,12 +28,13 @@ import ( "sync" gwebsocket "github.com/gorilla/websocket" - testingkubemock "github.com/gravitational/teleport/lib/kube/proxy/testing/kube_server" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/rest" clientremotecommand "k8s.io/client-go/tools/remotecommand" "k8s.io/client-go/transport" + + testingkubemock "github.com/gravitational/teleport/lib/kube/proxy/testing/kube_server" ) var ( diff --git a/lib/kube/utils/utils.go b/lib/kube/utils/utils.go index 72a0d4ad9a68c..c6e3b831e3d7a 100644 --- a/lib/kube/utils/utils.go +++ b/lib/kube/utils/utils.go @@ -20,15 +20,15 @@ import ( "context" "encoding/hex" - "github.com/gravitational/teleport/api/client" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/trace" - "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + + "github.com/gravitational/teleport/api/client" + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" + apiutils "github.com/gravitational/teleport/api/utils" ) // GetKubeClient returns instance of client to the kubernetes cluster diff --git a/lib/kube/utils/utils_test.go b/lib/kube/utils/utils_test.go index 469db847d479f..7bfe9c4456b2a 100644 --- a/lib/kube/utils/utils_test.go +++ b/lib/kube/utils/utils_test.go @@ -20,8 +20,9 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestCheckOrSetKubeCluster(t *testing.T) { diff --git a/lib/labels/cloud_test.go b/lib/labels/cloud_test.go index 853dfc5007a8f..83812de388c9c 100644 --- a/lib/labels/cloud_test.go +++ b/lib/labels/cloud_test.go @@ -20,10 +20,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) type mockIMDSClient struct { diff --git a/lib/labels/labels.go b/lib/labels/labels.go index e93f3ac0560e7..7b0cbe7c5fbe3 100644 --- a/lib/labels/labels.go +++ b/lib/labels/labels.go @@ -25,10 +25,11 @@ import ( "sync" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" ) // DynamicConfig is the configuration for dynamic labels. diff --git a/lib/labels/labels_test.go b/lib/labels/labels_test.go index e3097dd14629d..40702c7c98cdd 100644 --- a/lib/labels/labels_test.go +++ b/lib/labels/labels_test.go @@ -22,11 +22,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/utils" + "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/google/uuid" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/limiter/connlimiter.go b/lib/limiter/connlimiter.go index 4d3a39d9fa589..8b7b6857745d8 100644 --- a/lib/limiter/connlimiter.go +++ b/lib/limiter/connlimiter.go @@ -23,7 +23,6 @@ import ( "github.com/gravitational/oxy/connlimit" "github.com/gravitational/oxy/utils" "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) diff --git a/lib/limiter/limiter.go b/lib/limiter/limiter.go index 75b12d84bde17..b82ddb8793ae5 100644 --- a/lib/limiter/limiter.go +++ b/lib/limiter/limiter.go @@ -25,7 +25,6 @@ import ( "github.com/gravitational/oxy/ratelimit" "github.com/gravitational/trace" - "github.com/mailgun/timetools" "google.golang.org/grpc" "google.golang.org/grpc/peer" diff --git a/lib/limiter/limiter_test.go b/lib/limiter/limiter_test.go index 87704c8ba7788..6e5b97526f568 100644 --- a/lib/limiter/limiter_test.go +++ b/lib/limiter/limiter_test.go @@ -21,14 +21,13 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/oxy/ratelimit" - "github.com/mailgun/timetools" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/peer" + + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/limiter/ratelimiter.go b/lib/limiter/ratelimiter.go index f80a13506c0d9..eb96570fda622 100644 --- a/lib/limiter/ratelimiter.go +++ b/lib/limiter/ratelimiter.go @@ -25,7 +25,6 @@ import ( "github.com/gravitational/oxy/ratelimit" "github.com/gravitational/oxy/utils" "github.com/gravitational/trace" - "github.com/mailgun/timetools" "github.com/mailgun/ttlmap" ) diff --git a/lib/modules/modules.go b/lib/modules/modules.go index 45c34eb56287a..9bc223b37819f 100644 --- a/lib/modules/modules.go +++ b/lib/modules/modules.go @@ -28,13 +28,13 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/keys" - - "github.com/gravitational/trace" ) // Features provides supported and unsupported features diff --git a/lib/modules/modules_test.go b/lib/modules/modules_test.go index 7be23561f7929..9a85406f3b7b1 100644 --- a/lib/modules/modules_test.go +++ b/lib/modules/modules_test.go @@ -20,12 +20,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/modules" - - "github.com/stretchr/testify/require" ) func TestOSSModules(t *testing.T) { diff --git a/lib/multiplexer/multiplexer.go b/lib/multiplexer/multiplexer.go index 3397dfb83dd83..7c044e69fb0a0 100644 --- a/lib/multiplexer/multiplexer.go +++ b/lib/multiplexer/multiplexer.go @@ -31,14 +31,14 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/utils/sshutils" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) // Config is a multiplexer config diff --git a/lib/multiplexer/multiplexer_test.go b/lib/multiplexer/multiplexer_test.go index 769c2fc79bc70..cac6f00d7485d 100644 --- a/lib/multiplexer/multiplexer_test.go +++ b/lib/multiplexer/multiplexer_test.go @@ -35,7 +35,11 @@ import ( "testing" "time" + "github.com/jackc/pgproto3/v2" + "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" "github.com/gravitational/teleport/api/constants" apisshutils "github.com/gravitational/teleport/api/utils/sshutils" @@ -45,12 +49,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - - "github.com/jackc/pgproto3/v2" - "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/lib/multiplexer/testproxy.go b/lib/multiplexer/testproxy.go index f2df2d1e31b66..32763e43a88c3 100644 --- a/lib/multiplexer/testproxy.go +++ b/lib/multiplexer/testproxy.go @@ -20,10 +20,10 @@ import ( "io" "net" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/utils" ) // TestProxy is tcp passthrough proxy that sends a proxy-line when connecting diff --git a/lib/multiplexer/tls.go b/lib/multiplexer/tls.go index bfa13587c3428..3d1d07d48573e 100644 --- a/lib/multiplexer/tls.go +++ b/lib/multiplexer/tls.go @@ -23,14 +23,14 @@ import ( "net" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" log "github.com/sirupsen/logrus" "golang.org/x/net/http2" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/utils" ) // TLSListenerConfig specifies listener configuration diff --git a/lib/observability/tracing/tracing.go b/lib/observability/tracing/tracing.go index e1bd13af4852b..b307f71ea0247 100644 --- a/lib/observability/tracing/tracing.go +++ b/lib/observability/tracing/tracing.go @@ -22,9 +22,6 @@ import ( "strings" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/observability/tracing" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" "go.opentelemetry.io/otel" @@ -34,6 +31,9 @@ import ( sdktrace "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" oteltrace "go.opentelemetry.io/otel/trace" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/observability/tracing" ) const ( diff --git a/lib/pam/pam_test.go b/lib/pam/pam_test.go index f208b4378bc20..bdcadc5e4527e 100644 --- a/lib/pam/pam_test.go +++ b/lib/pam/pam_test.go @@ -25,9 +25,9 @@ import ( "strings" "testing" - "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/proxy/auth.go b/lib/proxy/auth.go index 6e2888fd0f5e0..622258aa2f22a 100644 --- a/lib/proxy/auth.go +++ b/lib/proxy/auth.go @@ -20,12 +20,13 @@ import ( "crypto/x509" "net" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/trace" "github.com/sirupsen/logrus" "google.golang.org/grpc/credentials" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/tlsca" ) // newProxyCredentials creates new proxyCredentials from the given transport credentials. diff --git a/lib/proxy/client.go b/lib/proxy/client.go index 93653339e2e1f..cd83b05a6caf4 100644 --- a/lib/proxy/client.go +++ b/lib/proxy/client.go @@ -22,6 +22,14 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" + "github.com/gravitational/teleport" clientapi "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/metadata" @@ -30,14 +38,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "google.golang.org/grpc" - "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/keepalive" ) // ClientConfig configures a Client instance. diff --git a/lib/proxy/client_test.go b/lib/proxy/client_test.go index 9841fbb811cfe..6253a2c3c8764 100644 --- a/lib/proxy/client_test.go +++ b/lib/proxy/client_test.go @@ -20,12 +20,12 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" + "github.com/stretchr/testify/require" "google.golang.org/grpc/connectivity" - "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" ) // TestClientConn checks the client's connection caching capabilities diff --git a/lib/proxy/clusterdial/dial.go b/lib/proxy/clusterdial/dial.go index 65b9c4cee9267..13822db268f72 100644 --- a/lib/proxy/clusterdial/dial.go +++ b/lib/proxy/clusterdial/dial.go @@ -17,9 +17,10 @@ package clusterdial import ( "net" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/proxy" "github.com/gravitational/teleport/lib/reversetunnel" - "github.com/gravitational/trace" ) // ClusterDialerFunc is a function that implements a proxy.ClusterDialer. diff --git a/lib/proxy/conn.go b/lib/proxy/conn.go index f2e7a87f7419d..1fc1f5d5bc16e 100644 --- a/lib/proxy/conn.go +++ b/lib/proxy/conn.go @@ -21,9 +21,10 @@ import ( "sync" "time" - "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/trace" "google.golang.org/grpc" + + "github.com/gravitational/teleport/api/client/proto" ) const ( diff --git a/lib/proxy/conn_test.go b/lib/proxy/conn_test.go index 0ffec8a853bb4..751e61d1fc968 100644 --- a/lib/proxy/conn_test.go +++ b/lib/proxy/conn_test.go @@ -21,10 +21,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/lib/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/lib/utils" ) type mockStream struct { diff --git a/lib/proxy/helpers_test.go b/lib/proxy/helpers_test.go index 9ff3edc3d1173..afb2d10b43ef8 100644 --- a/lib/proxy/helpers_test.go +++ b/lib/proxy/helpers_test.go @@ -25,17 +25,17 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + clientapi "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/fixtures" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) type mockAuthClient struct { diff --git a/lib/proxy/server.go b/lib/proxy/server.go index 7a4ad87b9279c..0314e2bd57db2 100644 --- a/lib/proxy/server.go +++ b/lib/proxy/server.go @@ -20,17 +20,17 @@ import ( "net" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/metadata" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/keepalive" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/metadata" + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/utils" ) const ( diff --git a/lib/proxy/server_test.go b/lib/proxy/server_test.go index 3ae4d7f877fc0..546f99de288c9 100644 --- a/lib/proxy/server_test.go +++ b/lib/proxy/server_test.go @@ -17,10 +17,10 @@ package proxy import ( "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" - - "github.com/stretchr/testify/require" ) // TestServerTLS ensures that only trusted certificates with the proxy role diff --git a/lib/proxy/service.go b/lib/proxy/service.go index 6d0ccd33448c9..bfbf3d3a68e4d 100644 --- a/lib/proxy/service.go +++ b/lib/proxy/service.go @@ -18,11 +18,12 @@ import ( "net" "strings" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // proxyService implements the grpc ProxyService. diff --git a/lib/proxy/service_test.go b/lib/proxy/service_test.go index 04f6aaf189dba..e6f9b576548c3 100644 --- a/lib/proxy/service_test.go +++ b/lib/proxy/service_test.go @@ -19,14 +19,14 @@ import ( "net" "testing" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" ) type mockClusterDialer struct { diff --git a/lib/restrictedsession/config.go b/lib/restrictedsession/config.go index 446831fd32cd9..57e0b5fd9ae54 100644 --- a/lib/restrictedsession/config.go +++ b/lib/restrictedsession/config.go @@ -19,8 +19,9 @@ package restrictedsession import ( "net" - "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/defaults" ) // Config holds configuration for the RestrictedSession service. diff --git a/lib/reversetunnel/agent.go b/lib/reversetunnel/agent.go index 3005473bea35f..e8604084a2642 100644 --- a/lib/reversetunnel/agent.go +++ b/lib/reversetunnel/agent.go @@ -28,16 +28,16 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/constants" tracessh "github.com/gravitational/teleport/api/observability/tracing/ssh" "github.com/gravitational/teleport/api/utils/sshutils" "github.com/gravitational/teleport/lib/reversetunnel/track" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) type AgentState string diff --git a/lib/reversetunnel/agent_dialer.go b/lib/reversetunnel/agent_dialer.go index c51af9fa92d33..8f031115883d2 100644 --- a/lib/reversetunnel/agent_dialer.go +++ b/lib/reversetunnel/agent_dialer.go @@ -19,6 +19,10 @@ package reversetunnel import ( "context" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + apidefaults "github.com/gravitational/teleport/api/defaults" tracessh "github.com/gravitational/teleport/api/observability/tracing/ssh" "github.com/gravitational/teleport/api/types" @@ -27,10 +31,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/proxy" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) // agentDialer dials an ssh server on behalf of an agent. diff --git a/lib/reversetunnel/agent_dialer_test.go b/lib/reversetunnel/agent_dialer_test.go index b5423eaf857d6..2516f2b072a81 100644 --- a/lib/reversetunnel/agent_dialer_test.go +++ b/lib/reversetunnel/agent_dialer_test.go @@ -22,17 +22,17 @@ import ( "crypto/rsa" "testing" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/types" apisshutils "github.com/gravitational/teleport/api/utils/sshutils" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) // TestAgentCertChecker validates that reverse tunnel agents properly validate diff --git a/lib/reversetunnel/agent_test.go b/lib/reversetunnel/agent_test.go index 4ec54ef890852..506530010cbf0 100644 --- a/lib/reversetunnel/agent_test.go +++ b/lib/reversetunnel/agent_test.go @@ -25,16 +25,16 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" tracessh "github.com/gravitational/teleport/api/observability/tracing/ssh" "github.com/gravitational/teleport/api/utils/sshutils" "github.com/gravitational/teleport/lib/reversetunnel/track" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) type mockSSHClient struct { diff --git a/lib/reversetunnel/agentpool.go b/lib/reversetunnel/agentpool.go index ace75f3aba92b..a5668c8fe24a6 100644 --- a/lib/reversetunnel/agentpool.go +++ b/lib/reversetunnel/agentpool.go @@ -25,6 +25,11 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/webclient" "github.com/gravitational/teleport/api/defaults" @@ -37,11 +42,6 @@ import ( alpncommon "github.com/gravitational/teleport/lib/srv/alpnproxy/common" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/proxy" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) const ( diff --git a/lib/reversetunnel/api_with_roles.go b/lib/reversetunnel/api_with_roles.go index 2442bfcf0d8d9..598df413f7808 100644 --- a/lib/reversetunnel/api_with_roles.go +++ b/lib/reversetunnel/api_with_roles.go @@ -17,12 +17,12 @@ limitations under the License. package reversetunnel import ( + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // ClusterGetter is an interface that defines GetRemoteCluster method diff --git a/lib/reversetunnel/cache.go b/lib/reversetunnel/cache.go index 96b56da963023..1c3bd24e9a974 100644 --- a/lib/reversetunnel/cache.go +++ b/lib/reversetunnel/cache.go @@ -22,6 +22,8 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/gravitational/ttlmap" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/types" @@ -30,9 +32,6 @@ import ( "github.com/gravitational/teleport/lib/auth/native" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/sshca" - - "github.com/gravitational/trace" - "github.com/gravitational/ttlmap" ) type certificateCache struct { diff --git a/lib/reversetunnel/conn.go b/lib/reversetunnel/conn.go index 0826ee9bddcd0..c184c3d5562dd 100644 --- a/lib/reversetunnel/conn.go +++ b/lib/reversetunnel/conn.go @@ -23,13 +23,13 @@ import ( "sync/atomic" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/sshutils" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" ) // connKey is a key used to identify tunnel connections. It contains the UUID diff --git a/lib/reversetunnel/discovery.go b/lib/reversetunnel/discovery.go index b5bd521d7051b..dacd88d2d9519 100644 --- a/lib/reversetunnel/discovery.go +++ b/lib/reversetunnel/discovery.go @@ -21,11 +21,11 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // discoveryRequest is a request sent from a connected proxy with the missing proxies. diff --git a/lib/reversetunnel/fake.go b/lib/reversetunnel/fake.go index 3b359f572d63b..ea9439115ba19 100644 --- a/lib/reversetunnel/fake.go +++ b/lib/reversetunnel/fake.go @@ -21,8 +21,9 @@ import ( "sync" "sync/atomic" - "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/auth" ) // FakeServer is a fake reversetunnel.Server implementation used in tests. diff --git a/lib/reversetunnel/localsite.go b/lib/reversetunnel/localsite.go index de52086017cf9..4457829bb5830 100644 --- a/lib/reversetunnel/localsite.go +++ b/lib/reversetunnel/localsite.go @@ -23,6 +23,13 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "golang.org/x/exp/slices" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -34,13 +41,6 @@ import ( "github.com/gravitational/teleport/lib/srv/forward" "github.com/gravitational/teleport/lib/utils" proxyutils "github.com/gravitational/teleport/lib/utils/proxy" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/prometheus/client_golang/prometheus" - log "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" - "golang.org/x/exp/slices" ) // periodicFunctionInterval is the interval at which periodic stats are calculated. diff --git a/lib/reversetunnel/peer.go b/lib/reversetunnel/peer.go index 1f65b2404e5a0..9c28a1fb37edd 100644 --- a/lib/reversetunnel/peer.go +++ b/lib/reversetunnel/peer.go @@ -22,14 +22,14 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) func newClusterPeers(clusterName string) *clusterPeers { diff --git a/lib/reversetunnel/rc_manager_test.go b/lib/reversetunnel/rc_manager_test.go index 0c310def92466..b3845b75330bd 100644 --- a/lib/reversetunnel/rc_manager_test.go +++ b/lib/reversetunnel/rc_manager_test.go @@ -19,14 +19,14 @@ import ( "errors" "testing" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/stretchr/testify/require" ) func TestRemoteClusterTunnelManagerSync(t *testing.T) { diff --git a/lib/reversetunnel/remotesite_test.go b/lib/reversetunnel/remotesite_test.go index 44c90725b455d..56f1c13999c9d 100644 --- a/lib/reversetunnel/remotesite_test.go +++ b/lib/reversetunnel/remotesite_test.go @@ -21,10 +21,11 @@ package reversetunnel import ( "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/utils" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/utils" ) func Test_remoteSite_getLocalWatchedCerts(t *testing.T) { diff --git a/lib/reversetunnel/srv.go b/lib/reversetunnel/srv.go index fe5f46e686618..01f3bd8232ad1 100644 --- a/lib/reversetunnel/srv.go +++ b/lib/reversetunnel/srv.go @@ -26,6 +26,12 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" "github.com/gravitational/teleport/api/constants" @@ -42,12 +48,6 @@ import ( "github.com/gravitational/teleport/lib/sshca" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/prometheus/client_golang/prometheus" - log "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) var ( diff --git a/lib/reversetunnel/srv_test.go b/lib/reversetunnel/srv_test.go index 5936c9b78e336..08e872bfd8fac 100644 --- a/lib/reversetunnel/srv_test.go +++ b/lib/reversetunnel/srv_test.go @@ -23,16 +23,16 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/auth/testauthority" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/go-cmp/cmp" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) func TestServerKeyAuth(t *testing.T) { diff --git a/lib/reversetunnel/track/tracker.go b/lib/reversetunnel/track/tracker.go index 1a9e3145868f1..c562155ebeb57 100644 --- a/lib/reversetunnel/track/tracker.go +++ b/lib/reversetunnel/track/tracker.go @@ -22,8 +22,9 @@ import ( "sync" "time" - "github.com/gravitational/teleport/lib/utils/workpool" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils/workpool" ) type Lease = workpool.Lease diff --git a/lib/reversetunnel/transport.go b/lib/reversetunnel/transport.go index 8f3e994a477b0..dd83ae3818b49 100644 --- a/lib/reversetunnel/transport.go +++ b/lib/reversetunnel/transport.go @@ -25,6 +25,8 @@ import ( "net" "time" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -36,10 +38,6 @@ import ( alpncommon "github.com/gravitational/teleport/lib/srv/alpnproxy/common" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/proxy" - - "github.com/gravitational/trace" - - "github.com/sirupsen/logrus" ) // NewTunnelAuthDialer creates a new instance of TunnelAuthDialer diff --git a/lib/secret/secret_test.go b/lib/secret/secret_test.go index a499366e08a4f..6d427db9c0d33 100644 --- a/lib/secret/secret_test.go +++ b/lib/secret/secret_test.go @@ -22,8 +22,9 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/gravitational/teleport/lib/utils" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/service/acme.go b/lib/service/acme.go index 1eac1c35f3a95..6cc280d0dd28b 100644 --- a/lib/service/acme.go +++ b/lib/service/acme.go @@ -21,12 +21,12 @@ import ( "net" "strings" + "github.com/gravitational/trace" + apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/web/app" - - "github.com/gravitational/trace" ) type hostPolicyCheckerConfig struct { diff --git a/lib/service/cfg.go b/lib/service/cfg.go index 024f380455bfa..81c7494672b96 100644 --- a/lib/service/cfg.go +++ b/lib/service/cfg.go @@ -31,6 +31,16 @@ import ( "strings" "time" + "github.com/ghodss/yaml" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "go.mongodb.org/mongo-driver/mongo/readpref" + "go.mongodb.org/mongo-driver/x/mongo/driver/connstring" + "go.opentelemetry.io/otel/attribute" + "golang.org/x/crypto/ssh" + "golang.org/x/net/http/httpguts" + "k8s.io/apimachinery/pkg/util/validation" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" "github.com/gravitational/teleport/api/types" @@ -56,16 +66,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils/x11" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/ghodss/yaml" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "go.mongodb.org/mongo-driver/mongo/readpref" - "go.mongodb.org/mongo-driver/x/mongo/driver/connstring" - "go.opentelemetry.io/otel/attribute" - "golang.org/x/crypto/ssh" - "golang.org/x/net/http/httpguts" - "k8s.io/apimachinery/pkg/util/validation" ) // Rate describes a rate ratio, i.e. the number of "events" that happen over diff --git a/lib/service/cfg_test.go b/lib/service/cfg_test.go index d667c714e4d83..309f75f26c89b 100644 --- a/lib/service/cfg_test.go +++ b/lib/service/cfg_test.go @@ -22,13 +22,13 @@ import ( "regexp" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/backend/lite" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/fixtures" "github.com/gravitational/teleport/lib/srv/app/common" "github.com/gravitational/teleport/lib/utils" - - "github.com/stretchr/testify/require" ) func TestDefaultConfig(t *testing.T) { diff --git a/lib/service/discovery.go b/lib/service/discovery.go index 9e5185865373f..78dfaf6e738d8 100644 --- a/lib/service/discovery.go +++ b/lib/service/discovery.go @@ -17,11 +17,12 @@ limitations under the License. package service import ( + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/cloud" "github.com/gravitational/teleport/lib/srv/discovery" - "github.com/gravitational/trace" ) func (process *TeleportProcess) shouldInitDiscovery() bool { diff --git a/lib/service/service_test.go b/lib/service/service_test.go index b71819fe28a0d..e6dd3a84a6dd6 100644 --- a/lib/service/service_test.go +++ b/lib/service/service_test.go @@ -31,6 +31,12 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" "github.com/gravitational/teleport/api/types" @@ -42,11 +48,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) func TestMain(m *testing.M) { diff --git a/lib/service/validateconfig.go b/lib/service/validateconfig.go index 72693eb271f88..20b5730536775 100644 --- a/lib/service/validateconfig.go +++ b/lib/service/validateconfig.go @@ -19,13 +19,13 @@ package service import ( "io" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" - - "github.com/sirupsen/logrus" ) func validateConfig(cfg *Config) error { diff --git a/lib/service/validateconfig_test.go b/lib/service/validateconfig_test.go index 24180a0985241..0a7f1b8cc9621 100644 --- a/lib/service/validateconfig_test.go +++ b/lib/service/validateconfig_test.go @@ -24,10 +24,10 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - - "github.com/stretchr/testify/require" ) func TestValidateConfig(t *testing.T) { diff --git a/lib/services/access_request.go b/lib/services/access_request.go index 6211f4d2dd189..7c391370b8d30 100644 --- a/lib/services/access_request.go +++ b/lib/services/access_request.go @@ -24,6 +24,9 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/vulcand/predicate" "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -31,10 +34,6 @@ import ( apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/parse" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/vulcand/predicate" ) const maxAccessRequestReasonSize = 4096 diff --git a/lib/services/access_request_test.go b/lib/services/access_request_test.go index dfd6db7fdc318..b6e4d10c68ee3 100644 --- a/lib/services/access_request_test.go +++ b/lib/services/access_request_test.go @@ -21,14 +21,14 @@ import ( "strings" "testing" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/fixtures" - "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/fixtures" ) // mockGetter mocks the UserAndRoleGetter interface. diff --git a/lib/services/app.go b/lib/services/app.go index 3da13fb68a17d..d38921ed08c71 100644 --- a/lib/services/app.go +++ b/lib/services/app.go @@ -19,10 +19,10 @@ package services import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // AppGetter defines interface for fetching application resources. diff --git a/lib/services/app_test.go b/lib/services/app_test.go index beaeb89b303d5..8a5e80e43019a 100644 --- a/lib/services/app_test.go +++ b/lib/services/app_test.go @@ -19,10 +19,10 @@ package services import ( "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/stretchr/testify/require" ) // TestApplicationUnmarshal verifies an app resource can be unmarshaled. diff --git a/lib/services/audit.go b/lib/services/audit.go index d5e6a6e0217df..5549b1c82ee6b 100644 --- a/lib/services/audit.go +++ b/lib/services/audit.go @@ -17,10 +17,11 @@ limitations under the License. package services import ( + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) // ClusterAuditConfigSpecFromObject returns audit config spec from object. diff --git a/lib/services/authentication.go b/lib/services/authentication.go index 2136512a8b7dc..fdb007e6bcea9 100644 --- a/lib/services/authentication.go +++ b/lib/services/authentication.go @@ -22,12 +22,12 @@ import ( "encoding/json" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/utils" - "github.com/google/uuid" "github.com/gravitational/trace" "golang.org/x/crypto/bcrypt" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/utils" ) // ValidateLocalAuthSecrets validates local auth secret members. diff --git a/lib/services/authentication_test.go b/lib/services/authentication_test.go index 4a41dd3816d1e..d947242a5a35c 100644 --- a/lib/services/authentication_test.go +++ b/lib/services/authentication_test.go @@ -18,10 +18,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" ) func TestValidateLocalAuthSecrets_deviceTypes(t *testing.T) { diff --git a/lib/services/clustername.go b/lib/services/clustername.go index 77641da063394..bf773fad1f7f2 100644 --- a/lib/services/clustername.go +++ b/lib/services/clustername.go @@ -17,12 +17,11 @@ limitations under the License. package services import ( + "github.com/google/uuid" "github.com/gravitational/trace" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" ) // NewClusterNameWithRandomID creates a ClusterName, supplying a random diff --git a/lib/services/compare.go b/lib/services/compare.go index 79bef70b22af6..97f794fc4a556 100644 --- a/lib/services/compare.go +++ b/lib/services/compare.go @@ -17,10 +17,10 @@ limitations under the License. package services import ( - "github.com/gravitational/teleport/api/types" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + + "github.com/gravitational/teleport/api/types" ) // CompareResources compares two resources by all significant fields. diff --git a/lib/services/connection_diagnostic.go b/lib/services/connection_diagnostic.go index 72d349925921d..a8e15ba4492d8 100644 --- a/lib/services/connection_diagnostic.go +++ b/lib/services/connection_diagnostic.go @@ -19,9 +19,10 @@ package services import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) // ConnectionsDiagnostic defines an interface for managing Connection Diagnostics. diff --git a/lib/services/database.go b/lib/services/database.go index 3e26034c213f1..831375defb4c3 100644 --- a/lib/services/database.go +++ b/lib/services/database.go @@ -31,6 +31,7 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/redshift" "github.com/coreos/go-semver/semver" + "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/types" @@ -39,7 +40,6 @@ import ( "github.com/gravitational/teleport/lib/cloud/azure" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) // DatabaseGetter defines interface for fetching database resources. diff --git a/lib/services/database_test.go b/lib/services/database_test.go index 6607db1a96d72..7ca2f6700db55 100644 --- a/lib/services/database_test.go +++ b/lib/services/database_test.go @@ -32,6 +32,7 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/redshift" "github.com/google/uuid" + "github.com/gravitational/trace" "github.com/stretchr/testify/require" "github.com/gravitational/teleport/api/types" @@ -41,7 +42,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/fixtures" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) // TestDatabaseUnmarshal verifies a database resource can be unmarshaled. diff --git a/lib/services/fanout.go b/lib/services/fanout.go index 4ffcc7becd1ea..aa1f727e52957 100644 --- a/lib/services/fanout.go +++ b/lib/services/fanout.go @@ -21,9 +21,9 @@ import ( "sync" "sync/atomic" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/types" ) const defaultQueueSize = 64 diff --git a/lib/services/fanout_test.go b/lib/services/fanout_test.go index 4c774ad5d7d24..4f498e4863c9e 100644 --- a/lib/services/fanout_test.go +++ b/lib/services/fanout_test.go @@ -22,8 +22,9 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) // TestFanoutWatcherClose tests fanout watcher close diff --git a/lib/services/github_test.go b/lib/services/github_test.go index 13e96322d89a9..e18b6d19d63de 100644 --- a/lib/services/github_test.go +++ b/lib/services/github_test.go @@ -19,10 +19,10 @@ package services import ( "testing" - "github.com/gravitational/teleport/api/types" - "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestUnmarshal(t *testing.T) { diff --git a/lib/services/identity.go b/lib/services/identity.go index 96bb46bf11385..9bdd4111de03a 100644 --- a/lib/services/identity.go +++ b/lib/services/identity.go @@ -25,13 +25,13 @@ import ( "crypto" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" wantypes "github.com/gravitational/teleport/api/types/webauthn" "github.com/gravitational/teleport/api/utils/keys" "github.com/gravitational/teleport/lib/defaults" - - "github.com/gravitational/trace" ) // UserGetter is responsible for getting users diff --git a/lib/services/identity_test.go b/lib/services/identity_test.go index c83592ab3986b..cd724e9c5d4d7 100644 --- a/lib/services/identity_test.go +++ b/lib/services/identity_test.go @@ -20,10 +20,10 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestSAMLAuthRequest_Check(t *testing.T) { diff --git a/lib/services/impersonate.go b/lib/services/impersonate.go index 17bc05b43077b..527531331f53c 100644 --- a/lib/services/impersonate.go +++ b/lib/services/impersonate.go @@ -19,11 +19,11 @@ package services import ( "strings" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/vulcand/predicate" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/types" ) // impersonateContext is a default rule context used in teleport diff --git a/lib/services/impersonate_test.go b/lib/services/impersonate_test.go index 7f0929efbabc4..72e3252a55227 100644 --- a/lib/services/impersonate_test.go +++ b/lib/services/impersonate_test.go @@ -20,11 +20,11 @@ import ( "fmt" "testing" - apidefaults "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + apidefaults "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" ) func TestCheckImpersonate(t *testing.T) { diff --git a/lib/services/installer.go b/lib/services/installer.go index 30545ae134976..adc165056e872 100644 --- a/lib/services/installer.go +++ b/lib/services/installer.go @@ -17,10 +17,10 @@ package services import ( + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // UnmarshalInstaller unmarshals the installer resource from JSON. diff --git a/lib/services/kubernetes.go b/lib/services/kubernetes.go index 8cf83255c6c39..53bd43cc46776 100644 --- a/lib/services/kubernetes.go +++ b/lib/services/kubernetes.go @@ -24,12 +24,12 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/arn" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/cloud/azure" "github.com/gravitational/teleport/lib/utils" - log "github.com/sirupsen/logrus" - - "github.com/gravitational/trace" ) // KubernetesGetter defines interface for fetching kubernetes cluster resources. diff --git a/lib/services/kubernetes_test.go b/lib/services/kubernetes_test.go index 3c9dc6d6cb166..5926a1f410c46 100644 --- a/lib/services/kubernetes_test.go +++ b/lib/services/kubernetes_test.go @@ -19,10 +19,10 @@ package services import ( "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/stretchr/testify/require" ) // TestKubernetesServerUnmarshal verifies an kubernetes server resource can be unmarshaled. diff --git a/lib/services/license_test.go b/lib/services/license_test.go index bae743effafa6..80fceb8fe91b3 100644 --- a/lib/services/license_test.go +++ b/lib/services/license_test.go @@ -20,12 +20,11 @@ import ( "fmt" "testing" - "github.com/gravitational/teleport/api/types" - - "github.com/gravitational/trace" - "github.com/google/go-cmp/cmp" + "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestLicenseUnmarshal(t *testing.T) { diff --git a/lib/services/local/access.go b/lib/services/local/access.go index 04625c2510032..3a0fc1c144fdc 100644 --- a/lib/services/local/access.go +++ b/lib/services/local/access.go @@ -23,11 +23,11 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // AccessService manages roles diff --git a/lib/services/local/apps.go b/lib/services/local/apps.go index be9596a8f79ef..67c73114c7317 100644 --- a/lib/services/local/apps.go +++ b/lib/services/local/apps.go @@ -19,11 +19,11 @@ package local import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // AppService manages application resources in the backend. diff --git a/lib/services/local/apps_test.go b/lib/services/local/apps_test.go index 3894c85ee8acd..d059c59925f99 100644 --- a/lib/services/local/apps_test.go +++ b/lib/services/local/apps_test.go @@ -20,14 +20,14 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/backend/memory" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/backend/memory" ) // TestAppsCRUD tests backend operations with application resources. diff --git a/lib/services/local/assertion_replay.go b/lib/services/local/assertion_replay.go index 1083c3a758154..9057c1ea9af6c 100644 --- a/lib/services/local/assertion_replay.go +++ b/lib/services/local/assertion_replay.go @@ -20,8 +20,9 @@ import ( "context" "time" - "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/backend" ) const assertionReplayPrefix = "recognized_assertions" diff --git a/lib/services/local/assertion_replay_test.go b/lib/services/local/assertion_replay_test.go index e21d85b406583..6408cad99d413 100644 --- a/lib/services/local/assertion_replay_test.go +++ b/lib/services/local/assertion_replay_test.go @@ -22,8 +22,9 @@ import ( "time" "github.com/google/uuid" - "github.com/gravitational/teleport/lib/backend/memory" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/backend/memory" ) func TestAssertionReplayService(t *testing.T) { diff --git a/lib/services/local/configuration.go b/lib/services/local/configuration.go index 42229a11150ae..ca3861182127a 100644 --- a/lib/services/local/configuration.go +++ b/lib/services/local/configuration.go @@ -20,7 +20,6 @@ import ( "context" "github.com/gravitational/trace" - "github.com/prometheus/client_golang/prometheus" "github.com/gravitational/teleport" diff --git a/lib/services/local/configuration_test.go b/lib/services/local/configuration_test.go index 5b71cde7a34ad..cd53a91abd328 100644 --- a/lib/services/local/configuration_test.go +++ b/lib/services/local/configuration_test.go @@ -20,16 +20,16 @@ import ( "context" "testing" + "github.com/google/go-cmp/cmp" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v2" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/backend/memory" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/services/suite" - - "github.com/google/go-cmp/cmp" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" - "gopkg.in/yaml.v2" ) type configContext struct { diff --git a/lib/services/local/connection_diagnostic.go b/lib/services/local/connection_diagnostic.go index fe60862c7948b..ad6183eb1d838 100644 --- a/lib/services/local/connection_diagnostic.go +++ b/lib/services/local/connection_diagnostic.go @@ -19,10 +19,11 @@ package local import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" ) // ConnectionDiagnosticService manages connection diagnostic resources in the backend. diff --git a/lib/services/local/databases.go b/lib/services/local/databases.go index d3cd2ae98f641..b61a2908400c8 100644 --- a/lib/services/local/databases.go +++ b/lib/services/local/databases.go @@ -19,11 +19,11 @@ package local import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // DatabaseService manages database resources in the backend. diff --git a/lib/services/local/databases_test.go b/lib/services/local/databases_test.go index b08172f6a007e..a5173b8c1e681 100644 --- a/lib/services/local/databases_test.go +++ b/lib/services/local/databases_test.go @@ -20,15 +20,15 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/backend/memory" - "github.com/gravitational/teleport/lib/defaults" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/backend/memory" + "github.com/gravitational/teleport/lib/defaults" ) // TestDatabasesCRUD tests backend operations with database resources. diff --git a/lib/services/local/desktops.go b/lib/services/local/desktops.go index d02318a9eb6ca..f90a3c6573037 100644 --- a/lib/services/local/desktops.go +++ b/lib/services/local/desktops.go @@ -19,11 +19,11 @@ package local import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // WindowsDesktopService manages windows desktop resources in the backend. diff --git a/lib/services/local/desktops_test.go b/lib/services/local/desktops_test.go index 2f0588355d491..dbd3fc7ef0b4b 100644 --- a/lib/services/local/desktops_test.go +++ b/lib/services/local/desktops_test.go @@ -22,12 +22,12 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/backend/memory" - - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) func TestListWindowsDesktops(t *testing.T) { diff --git a/lib/services/local/dynamic_access.go b/lib/services/local/dynamic_access.go index c9ac2b285320e..e35073f2fb6ae 100644 --- a/lib/services/local/dynamic_access.go +++ b/lib/services/local/dynamic_access.go @@ -21,14 +21,14 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // DynamicAccessService manages dynamic RBAC diff --git a/lib/services/local/events.go b/lib/services/local/events.go index 0ee75d1275a81..93a984e960c0a 100644 --- a/lib/services/local/events.go +++ b/lib/services/local/events.go @@ -20,15 +20,15 @@ import ( "bytes" "context" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" ) // EventsService implements service to watch for events diff --git a/lib/services/local/kube.go b/lib/services/local/kube.go index f1362ce9fd072..d69d2b2b11a24 100644 --- a/lib/services/local/kube.go +++ b/lib/services/local/kube.go @@ -19,11 +19,11 @@ package local import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // KubernetesService manages kubernetes resources in the backend. diff --git a/lib/services/local/kube_test.go b/lib/services/local/kube_test.go index 5416252d8cca2..25a9b6b90019a 100644 --- a/lib/services/local/kube_test.go +++ b/lib/services/local/kube_test.go @@ -20,14 +20,14 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/backend/memory" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/backend/memory" ) // TestKubernetesCRUD tests backend operations with kubernetes resources. diff --git a/lib/services/local/perf_test.go b/lib/services/local/perf_test.go index 568d5d184bbaa..6e52f85185183 100644 --- a/lib/services/local/perf_test.go +++ b/lib/services/local/perf_test.go @@ -21,14 +21,14 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/backend/lite" "github.com/gravitational/teleport/lib/backend/memory" "github.com/gravitational/teleport/lib/services" - - "github.com/stretchr/testify/require" ) // BenchmarkGetNodes verifies the performance of the GetNodes operation diff --git a/lib/services/local/presence.go b/lib/services/local/presence.go index 0632d260457e5..cb483fd27b3d4 100644 --- a/lib/services/local/presence.go +++ b/lib/services/local/presence.go @@ -23,6 +23,10 @@ import ( "sort" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/constants" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -31,10 +35,6 @@ import ( "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // PresenceService records and reports the presence of all components diff --git a/lib/services/local/presence_test.go b/lib/services/local/presence_test.go index 0b260ec4c8ad3..28edd4ea463ad 100644 --- a/lib/services/local/presence_test.go +++ b/lib/services/local/presence_test.go @@ -25,6 +25,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/google/uuid" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" @@ -36,8 +37,6 @@ import ( "github.com/gravitational/teleport/lib/backend/lite" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services/suite" - - "github.com/gravitational/trace" ) func TestTrustedClusterCRUD(t *testing.T) { diff --git a/lib/services/local/provisioning.go b/lib/services/local/provisioning.go index 6cb775ae405cb..5b2424e3b9204 100644 --- a/lib/services/local/provisioning.go +++ b/lib/services/local/provisioning.go @@ -20,12 +20,12 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // ProvisioningService governs adding new nodes to the cluster diff --git a/lib/services/local/resource.go b/lib/services/local/resource.go index e521540ba8069..dae28a4b4d928 100644 --- a/lib/services/local/resource.go +++ b/lib/services/local/resource.go @@ -21,11 +21,11 @@ import ( "encoding/json" "strings" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // CreateResources attempts to dynamically create the supplied resources. diff --git a/lib/services/local/resource_test.go b/lib/services/local/resource_test.go index c42910d866fe1..ea5e63cbed2bf 100644 --- a/lib/services/local/resource_test.go +++ b/lib/services/local/resource_test.go @@ -22,6 +22,8 @@ import ( "testing" "time" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" "golang.org/x/crypto/bcrypt" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -29,9 +31,6 @@ import ( "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/services/suite" - "github.com/stretchr/testify/require" - - "github.com/jonboulle/clockwork" ) func TestUserResource(t *testing.T) { diff --git a/lib/services/local/restrictions.go b/lib/services/local/restrictions.go index 4f3ce58bc8c7e..1da7bfb5d2d02 100644 --- a/lib/services/local/restrictions.go +++ b/lib/services/local/restrictions.go @@ -19,11 +19,11 @@ package local import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // RestrictionsService manages restrictions to be enforced by restricted shell diff --git a/lib/services/local/services_test.go b/lib/services/local/services_test.go index de9deea2005e8..cdd9bb6860e80 100644 --- a/lib/services/local/services_test.go +++ b/lib/services/local/services_test.go @@ -21,12 +21,13 @@ import ( "os" "testing" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/backend/memory" "github.com/gravitational/teleport/lib/services/suite" "github.com/gravitational/teleport/lib/utils" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/lib/services/local/session.go b/lib/services/local/session.go index dbb0b8629f7ba..1f71b451cb3e0 100644 --- a/lib/services/local/session.go +++ b/lib/services/local/session.go @@ -19,13 +19,13 @@ package local import ( "context" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // GetAppSession gets an application web session. diff --git a/lib/services/local/session_test.go b/lib/services/local/session_test.go index 70bfd8a45f683..bc1f9f6ad6b36 100644 --- a/lib/services/local/session_test.go +++ b/lib/services/local/session_test.go @@ -19,12 +19,12 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/google/uuid" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" ) func TestDeleteUserAppSessions(t *testing.T) { diff --git a/lib/services/local/sessiontracker.go b/lib/services/local/sessiontracker.go index ba010f8060331..f766166a96acb 100644 --- a/lib/services/local/sessiontracker.go +++ b/lib/services/local/sessiontracker.go @@ -20,13 +20,13 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) const ( diff --git a/lib/services/local/sessiontracker_test.go b/lib/services/local/sessiontracker_test.go index acc6a180ddc73..e745fb1e9811b 100644 --- a/lib/services/local/sessiontracker_test.go +++ b/lib/services/local/sessiontracker_test.go @@ -18,13 +18,13 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/backend/memory" - "github.com/google/uuid" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/backend/memory" ) // TestSessionTrackerStorage tests backend operations with tracker resources. diff --git a/lib/services/local/status.go b/lib/services/local/status.go index 8a96b5958642f..6c94ed645d9ba 100644 --- a/lib/services/local/status.go +++ b/lib/services/local/status.go @@ -20,12 +20,12 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/utils" - "github.com/sirupsen/logrus" - - "github.com/gravitational/trace" ) // StatusService manages cluster status info. diff --git a/lib/services/local/status_test.go b/lib/services/local/status_test.go index 936ac8834fa17..09fea2c5a642b 100644 --- a/lib/services/local/status_test.go +++ b/lib/services/local/status_test.go @@ -22,11 +22,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/backend/memory" "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/backend/memory" ) // TestClusterAlerts verifies basic expected behavior of cluster alert creation, querying, and expiry. diff --git a/lib/services/local/trust.go b/lib/services/local/trust.go index 54d9e1669af4f..5b664f0bb19c5 100644 --- a/lib/services/local/trust.go +++ b/lib/services/local/trust.go @@ -17,11 +17,11 @@ package local import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // CA is local implementation of Trust service that diff --git a/lib/services/local/unstable.go b/lib/services/local/unstable.go index b8fc6da13fee7..e961296dce6c0 100644 --- a/lib/services/local/unstable.go +++ b/lib/services/local/unstable.go @@ -20,11 +20,11 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) const assertionTTL = time.Minute * 10 diff --git a/lib/services/local/unstable_test.go b/lib/services/local/unstable_test.go index 5a1b0ec2c3182..8ae2efd14e3dc 100644 --- a/lib/services/local/unstable_test.go +++ b/lib/services/local/unstable_test.go @@ -20,13 +20,13 @@ import ( "context" "testing" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend/memory" - "github.com/jonboulle/clockwork" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) func TestSystemRoleAssertions(t *testing.T) { diff --git a/lib/services/local/users.go b/lib/services/local/users.go index 87ca9c116c601..d20101775d3ae 100644 --- a/lib/services/local/users.go +++ b/lib/services/local/users.go @@ -28,14 +28,6 @@ import ( "time" "github.com/gogo/protobuf/jsonpb" - - "github.com/gravitational/teleport/api/types" - wantypes "github.com/gravitational/teleport/api/types/webauthn" - "github.com/gravitational/teleport/api/utils/keys" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/services" - "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/gravitational/trace" @@ -43,6 +35,13 @@ import ( "github.com/sirupsen/logrus" "golang.org/x/crypto/bcrypt" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/types" + wantypes "github.com/gravitational/teleport/api/types/webauthn" + "github.com/gravitational/teleport/api/utils/keys" + "github.com/gravitational/teleport/lib/backend" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/services" ) // GlobalSessionDataMaxEntries represents the maximum number of in-flight diff --git a/lib/services/local/users_test.go b/lib/services/local/users_test.go index 9ac230d1d2ae5..da8dc812db6e0 100644 --- a/lib/services/local/users_test.go +++ b/lib/services/local/users_test.go @@ -25,15 +25,15 @@ import ( "github.com/duo-labs/webauthn/protocol" "github.com/google/go-cmp/cmp" "github.com/google/uuid" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/backend" - "github.com/gravitational/teleport/lib/backend/memory" - "github.com/gravitational/teleport/lib/services/local" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" wantypes "github.com/gravitational/teleport/api/types/webauthn" + "github.com/gravitational/teleport/lib/backend" + "github.com/gravitational/teleport/lib/backend/memory" + "github.com/gravitational/teleport/lib/services/local" ) func newIdentityService(t *testing.T, clock clockwork.Clock) *local.IdentityService { diff --git a/lib/services/local/usertoken.go b/lib/services/local/usertoken.go index 329b7eb8559c2..f2cc0d7322e53 100644 --- a/lib/services/local/usertoken.go +++ b/lib/services/local/usertoken.go @@ -20,11 +20,11 @@ import ( "bytes" "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/backend" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) // GetUserTokens returns all user tokens. diff --git a/lib/services/lock.go b/lib/services/lock.go index 6d71f35595047..aac395449c2e4 100644 --- a/lib/services/lock.go +++ b/lib/services/lock.go @@ -19,11 +19,11 @@ package services import ( "fmt" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // LockInForceAccessDenied is an AccessDenied error returned when a lock diff --git a/lib/services/map_test.go b/lib/services/map_test.go index 8d10bd2ef1dc6..651dabbe13a54 100644 --- a/lib/services/map_test.go +++ b/lib/services/map_test.go @@ -21,11 +21,11 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/types" + "github.com/gravitational/trace" "github.com/stretchr/testify/require" - "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/types" ) func TestRoleParsing(t *testing.T) { diff --git a/lib/services/matchers.go b/lib/services/matchers.go index c6f2823a52c54..022b6c81e0bbc 100644 --- a/lib/services/matchers.go +++ b/lib/services/matchers.go @@ -17,10 +17,10 @@ limitations under the License. package services import ( - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" - "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" ) // ResourceMatcher matches cluster resources. diff --git a/lib/services/matchers_test.go b/lib/services/matchers_test.go index 60e04d7c2560b..14b4b78af0e32 100644 --- a/lib/services/matchers_test.go +++ b/lib/services/matchers_test.go @@ -19,12 +19,12 @@ package services import ( "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/trace" - "github.com/google/uuid" + "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/defaults" ) // TestMatchResourceLabels tests matching a resource against a selector. diff --git a/lib/services/oidc_test.go b/lib/services/oidc_test.go index 76216d92a21da..7514f34f3f5e6 100644 --- a/lib/services/oidc_test.go +++ b/lib/services/oidc_test.go @@ -20,12 +20,11 @@ import ( "testing" "github.com/coreos/go-oidc/jose" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) // TestOIDCRoleMapping verifies basic mapping from OIDC claims to roles. diff --git a/lib/services/parser.go b/lib/services/parser.go index 042f18ee696e4..863d290dcb134 100644 --- a/lib/services/parser.go +++ b/lib/services/parser.go @@ -22,16 +22,16 @@ import ( "strings" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/vulcand/predicate" + "github.com/vulcand/predicate/builder" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/api/types/wrappers" "github.com/gravitational/teleport/lib/session" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" - "github.com/vulcand/predicate" - "github.com/vulcand/predicate/builder" ) // RuleContext specifies context passed to the diff --git a/lib/services/presets.go b/lib/services/presets.go index daab87a30672b..a08938bbcd88a 100644 --- a/lib/services/presets.go +++ b/lib/services/presets.go @@ -17,15 +17,14 @@ limitations under the License. package services import ( - "github.com/gravitational/teleport" + "github.com/google/uuid" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" utils "github.com/gravitational/teleport/api/utils" - - "github.com/google/uuid" - log "github.com/sirupsen/logrus" ) // NewPresetEditorRole returns a new pre-defined role for cluster diff --git a/lib/services/reconciler.go b/lib/services/reconciler.go index 84ea4ca40eb37..0d625897056e1 100644 --- a/lib/services/reconciler.go +++ b/lib/services/reconciler.go @@ -19,10 +19,10 @@ package services import ( "context" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" ) // ReconcilerConfig is the resource reconciler configuration. diff --git a/lib/services/reconciler_test.go b/lib/services/reconciler_test.go index 2aba193a1ba8e..b719072957720 100644 --- a/lib/services/reconciler_test.go +++ b/lib/services/reconciler_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) // TestReconciler makes sure appropriate callbacks are called during reconciliation. diff --git a/lib/services/restrictions.go b/lib/services/restrictions.go index a320c602d04db..fced07890e0ff 100644 --- a/lib/services/restrictions.go +++ b/lib/services/restrictions.go @@ -20,10 +20,10 @@ import ( "context" "encoding/json" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) type Restrictions interface { diff --git a/lib/services/role.go b/lib/services/role.go index 6aa697c711b5d..46b7675cbeda1 100644 --- a/lib/services/role.go +++ b/lib/services/role.go @@ -24,6 +24,11 @@ import ( "strings" "time" + "github.com/google/uuid" + "github.com/gravitational/configure/cstrings" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/vulcand/predicate" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -36,13 +41,6 @@ import ( "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/parse" - - "github.com/gravitational/configure/cstrings" - "github.com/gravitational/trace" - - "github.com/google/uuid" - log "github.com/sirupsen/logrus" - "github.com/vulcand/predicate" ) // DefaultImplicitRules provides access to the default set of implicit rules diff --git a/lib/services/role_test.go b/lib/services/role_test.go index 28232988c3a35..6683903b24b55 100644 --- a/lib/services/role_test.go +++ b/lib/services/role_test.go @@ -26,6 +26,11 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -36,11 +41,6 @@ import ( "github.com/gravitational/teleport/api/utils/sshutils" "github.com/gravitational/teleport/lib/fixtures" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" - - "github.com/google/go-cmp/cmp" - "github.com/google/uuid" - "github.com/stretchr/testify/require" ) // TestConnAndSessLimits verifies that role sets correctly calculate diff --git a/lib/services/saml.go b/lib/services/saml.go index 99918cb6ae97e..d6a45d3a6f010 100644 --- a/lib/services/saml.go +++ b/lib/services/saml.go @@ -26,18 +26,17 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + saml2 "github.com/russellhaering/gosaml2" + samltypes "github.com/russellhaering/gosaml2/types" + dsig "github.com/russellhaering/goxmldsig" log "github.com/sirupsen/logrus" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - saml2 "github.com/russellhaering/gosaml2" - samltypes "github.com/russellhaering/gosaml2/types" - dsig "github.com/russellhaering/goxmldsig" ) // ValidateSAMLConnector validates the SAMLConnector and sets default values. diff --git a/lib/services/saml_test.go b/lib/services/saml_test.go index 2a6fcdfdf8f39..910272b3f0f2b 100644 --- a/lib/services/saml_test.go +++ b/lib/services/saml_test.go @@ -20,12 +20,12 @@ import ( "strings" "testing" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/fixtures" - "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" kyaml "k8s.io/apimachinery/pkg/util/yaml" + + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/fixtures" ) func TestParseFromMetadata(t *testing.T) { diff --git a/lib/services/semaphore.go b/lib/services/semaphore.go index 57d9f0341b245..cc72f67930e89 100644 --- a/lib/services/semaphore.go +++ b/lib/services/semaphore.go @@ -19,13 +19,13 @@ import ( "sync" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) type SemaphoreLockConfig struct { diff --git a/lib/services/semaphore_test.go b/lib/services/semaphore_test.go index c69b55a5ff7db..ca720e3bc3094 100644 --- a/lib/services/semaphore_test.go +++ b/lib/services/semaphore_test.go @@ -20,9 +20,9 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestAcquireSemaphoreRequest(t *testing.T) { diff --git a/lib/services/server.go b/lib/services/server.go index 4da3ea316bbb6..41e032dd8d392 100644 --- a/lib/services/server.go +++ b/lib/services/server.go @@ -21,14 +21,14 @@ import ( "fmt" "time" + "github.com/google/go-cmp/cmp" + "github.com/gravitational/trace" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/go-cmp/cmp" - "github.com/gravitational/trace" ) const ( diff --git a/lib/services/servers_test.go b/lib/services/servers_test.go index 7669e472c1b75..4fe8be3acd098 100644 --- a/lib/services/servers_test.go +++ b/lib/services/servers_test.go @@ -21,13 +21,13 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/trace" - - "github.com/google/go-cmp/cmp" - "github.com/stretchr/testify/require" ) // TestServersCompare tests comparing two servers diff --git a/lib/services/services_test.go b/lib/services/services_test.go index c23f9772d1c21..ebacd22808737 100644 --- a/lib/services/services_test.go +++ b/lib/services/services_test.go @@ -21,12 +21,12 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/go-cmp/cmp" - "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/lib/services/session.go b/lib/services/session.go index ffd66fb79ba24..9404219da0b55 100644 --- a/lib/services/session.go +++ b/lib/services/session.go @@ -19,11 +19,11 @@ package services import ( "encoding/json" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // UnmarshalWebSession unmarshals the WebSession resource from JSON. diff --git a/lib/services/sessionrecording.go b/lib/services/sessionrecording.go index 5c7d13540ca04..28eb4186ffcdb 100644 --- a/lib/services/sessionrecording.go +++ b/lib/services/sessionrecording.go @@ -17,10 +17,10 @@ limitations under the License. package services import ( + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // IsRecordAtProxy returns true if recording is sync or async at proxy. diff --git a/lib/services/sessiontracker.go b/lib/services/sessiontracker.go index 1748931193db7..0bfef1b4fb7fa 100644 --- a/lib/services/sessiontracker.go +++ b/lib/services/sessiontracker.go @@ -19,11 +19,11 @@ package services import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // SessionTrackerService is a realtime session service that has information about diff --git a/lib/services/suite/presence_test.go b/lib/services/suite/presence_test.go index c7cffe11e46d2..f3396168ce7d1 100644 --- a/lib/services/suite/presence_test.go +++ b/lib/services/suite/presence_test.go @@ -20,10 +20,10 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestServerLabels(t *testing.T) { diff --git a/lib/services/traits.go b/lib/services/traits.go index 011f1486c5e80..4205745d82038 100644 --- a/lib/services/traits.go +++ b/lib/services/traits.go @@ -19,13 +19,13 @@ package services import ( "fmt" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/parse" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) // TraitsToRoles maps the supplied traits to a list of teleport role names. diff --git a/lib/services/traits_test.go b/lib/services/traits_test.go index ad6531ec5772c..92f3a5ac3cb39 100644 --- a/lib/services/traits_test.go +++ b/lib/services/traits_test.go @@ -19,9 +19,10 @@ package services import ( "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" - "github.com/stretchr/testify/require" ) // TestTraitsToRoleMatchers verifies expected matching behavior diff --git a/lib/services/trustedcluster.go b/lib/services/trustedcluster.go index 49fdfefd3fbd8..811311eb5c825 100644 --- a/lib/services/trustedcluster.go +++ b/lib/services/trustedcluster.go @@ -19,11 +19,11 @@ package services import ( "fmt" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // ValidateTrustedCluster checks and sets Trusted Cluster defaults diff --git a/lib/services/tunnel.go b/lib/services/tunnel.go index 328c74aa1983e..d423f90acfd93 100644 --- a/lib/services/tunnel.go +++ b/lib/services/tunnel.go @@ -19,10 +19,10 @@ package services import ( "encoding/json" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // ValidateReverseTunnel validates the OIDC connector and sets default values diff --git a/lib/services/tunnelconn.go b/lib/services/tunnelconn.go index aa71a1692d361..ee90ca49635e1 100644 --- a/lib/services/tunnelconn.go +++ b/lib/services/tunnelconn.go @@ -19,12 +19,12 @@ package services import ( "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" ) // LatestTunnelConnection returns latest tunnel connection from the list diff --git a/lib/services/user_test.go b/lib/services/user_test.go index 609202c353105..fa40f9520dd19 100644 --- a/lib/services/user_test.go +++ b/lib/services/user_test.go @@ -21,14 +21,14 @@ import ( "fmt" "testing" - apidefaults "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/types" - "github.com/coreos/go-oidc/jose" "github.com/google/go-cmp/cmp" saml2 "github.com/russellhaering/gosaml2" samltypes "github.com/russellhaering/gosaml2/types" "github.com/stretchr/testify/require" + + apidefaults "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" ) func TestTraits(t *testing.T) { diff --git a/lib/services/usertoken_test.go b/lib/services/usertoken_test.go index 079dd66082a8c..3eeea4ae7bbf5 100644 --- a/lib/services/usertoken_test.go +++ b/lib/services/usertoken_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/defaults" - "github.com/gravitational/teleport/api/types" - "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" ) func TestUserTokenUnmarshal(t *testing.T) { diff --git a/lib/services/watcher.go b/lib/services/watcher.go index 3eb3bea1c64f8..c7e4bf065f767 100644 --- a/lib/services/watcher.go +++ b/lib/services/watcher.go @@ -21,16 +21,16 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/constants" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" ) // resourceCollector is a generic interface for maintaining an up-to-date view diff --git a/lib/services/wrappers_test.go b/lib/services/wrappers_test.go index 453e310640d30..56343e6e2da11 100644 --- a/lib/services/wrappers_test.go +++ b/lib/services/wrappers_test.go @@ -20,10 +20,10 @@ import ( "encoding/hex" "testing" - "github.com/gravitational/teleport/api/types/wrappers" - "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types/wrappers" ) func TestUnmarshalBackwards(t *testing.T) { diff --git a/lib/session/session.go b/lib/session/session.go index f87c722345cc3..44ca809f24341 100644 --- a/lib/session/session.go +++ b/lib/session/session.go @@ -25,11 +25,10 @@ import ( "time" "github.com/google/uuid" + "github.com/gravitational/trace" "github.com/moby/term" "github.com/gravitational/teleport/api/types" - - "github.com/gravitational/trace" ) // ID is a unique session ID. diff --git a/lib/shell/shell.go b/lib/shell/shell.go index 05c1bcecb954b..1ba28fe4da5fc 100644 --- a/lib/shell/shell.go +++ b/lib/shell/shell.go @@ -18,7 +18,6 @@ package shell import ( "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) diff --git a/lib/srv/alpnproxy/conn.go b/lib/srv/alpnproxy/conn.go index 9e8efd92d7bf0..be936b385576b 100644 --- a/lib/srv/alpnproxy/conn.go +++ b/lib/srv/alpnproxy/conn.go @@ -25,8 +25,9 @@ import ( "sync" "time" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) // newBufferedConn creates new instance of bufferedConn. diff --git a/lib/srv/alpnproxy/conn_upgrade.go b/lib/srv/alpnproxy/conn_upgrade.go index 2d2e48cb8b2e8..72f1017c2bdfe 100644 --- a/lib/srv/alpnproxy/conn_upgrade.go +++ b/lib/srv/alpnproxy/conn_upgrade.go @@ -25,10 +25,10 @@ import ( "net/url" "time" - "github.com/gravitational/teleport" "github.com/gravitational/trace" "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/lib/srv/alpnproxy/common" ) diff --git a/lib/srv/alpnproxy/forward_proxy.go b/lib/srv/alpnproxy/forward_proxy.go index c6f6eab3b7592..5bd4e4b57e639 100644 --- a/lib/srv/alpnproxy/forward_proxy.go +++ b/lib/srv/alpnproxy/forward_proxy.go @@ -26,12 +26,12 @@ import ( "strings" "sync" - awsapiutils "github.com/gravitational/teleport/api/utils/aws" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "golang.org/x/net/http/httpproxy" + + awsapiutils "github.com/gravitational/teleport/api/utils/aws" + "github.com/gravitational/teleport/lib/utils" ) // IsConnectRequest returns true if the request is a HTTP CONNECT tunnel diff --git a/lib/srv/alpnproxy/listener.go b/lib/srv/alpnproxy/listener.go index 38a6416f10097..14e8c576e2bee 100644 --- a/lib/srv/alpnproxy/listener.go +++ b/lib/srv/alpnproxy/listener.go @@ -24,11 +24,11 @@ import ( "net" "sync" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // ListenerMuxWrapper wraps the net.Listener and multiplex incoming connection from serviceListener and connection diff --git a/lib/srv/alpnproxy/proxy.go b/lib/srv/alpnproxy/proxy.go index a92cf22b40cb1..70eef1b755554 100644 --- a/lib/srv/alpnproxy/proxy.go +++ b/lib/srv/alpnproxy/proxy.go @@ -27,7 +27,9 @@ import ( "sync" "time" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/lib/auth" @@ -35,9 +37,6 @@ import ( "github.com/gravitational/teleport/lib/srv/alpnproxy/common" "github.com/gravitational/teleport/lib/srv/db/dbutils" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // ProxyConfig is the configuration for an ALPN proxy server. diff --git a/lib/srv/alpnproxy/proxy_test.go b/lib/srv/alpnproxy/proxy_test.go index 0ee63a61e7349..59410b48feec8 100644 --- a/lib/srv/alpnproxy/proxy_test.go +++ b/lib/srv/alpnproxy/proxy_test.go @@ -29,12 +29,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/lib/srv/alpnproxy/common" "github.com/gravitational/teleport/lib/srv/db/dbutils" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/stretchr/testify/require" ) // TestProxySSHHandler tests the ALPN routing. Connection with ALPN 'teleport-proxy-ssh' value should diff --git a/lib/srv/app/aws/endpoints.go b/lib/srv/app/aws/endpoints.go index 1700270942f5e..c5823f95b2503 100644 --- a/lib/srv/app/aws/endpoints.go +++ b/lib/srv/app/aws/endpoints.go @@ -50,11 +50,10 @@ import ( "github.com/aws/aws-sdk-go/service/sso" "github.com/aws/aws-sdk-go/service/ssooidc" "github.com/aws/aws-sdk-go/service/timestreamquery" + "github.com/gravitational/trace" awsapiutils "github.com/gravitational/teleport/api/utils/aws" awsutils "github.com/gravitational/teleport/lib/utils/aws" - - "github.com/gravitational/trace" ) // resolveEndpoint extracts the aws-service on and aws-region from the request diff --git a/lib/srv/app/cloud.go b/lib/srv/app/cloud.go index d219962c6fc81..2b95d1f055711 100644 --- a/lib/srv/app/cloud.go +++ b/lib/srv/app/cloud.go @@ -25,19 +25,18 @@ import ( "strings" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/lib/tlsca" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" "github.com/aws/aws-sdk-go/aws/credentials/ssocreds" "github.com/aws/aws-sdk-go/aws/credentials/stscreds" awssession "github.com/aws/aws-sdk-go/aws/session" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/lib/tlsca" ) // Cloud provides cloud provider access related methods such as generating diff --git a/lib/srv/app/cloud_test.go b/lib/srv/app/cloud_test.go index d5898c9689220..ebbab34bc0bfa 100644 --- a/lib/srv/app/cloud_test.go +++ b/lib/srv/app/cloud_test.go @@ -27,12 +27,12 @@ import ( "github.com/aws/aws-sdk-go/aws/credentials/stscreds" awssession "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/sts" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) func TestIsSessionUsingTemporaryCredentials(t *testing.T) { diff --git a/lib/srv/app/server.go b/lib/srv/app/server.go index a0f948909d145..adc9b6f9d8229 100644 --- a/lib/srv/app/server.go +++ b/lib/srv/app/server.go @@ -29,6 +29,10 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -45,11 +49,6 @@ import ( "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/aws" - - "github.com/gravitational/trace" - - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" ) // Config is the configuration for an application server. diff --git a/lib/srv/app/server_test.go b/lib/srv/app/server_test.go index df7ad11e6f68c..54f252e532100 100644 --- a/lib/srv/app/server_test.go +++ b/lib/srv/app/server_test.go @@ -35,8 +35,14 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/google/uuid" "github.com/gorilla/websocket" "github.com/gravitational/oxy/forward" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/defaults" @@ -49,12 +55,6 @@ import ( libsession "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/srv/app/common" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/google/uuid" - "github.com/jonboulle/clockwork" - "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/lib/srv/app/session.go b/lib/srv/app/session.go index 5b1eed333fa0b..1d95a65da1bb9 100644 --- a/lib/srv/app/session.go +++ b/lib/srv/app/session.go @@ -23,6 +23,12 @@ import ( "sync" "time" + "github.com/google/uuid" + "github.com/gravitational/oxy/forward" + "github.com/gravitational/trace" + "github.com/gravitational/ttlmap" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -37,13 +43,6 @@ import ( "github.com/gravitational/teleport/lib/srv/app/common" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/oxy/forward" - "github.com/gravitational/trace" - "github.com/gravitational/ttlmap" - - "github.com/google/uuid" - "github.com/sirupsen/logrus" ) // sessionChunkCloseTimeout is the default timeout used for sessionChunk.closeTimeout diff --git a/lib/srv/app/session_test.go b/lib/srv/app/session_test.go index 6f57ed57e05c3..6408ed6f87d4a 100644 --- a/lib/srv/app/session_test.go +++ b/lib/srv/app/session_test.go @@ -20,11 +20,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/events" - "github.com/google/uuid" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/events" ) func newSessionChunk(timeout time.Duration) *sessionChunk { diff --git a/lib/srv/app/tcpserver.go b/lib/srv/app/tcpserver.go index 62ec3b0257905..5793b1b426cef 100644 --- a/lib/srv/app/tcpserver.go +++ b/lib/srv/app/tcpserver.go @@ -20,6 +20,9 @@ import ( "context" "net" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + apidefaults "github.com/gravitational/teleport/api/defaults" apitypes "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" @@ -27,9 +30,6 @@ import ( "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) type tcpServer struct { diff --git a/lib/srv/app/transport.go b/lib/srv/app/transport.go index 1bd09f084fa2b..c10f1460c2c16 100644 --- a/lib/srv/app/transport.go +++ b/lib/srv/app/transport.go @@ -24,6 +24,10 @@ import ( "net/url" "path" + "github.com/gravitational/oxy/forward" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" @@ -35,10 +39,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv/app/common" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/oxy/forward" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // transportConfig is configuration for a rewriting transport. diff --git a/lib/srv/app/watcher.go b/lib/srv/app/watcher.go index 94552cf92be37..72babdc460e4b 100644 --- a/lib/srv/app/watcher.go +++ b/lib/srv/app/watcher.go @@ -20,12 +20,13 @@ import ( "context" "fmt" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) // startReconciler starts reconciler that registers/unregisters proxied diff --git a/lib/srv/app/watcher_test.go b/lib/srv/app/watcher_test.go index 4d5e81b89b581..a1b4e7f2278ef 100644 --- a/lib/srv/app/watcher_test.go +++ b/lib/srv/app/watcher_test.go @@ -22,12 +22,12 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" ) // TestWatcher verifies that app agent properly detects and applies diff --git a/lib/srv/authhandlers.go b/lib/srv/authhandlers.go index 459e43fa1784d..936325244fccd 100644 --- a/lib/srv/authhandlers.go +++ b/lib/srv/authhandlers.go @@ -24,6 +24,11 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -37,13 +42,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - - "github.com/google/uuid" - "github.com/jonboulle/clockwork" - "github.com/prometheus/client_golang/prometheus" - log "github.com/sirupsen/logrus" ) var ( diff --git a/lib/srv/ctx.go b/lib/srv/ctx.go index e66f7409c417f..6a8c2d9cd948d 100644 --- a/lib/srv/ctx.go +++ b/lib/srv/ctx.go @@ -28,6 +28,10 @@ import ( "sync/atomic" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -47,11 +51,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils/x11" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/parse" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/prometheus/client_golang/prometheus" - log "github.com/sirupsen/logrus" ) var ctxID int32 diff --git a/lib/srv/ctx_test.go b/lib/srv/ctx_test.go index aeeedc71ffcac..36e38d369e712 100644 --- a/lib/srv/ctx_test.go +++ b/lib/srv/ctx_test.go @@ -19,9 +19,10 @@ package srv import ( "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" - "github.com/stretchr/testify/require" ) func TestCheckSFTPAllowed(t *testing.T) { diff --git a/lib/srv/db/access_test.go b/lib/srv/db/access_test.go index 1ed2f4eaa706c..791bcbcacd106 100644 --- a/lib/srv/db/access_test.go +++ b/lib/srv/db/access_test.go @@ -28,6 +28,7 @@ import ( "testing" "time" + cqlclient "github.com/datastax/go-cassandra-native-protocol/client" mssql "github.com/denisenkom/go-mssqldb" elastic "github.com/elastic/go-elasticsearch/v8" mysqlclient "github.com/go-mysql-org/go-mysql/client" @@ -73,8 +74,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/sqlserver" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - cqlclient "github.com/datastax/go-cassandra-native-protocol/client" ) func TestMain(m *testing.M) { diff --git a/lib/srv/db/auth_test.go b/lib/srv/db/auth_test.go index 0d54506402f78..9a8225a2d35cc 100644 --- a/lib/srv/db/auth_test.go +++ b/lib/srv/db/auth_test.go @@ -23,6 +23,11 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" @@ -30,11 +35,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/tlsca" - "github.com/jonboulle/clockwork" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) // TestAuthTokens verifies that proper IAM auth tokens are used when connecting diff --git a/lib/srv/db/ca.go b/lib/srv/db/ca.go index 886b3a015b5e6..14491ef3b7f77 100644 --- a/lib/srv/db/ca.go +++ b/lib/srv/db/ca.go @@ -24,15 +24,15 @@ import ( "os" "path/filepath" + "github.com/gravitational/trace" + sqladmin "google.golang.org/api/sqladmin/v1beta4" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" awsutils "github.com/gravitational/teleport/api/utils/aws" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - sqladmin "google.golang.org/api/sqladmin/v1beta4" ) // initCACert initializes the provided server's CA certificate in case of a diff --git a/lib/srv/db/ca_test.go b/lib/srv/db/ca_test.go index d1db4216a582c..dd3589cba4b91 100644 --- a/lib/srv/db/ca_test.go +++ b/lib/srv/db/ca_test.go @@ -21,6 +21,8 @@ import ( "net" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/fixtures" @@ -28,7 +30,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/mongodb" "github.com/gravitational/teleport/lib/srv/db/mysql" "github.com/gravitational/teleport/lib/srv/db/postgres" - "github.com/stretchr/testify/require" ) // TestInitCACert verifies automatic download of root certs for cloud databases. diff --git a/lib/srv/db/cloud/aws.go b/lib/srv/db/cloud/aws.go index 43e7da299c229..cce7e6cd41385 100644 --- a/lib/srv/db/cloud/aws.go +++ b/lib/srv/db/cloud/aws.go @@ -20,18 +20,17 @@ import ( "context" "encoding/json" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/cloud" - awslib "github.com/gravitational/teleport/lib/cloud/aws" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/iam/iamiface" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/rds/rdsiface" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/cloud" + awslib "github.com/gravitational/teleport/lib/cloud/aws" ) // awsConfig is the config for the client that configures IAM for AWS databases. diff --git a/lib/srv/db/cloud/gcp.go b/lib/srv/db/cloud/gcp.go index f99c48e14acc3..a7103d2300a03 100644 --- a/lib/srv/db/cloud/gcp.go +++ b/lib/srv/db/cloud/gcp.go @@ -20,9 +20,10 @@ import ( "context" "crypto/tls" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/cloud" "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/gravitational/trace" ) // GetGCPRequireSSL requests settings for the project/instance in session from GCP diff --git a/lib/srv/db/cloud/iam.go b/lib/srv/db/cloud/iam.go index 2b1c9eac9ca43..aff1c2867d6a2 100644 --- a/lib/srv/db/cloud/iam.go +++ b/lib/srv/db/cloud/iam.go @@ -24,7 +24,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/service/iam" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/retryutils" @@ -32,9 +34,6 @@ import ( "github.com/gravitational/teleport/lib/cloud" awslib "github.com/gravitational/teleport/lib/cloud/aws" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // IAMConfig is the IAM configurator config. diff --git a/lib/srv/db/cloud/iam_test.go b/lib/srv/db/cloud/iam_test.go index 790f4616adc7e..0b1a00cd329b9 100644 --- a/lib/srv/db/cloud/iam_test.go +++ b/lib/srv/db/cloud/iam_test.go @@ -22,23 +22,22 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth" - clients "github.com/gravitational/teleport/lib/cloud" - awslib "github.com/gravitational/teleport/lib/cloud/aws" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/services" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/redshift" - "github.com/google/uuid" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/auth" + clients "github.com/gravitational/teleport/lib/cloud" + awslib "github.com/gravitational/teleport/lib/cloud/aws" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/services" ) // TestAWSIAM tests RDS, Aurora and Redshift IAM auto-configuration. diff --git a/lib/srv/db/cloud/meta.go b/lib/srv/db/cloud/meta.go index 8aca442587f14..21ef68427f480 100644 --- a/lib/srv/db/cloud/meta.go +++ b/lib/srv/db/cloud/meta.go @@ -19,11 +19,6 @@ package cloud import ( "context" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/cloud" - "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/elasticache" @@ -34,9 +29,13 @@ import ( "github.com/aws/aws-sdk-go/service/rds/rdsiface" "github.com/aws/aws-sdk-go/service/redshift" "github.com/aws/aws-sdk-go/service/redshift/redshiftiface" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/cloud" + "github.com/gravitational/teleport/lib/services" + "github.com/gravitational/teleport/lib/srv/db/common" ) // MetadataConfig is the cloud metadata service config. diff --git a/lib/srv/db/cloud/meta_test.go b/lib/srv/db/cloud/meta_test.go index 470d42da76fef..b7220b4852846 100644 --- a/lib/srv/db/cloud/meta_test.go +++ b/lib/srv/db/cloud/meta_test.go @@ -20,16 +20,16 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/cloud" - "github.com/gravitational/teleport/lib/defaults" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/memorydb" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/redshift" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/cloud" + "github.com/gravitational/teleport/lib/defaults" ) // TestAWSMetadata tests fetching AWS metadata for RDS and Redshift databases. diff --git a/lib/srv/db/cloud/mocks.go b/lib/srv/db/cloud/mocks.go index 95c91970a76ad..499ec2246383c 100644 --- a/lib/srv/db/cloud/mocks.go +++ b/lib/srv/db/cloud/mocks.go @@ -35,10 +35,11 @@ import ( "github.com/aws/aws-sdk-go/service/redshift/redshiftiface" "github.com/aws/aws-sdk-go/service/sts" "github.com/aws/aws-sdk-go/service/sts/stsiface" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/trace" sqladmin "google.golang.org/api/sqladmin/v1beta4" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/tlsca" ) // STSMock mocks AWS STS API. diff --git a/lib/srv/db/cloud/users/helpers_test.go b/lib/srv/db/cloud/users/helpers_test.go index 309448da98e4c..2b6de87dbafd5 100644 --- a/lib/srv/db/cloud/users/helpers_test.go +++ b/lib/srv/db/cloud/users/helpers_test.go @@ -20,10 +20,11 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/api/utils" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/api/utils" ) func TestLookupMap(t *testing.T) { diff --git a/lib/srv/db/cloud/users/user.go b/lib/srv/db/cloud/users/user.go index e6132c5b57023..819e5d86badce 100644 --- a/lib/srv/db/cloud/users/user.go +++ b/lib/srv/db/cloud/users/user.go @@ -20,10 +20,11 @@ import ( "context" "time" - "github.com/gravitational/teleport/lib/srv/db/secrets" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/srv/db/secrets" ) // User represents a managed cloud database user. diff --git a/lib/srv/db/cloud/users/user_test.go b/lib/srv/db/cloud/users/user_test.go index dcac1a266dfae..2ce8331f1c0d7 100644 --- a/lib/srv/db/cloud/users/user_test.go +++ b/lib/srv/db/cloud/users/user_test.go @@ -22,11 +22,11 @@ import ( "testing" "time" - libsecrets "github.com/gravitational/teleport/lib/srv/db/secrets" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + libsecrets "github.com/gravitational/teleport/lib/srv/db/secrets" ) func TestBaseUser(t *testing.T) { diff --git a/lib/srv/db/cloud/users/users.go b/lib/srv/db/cloud/users/users.go index df386d36a54ac..0eac604c1d804 100644 --- a/lib/srv/db/cloud/users/users.go +++ b/lib/srv/db/cloud/users/users.go @@ -19,14 +19,14 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/retryutils" "github.com/gravitational/teleport/lib/cloud" "github.com/gravitational/teleport/lib/utils/interval" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" ) // Config is the config for users service. diff --git a/lib/srv/db/cloud/users/users_test.go b/lib/srv/db/cloud/users/users_test.go index f733aa343d26d..8412739b68700 100644 --- a/lib/srv/db/cloud/users/users_test.go +++ b/lib/srv/db/cloud/users/users_test.go @@ -25,6 +25,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/memorydb" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" @@ -34,7 +35,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/srv/db/cloud" libsecrets "github.com/gravitational/teleport/lib/srv/db/secrets" - "github.com/gravitational/trace" ) var managedTags = map[string]string{ diff --git a/lib/srv/db/cloud/watchers/azure.go b/lib/srv/db/cloud/watchers/azure.go index 4976c1c4f9058..1b87bf709c80c 100644 --- a/lib/srv/db/cloud/watchers/azure.go +++ b/lib/srv/db/cloud/watchers/azure.go @@ -20,6 +20,7 @@ import ( "context" "fmt" + "github.com/gravitational/trace" "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/types" @@ -28,7 +29,6 @@ import ( "github.com/gravitational/teleport/lib/cloud" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) // azureListClient defines an interface for a common Azure client that can list diff --git a/lib/srv/db/cloud/watchers/elasticache.go b/lib/srv/db/cloud/watchers/elasticache.go index 4c90b6d8cc7af..f0b8c0034d189 100644 --- a/lib/srv/db/cloud/watchers/elasticache.go +++ b/lib/srv/db/cloud/watchers/elasticache.go @@ -22,13 +22,12 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/elasticache/elasticacheiface" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/gravitational/trace" - - "github.com/sirupsen/logrus" ) // elastiCacheFetcherConfig is the ElastiCache databases fetcher configuration. diff --git a/lib/srv/db/cloud/watchers/rds.go b/lib/srv/db/cloud/watchers/rds.go index 653e5dded1eac..d178b71a0f978 100644 --- a/lib/srv/db/cloud/watchers/rds.go +++ b/lib/srv/db/cloud/watchers/rds.go @@ -20,16 +20,15 @@ import ( "context" "fmt" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/rds/rdsiface" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" + "github.com/gravitational/teleport/lib/srv/db/common" ) // rdsFetcherConfig is the RDS databases fetcher configuration. diff --git a/lib/srv/db/cloud/watchers/redshift.go b/lib/srv/db/cloud/watchers/redshift.go index 9c3157ac077be..93ed6a297038d 100644 --- a/lib/srv/db/cloud/watchers/redshift.go +++ b/lib/srv/db/cloud/watchers/redshift.go @@ -20,16 +20,15 @@ import ( "context" "fmt" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/gravitational/trace" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshift" "github.com/aws/aws-sdk-go/service/redshift/redshiftiface" - + "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" + "github.com/gravitational/teleport/lib/srv/db/common" ) // redshiftFetcherConfig is the Redshift databases fetcher configuration. diff --git a/lib/srv/db/cloud/watchers/watcher.go b/lib/srv/db/cloud/watchers/watcher.go index e6027b61a2e1c..775434d19e15b 100644 --- a/lib/srv/db/cloud/watchers/watcher.go +++ b/lib/srv/db/cloud/watchers/watcher.go @@ -20,13 +20,13 @@ import ( "context" "time" + "github.com/gravitational/trace" "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/cloud" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" ) // WatcherConfig is the cloud watcher configuration. diff --git a/lib/srv/db/common/audit.go b/lib/srv/db/common/audit.go index cafdc28237b1e..efd95afacb039 100644 --- a/lib/srv/db/common/audit.go +++ b/lib/srv/db/common/audit.go @@ -19,12 +19,12 @@ package common import ( "context" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types/events" libevents "github.com/gravitational/teleport/lib/events" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // Audit defines an interface for database access audit events logger. diff --git a/lib/srv/db/common/auth.go b/lib/srv/db/common/auth.go index bb5e4dae3d40c..5e12d967b6d1c 100644 --- a/lib/srv/db/common/auth.go +++ b/lib/srv/db/common/auth.go @@ -25,6 +25,17 @@ import ( "io" "time" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/rds/rdsutils" + "github.com/aws/aws-sdk-go/service/redshift" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + sqladmin "google.golang.org/api/sqladmin/v1beta4" + gcpcredentialspb "google.golang.org/genproto/googleapis/iam/credentials/v1" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" azureutils "github.com/gravitational/teleport/api/utils/azure" @@ -36,20 +47,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/rds/rdsutils" - "github.com/aws/aws-sdk-go/service/redshift" - - sqladmin "google.golang.org/api/sqladmin/v1beta4" - gcpcredentialspb "google.golang.org/genproto/googleapis/iam/credentials/v1" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" ) // azureVirtualMachineCacheTTL is the default TTL for Azure virtual machine diff --git a/lib/srv/db/common/auth_test.go b/lib/srv/db/common/auth_test.go index 2c8dd489cfa44..5c0359cb139e6 100644 --- a/lib/srv/db/common/auth_test.go +++ b/lib/srv/db/common/auth_test.go @@ -27,6 +27,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" @@ -37,7 +38,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/fixtures" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" ) func TestAuthGetAzureCacheForRedisToken(t *testing.T) { diff --git a/lib/srv/db/common/engines.go b/lib/srv/db/common/engines.go index f3d8f66a9c92d..8c155e941e7ce 100644 --- a/lib/srv/db/common/engines.go +++ b/lib/srv/db/common/engines.go @@ -20,12 +20,12 @@ import ( "context" "sync" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/cloud" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/cloud" ) var ( diff --git a/lib/srv/db/common/engines_test.go b/lib/srv/db/common/engines_test.go index d56dfe745be6a..091866226cca1 100644 --- a/lib/srv/db/common/engines_test.go +++ b/lib/srv/db/common/engines_test.go @@ -20,13 +20,13 @@ import ( "context" "testing" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/cloud" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/cloud" ) // TestRegisterEngine verifies database engine registration. diff --git a/lib/srv/db/common/errors.go b/lib/srv/db/common/errors.go index 4fc8fa8e0458e..a5c4ded0fe126 100644 --- a/lib/srv/db/common/errors.go +++ b/lib/srv/db/common/errors.go @@ -22,7 +22,6 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/go-mysql-org/go-mysql/mysql" "github.com/gravitational/trace" diff --git a/lib/srv/db/common/session.go b/lib/srv/db/common/session.go index 7e89e424fa2bf..56590ea53a284 100644 --- a/lib/srv/db/common/session.go +++ b/lib/srv/db/common/session.go @@ -19,11 +19,11 @@ package common import ( "fmt" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/sirupsen/logrus" ) // Session combines parameters for a database connection session. diff --git a/lib/srv/db/common/test.go b/lib/srv/db/common/test.go index 07b6b4afa5c09..990e119e0e44e 100644 --- a/lib/srv/db/common/test.go +++ b/lib/srv/db/common/test.go @@ -24,6 +24,8 @@ import ( "net" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" @@ -31,8 +33,6 @@ import ( "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" ) // TestServerConfig combines parameters for a test Postgres/MySQL server. diff --git a/lib/srv/db/elasticsearch/engine.go b/lib/srv/db/elasticsearch/engine.go index e0a97bc223200..bfdc93ab33742 100644 --- a/lib/srv/db/elasticsearch/engine.go +++ b/lib/srv/db/elasticsearch/engine.go @@ -30,6 +30,7 @@ import ( "strings" elastic "github.com/elastic/go-elasticsearch/v8/typedapi/types" + "github.com/ghodss/yaml" "github.com/gravitational/trace" "github.com/gravitational/teleport" @@ -40,8 +41,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/common/role" "github.com/gravitational/teleport/lib/utils" - - "github.com/ghodss/yaml" ) func init() { diff --git a/lib/srv/db/ha_test.go b/lib/srv/db/ha_test.go index 4ee485e2b5960..82a882e8eedd4 100644 --- a/lib/srv/db/ha_test.go +++ b/lib/srv/db/ha_test.go @@ -22,12 +22,12 @@ import ( "net" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/postgres" - - "github.com/stretchr/testify/require" ) // TestHA tests scenario with multiple database services proxying the same database. diff --git a/lib/srv/db/local_proxy_test.go b/lib/srv/db/local_proxy_test.go index bafa37f0163c2..ca0c45ed12535 100644 --- a/lib/srv/db/local_proxy_test.go +++ b/lib/srv/db/local_proxy_test.go @@ -20,12 +20,12 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/srv/db/postgres" - "github.com/jackc/pgconn" "github.com/stretchr/testify/require" "go.mongodb.org/mongo-driver/bson" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/srv/db/postgres" ) // TestLocalProxyPostgres verifies connecting to a Postgres database diff --git a/lib/srv/db/mongodb/connect.go b/lib/srv/db/mongodb/connect.go index 40e0114097fa6..91a86da0b989e 100644 --- a/lib/srv/db/mongodb/connect.go +++ b/lib/srv/db/mongodb/connect.go @@ -22,8 +22,7 @@ import ( "net/url" "time" - "github.com/gravitational/teleport/lib/srv/db/common" - + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/mongo/address" "go.mongodb.org/mongo-driver/mongo/description" "go.mongodb.org/mongo-driver/mongo/readpref" @@ -33,7 +32,7 @@ import ( "go.mongodb.org/mongo-driver/x/mongo/driver/ocsp" "go.mongodb.org/mongo-driver/x/mongo/driver/topology" - "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/srv/db/common" ) // connect returns connection to a MongoDB server. diff --git a/lib/srv/db/mongodb/engine.go b/lib/srv/db/mongodb/engine.go index d2bcd3994dbd1..929fc9c7edae7 100644 --- a/lib/srv/db/mongodb/engine.go +++ b/lib/srv/db/mongodb/engine.go @@ -20,16 +20,15 @@ import ( "context" "net" + "github.com/gravitational/trace" + "go.mongodb.org/mongo-driver/x/mongo/driver" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/common/role" "github.com/gravitational/teleport/lib/srv/db/mongodb/protocol" "github.com/gravitational/teleport/lib/utils" - - "go.mongodb.org/mongo-driver/x/mongo/driver" - - "github.com/gravitational/trace" ) func init() { diff --git a/lib/srv/db/mongodb/protocol/errors.go b/lib/srv/db/mongodb/protocol/errors.go index 7cc2cca1828f7..0a246cf3eff6b 100644 --- a/lib/srv/db/mongodb/protocol/errors.go +++ b/lib/srv/db/mongodb/protocol/errors.go @@ -19,10 +19,9 @@ package protocol import ( "net" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // ReplyError sends error wire message to the client. diff --git a/lib/srv/db/mongodb/protocol/message.go b/lib/srv/db/mongodb/protocol/message.go index da1c82a3adef5..d569ceaa1e0dd 100644 --- a/lib/srv/db/mongodb/protocol/message.go +++ b/lib/srv/db/mongodb/protocol/message.go @@ -23,10 +23,9 @@ import ( "io" "math" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/mongo/driver" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // Message defines common interface for MongoDB wire protocol messages. diff --git a/lib/srv/db/mongodb/protocol/message_test.go b/lib/srv/db/mongodb/protocol/message_test.go index 6e5526cc6592e..2396342e39d97 100644 --- a/lib/srv/db/mongodb/protocol/message_test.go +++ b/lib/srv/db/mongodb/protocol/message_test.go @@ -20,12 +20,11 @@ import ( "bytes" "testing" + "github.com/stretchr/testify/require" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/stretchr/testify/require" ) // TestOpMsgSingleBody verifies marshal/unmarshal for single-document OP_MSG wire message. diff --git a/lib/srv/db/mongodb/protocol/opcompressed.go b/lib/srv/db/mongodb/protocol/opcompressed.go index 06124208ad496..452ce0377ef31 100644 --- a/lib/srv/db/mongodb/protocol/opcompressed.go +++ b/lib/srv/db/mongodb/protocol/opcompressed.go @@ -19,11 +19,10 @@ package protocol import ( "bytes" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpCompressed represents parsed OP_COMPRESSED wire message. diff --git a/lib/srv/db/mongodb/protocol/opdelete.go b/lib/srv/db/mongodb/protocol/opdelete.go index d1458118d89fc..35d75717148ff 100644 --- a/lib/srv/db/mongodb/protocol/opdelete.go +++ b/lib/srv/db/mongodb/protocol/opdelete.go @@ -20,10 +20,9 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpDelete represents parsed OP_DELETE wire message. diff --git a/lib/srv/db/mongodb/protocol/opgetmore.go b/lib/srv/db/mongodb/protocol/opgetmore.go index df0e1e66323f4..8aade6c099b11 100644 --- a/lib/srv/db/mongodb/protocol/opgetmore.go +++ b/lib/srv/db/mongodb/protocol/opgetmore.go @@ -20,10 +20,9 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpGetMore represents parsed OP_GET_MORE wire message. diff --git a/lib/srv/db/mongodb/protocol/opinsert.go b/lib/srv/db/mongodb/protocol/opinsert.go index c17cedaf65ffc..2ed0500ac4203 100644 --- a/lib/srv/db/mongodb/protocol/opinsert.go +++ b/lib/srv/db/mongodb/protocol/opinsert.go @@ -20,10 +20,9 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpInsert represents parsed OP_INSERT wire message. diff --git a/lib/srv/db/mongodb/protocol/opkillcursors.go b/lib/srv/db/mongodb/protocol/opkillcursors.go index 2d975bf753426..71aa480d1ef01 100644 --- a/lib/srv/db/mongodb/protocol/opkillcursors.go +++ b/lib/srv/db/mongodb/protocol/opkillcursors.go @@ -19,10 +19,9 @@ package protocol import ( "fmt" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpKillCursors represents parsed OP_KILL_CURSORS wire message. diff --git a/lib/srv/db/mongodb/protocol/opmsg.go b/lib/srv/db/mongodb/protocol/opmsg.go index 08d5048bf84a1..cea373f148ca4 100644 --- a/lib/srv/db/mongodb/protocol/opmsg.go +++ b/lib/srv/db/mongodb/protocol/opmsg.go @@ -20,10 +20,9 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpMsg represents parsed OP_MSG wire message. diff --git a/lib/srv/db/mongodb/protocol/opquery.go b/lib/srv/db/mongodb/protocol/opquery.go index 05be124b98e10..40ae9619125c1 100644 --- a/lib/srv/db/mongodb/protocol/opquery.go +++ b/lib/srv/db/mongodb/protocol/opquery.go @@ -20,10 +20,9 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpQuery represents parsed OP_QUERY wire message. diff --git a/lib/srv/db/mongodb/protocol/opreply.go b/lib/srv/db/mongodb/protocol/opreply.go index fb0de96e16da8..d561042a15e0b 100644 --- a/lib/srv/db/mongodb/protocol/opreply.go +++ b/lib/srv/db/mongodb/protocol/opreply.go @@ -19,10 +19,9 @@ package protocol import ( "fmt" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpReply represents parsed OP_REPLY wire message. diff --git a/lib/srv/db/mongodb/protocol/opupdate.go b/lib/srv/db/mongodb/protocol/opupdate.go index 773f1f9625f3c..8664a262e12b9 100644 --- a/lib/srv/db/mongodb/protocol/opupdate.go +++ b/lib/srv/db/mongodb/protocol/opupdate.go @@ -20,10 +20,9 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" - - "github.com/gravitational/trace" ) // MessageOpUpdate represents parsed OP_UPDATE wire message. diff --git a/lib/srv/db/mongodb/test.go b/lib/srv/db/mongodb/test.go index e08476de97f76..667dc978764df 100644 --- a/lib/srv/db/mongodb/test.go +++ b/lib/srv/db/mongodb/test.go @@ -23,18 +23,17 @@ import ( "sync/atomic" "time" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/gravitational/teleport/lib/srv/db/mongodb/protocol" - "github.com/gravitational/teleport/lib/utils" - + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/srv/db/common" + "github.com/gravitational/teleport/lib/srv/db/mongodb/protocol" + "github.com/gravitational/teleport/lib/utils" ) // MakeTestClient returns MongoDB client connection according to the provided diff --git a/lib/srv/db/mysql/engine.go b/lib/srv/db/mysql/engine.go index f0c5b2816b391..57983b4db9e5d 100644 --- a/lib/srv/db/mysql/engine.go +++ b/lib/srv/db/mysql/engine.go @@ -27,6 +27,8 @@ import ( "github.com/go-mysql-org/go-mysql/mysql" "github.com/go-mysql-org/go-mysql/packet" "github.com/go-mysql-org/go-mysql/server" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/retryutils" @@ -37,9 +39,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/common/role" "github.com/gravitational/teleport/lib/srv/db/mysql/protocol" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) func init() { diff --git a/lib/srv/db/mysql/engine_test.go b/lib/srv/db/mysql/engine_test.go index de6f43e98ee6a..8444efb040e25 100644 --- a/lib/srv/db/mysql/engine_test.go +++ b/lib/srv/db/mysql/engine_test.go @@ -26,9 +26,10 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestFetchMySQLVersion(t *testing.T) { diff --git a/lib/srv/db/mysql/protocol/packet_test.go b/lib/srv/db/mysql/protocol/packet_test.go index 916349c568530..b9d8e13ab70cd 100644 --- a/lib/srv/db/mysql/protocol/packet_test.go +++ b/lib/srv/db/mysql/protocol/packet_test.go @@ -24,7 +24,6 @@ import ( "testing/iotest" "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) diff --git a/lib/srv/db/mysql/protocol/statement.go b/lib/srv/db/mysql/protocol/statement.go index cbf230122b5c8..7de703d412cf8 100644 --- a/lib/srv/db/mysql/protocol/statement.go +++ b/lib/srv/db/mysql/protocol/statement.go @@ -17,9 +17,8 @@ limitations under the License. package protocol import ( - "github.com/gravitational/trace" - "github.com/go-mysql-org/go-mysql/mysql" + "github.com/gravitational/trace" ) // StatementPreparePacket represents the COM_STMT_PREPARE command. diff --git a/lib/srv/db/mysql/proxy.go b/lib/srv/db/mysql/proxy.go index 67a6394f7f801..b65da8dce5828 100644 --- a/lib/srv/db/mysql/proxy.go +++ b/lib/srv/db/mysql/proxy.go @@ -22,6 +22,11 @@ import ( "net" "time" + "github.com/go-mysql-org/go-mysql/mysql" + "github.com/go-mysql-org/go-mysql/server" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/limiter" @@ -30,12 +35,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/dbutils" "github.com/gravitational/teleport/lib/srv/db/mysql/protocol" "github.com/gravitational/teleport/lib/utils" - - "github.com/go-mysql-org/go-mysql/mysql" - "github.com/go-mysql-org/go-mysql/server" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // Proxy proxies connections from MySQL clients to database services diff --git a/lib/srv/db/mysql/test.go b/lib/srv/db/mysql/test.go index 13c8a993540cd..d939154d52eb8 100644 --- a/lib/srv/db/mysql/test.go +++ b/lib/srv/db/mysql/test.go @@ -22,17 +22,16 @@ import ( "sync" "sync/atomic" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/teleport/lib/utils" - "github.com/go-mysql-org/go-mysql/client" "github.com/go-mysql-org/go-mysql/mysql" "github.com/go-mysql-org/go-mysql/server" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/srv/db/common" + "github.com/gravitational/teleport/lib/tlsca" + "github.com/gravitational/teleport/lib/utils" ) // MakeTestClient returns MySQL client connection according to the provided diff --git a/lib/srv/db/postgres/engine.go b/lib/srv/db/postgres/engine.go index 2ad9b98576ad7..7f36e22530115 100644 --- a/lib/srv/db/postgres/engine.go +++ b/lib/srv/db/postgres/engine.go @@ -22,18 +22,17 @@ import ( "fmt" "net" + "github.com/gravitational/trace" + "github.com/jackc/pgconn" + "github.com/jackc/pgproto3/v2" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/srv/db/cloud" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/common/role" "github.com/gravitational/teleport/lib/utils" - - "github.com/jackc/pgconn" - "github.com/jackc/pgproto3/v2" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) func init() { diff --git a/lib/srv/db/postgres/proxy.go b/lib/srv/db/postgres/proxy.go index f4c22560d3da0..10c21384169b0 100644 --- a/lib/srv/db/postgres/proxy.go +++ b/lib/srv/db/postgres/proxy.go @@ -21,16 +21,15 @@ import ( "crypto/tls" "net" + "github.com/gravitational/trace" + "github.com/jackc/pgproto3/v2" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/limiter" "github.com/gravitational/teleport/lib/srv/alpnproxy" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/utils" - - "github.com/jackc/pgproto3/v2" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // Proxy proxies connections from Postgres clients to database services diff --git a/lib/srv/db/postgres/test.go b/lib/srv/db/postgres/test.go index 12032ec5ef3c7..8179e3f237fca 100644 --- a/lib/srv/db/postgres/test.go +++ b/lib/srv/db/postgres/test.go @@ -23,16 +23,15 @@ import ( "net" "sync/atomic" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/gravitational/teleport/lib/utils" - + "github.com/gravitational/trace" "github.com/jackc/pgconn" "github.com/jackc/pgerrcode" "github.com/jackc/pgproto3/v2" - - "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/srv/db/common" + "github.com/gravitational/teleport/lib/utils" ) // MakeTestClient returns Postgres client connection according to the provided diff --git a/lib/srv/db/proxyserver.go b/lib/srv/db/proxyserver.go index c73b1c838519a..a83b0e219d190 100644 --- a/lib/srv/db/proxyserver.go +++ b/lib/srv/db/proxyserver.go @@ -29,6 +29,10 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/constants" @@ -50,10 +54,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/sqlserver" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" ) // ProxyServer runs inside Teleport proxy and is responsible to accepting diff --git a/lib/srv/db/proxyserver_test.go b/lib/srv/db/proxyserver_test.go index 86baab4f681e9..769f8c973b792 100644 --- a/lib/srv/db/proxyserver_test.go +++ b/lib/srv/db/proxyserver_test.go @@ -21,10 +21,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/limiter" "github.com/gravitational/teleport/lib/srv/db/mysql" - "github.com/stretchr/testify/require" ) func TestProxyConnectionLimiting(t *testing.T) { diff --git a/lib/srv/db/redis/client.go b/lib/srv/db/redis/client.go index d6787e8b97207..60d1f9e3dec47 100644 --- a/lib/srv/db/redis/client.go +++ b/lib/srv/db/redis/client.go @@ -28,12 +28,13 @@ import ( "sync" "github.com/go-redis/redis/v9" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/common/role" "github.com/gravitational/teleport/lib/srv/db/redis/protocol" - "github.com/gravitational/trace" ) // Commands with additional processing in Teleport when using cluster mode. diff --git a/lib/srv/db/redis/cmds.go b/lib/srv/db/redis/cmds.go index 9ce4db8f44ae4..8fe9db1261e4e 100644 --- a/lib/srv/db/redis/cmds.go +++ b/lib/srv/db/redis/cmds.go @@ -25,13 +25,14 @@ import ( "strings" "github.com/go-redis/redis/v9" + "github.com/gravitational/trace" + apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/common/role" "github.com/gravitational/teleport/lib/srv/db/redis/protocol" - "github.com/gravitational/trace" ) // List of commands that Teleport handles in a special way by Redis standalone and cluster. diff --git a/lib/srv/db/redis/test.go b/lib/srv/db/redis/test.go index 5151e56b818f2..74e31666da7e9 100644 --- a/lib/srv/db/redis/test.go +++ b/lib/srv/db/redis/test.go @@ -24,11 +24,12 @@ import ( "github.com/alicebob/miniredis/v2" "github.com/go-redis/redis/v9" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/trace" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/srv/db/common" ) // Client alias for easier use. diff --git a/lib/srv/db/server.go b/lib/srv/db/server.go index 716c3b5db9b00..bd1a963f714ef 100644 --- a/lib/srv/db/server.go +++ b/lib/srv/db/server.go @@ -16,6 +16,7 @@ limitations under the License. package db +//nolint:goimports import ( "context" "crypto/tls" @@ -23,6 +24,11 @@ import ( "sync" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -36,27 +42,21 @@ import ( "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv" + // Import to register Cassandra engine. + _ "github.com/gravitational/teleport/lib/srv/db/cassandra" "github.com/gravitational/teleport/lib/srv/db/cloud" "github.com/gravitational/teleport/lib/srv/db/cloud/users" "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/gravitational/teleport/lib/srv/db/mysql" - "github.com/gravitational/teleport/lib/utils" - + // Import to register Elasticsearch engine. + _ "github.com/gravitational/teleport/lib/srv/db/elasticsearch" // Import to register MongoDB engine. _ "github.com/gravitational/teleport/lib/srv/db/mongodb" + "github.com/gravitational/teleport/lib/srv/db/mysql" // Import to register Postgres engine. _ "github.com/gravitational/teleport/lib/srv/db/postgres" // Import to register Snowflake engine. _ "github.com/gravitational/teleport/lib/srv/db/snowflake" - // Import to register Cassandra engine. - _ "github.com/gravitational/teleport/lib/srv/db/cassandra" - // Import to register Elasticsearch engine. - _ "github.com/gravitational/teleport/lib/srv/db/elasticsearch" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/lib/utils" ) // Config is the configuration for a database proxy server. diff --git a/lib/srv/db/snowflake/http.go b/lib/srv/db/snowflake/http.go index 2bae89928a172..ceb91422dcfb0 100644 --- a/lib/srv/db/snowflake/http.go +++ b/lib/srv/db/snowflake/http.go @@ -26,8 +26,9 @@ import ( "net/http" "strings" - "github.com/gravitational/teleport" "github.com/gravitational/trace" + + "github.com/gravitational/teleport" ) func writeResponse(resp *http.Response, newResp []byte) (*bytes.Buffer, error) { diff --git a/lib/srv/db/snowflake/test.go b/lib/srv/db/snowflake/test.go index 47bcd41e9cb29..11aa67ae27b20 100644 --- a/lib/srv/db/snowflake/test.go +++ b/lib/srv/db/snowflake/test.go @@ -18,6 +18,7 @@ package snowflake +//nolint:goimports import ( "context" "crypto/tls" @@ -31,16 +32,16 @@ import ( "net/http/httptest" "strconv" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/jwt" - "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" - // Register Snowflake database driver. _ "github.com/snowflakedb/gosnowflake" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/jwt" + "github.com/gravitational/teleport/lib/srv/db/common" ) // TestServerOption allows setting test server options. diff --git a/lib/srv/db/snowflake_test.go b/lib/srv/db/snowflake_test.go index 04aa6960ea27d..c45f5c45f4726 100644 --- a/lib/srv/db/snowflake_test.go +++ b/lib/srv/db/snowflake_test.go @@ -32,13 +32,14 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" libevents "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/srv/alpnproxy" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/snowflake" - "github.com/stretchr/testify/require" ) func init() { diff --git a/lib/srv/db/sqlserver/auth.go b/lib/srv/db/sqlserver/auth.go index 908bfba85610f..cbe2f06f37f03 100644 --- a/lib/srv/db/sqlserver/auth.go +++ b/lib/srv/db/sqlserver/auth.go @@ -17,14 +17,13 @@ limitations under the License. package sqlserver import ( - "github.com/gravitational/teleport/lib/srv/db/common" - + "github.com/gravitational/trace" "github.com/jcmturner/gokrb5/v8/client" "github.com/jcmturner/gokrb5/v8/config" "github.com/jcmturner/gokrb5/v8/keytab" "github.com/jcmturner/gokrb5/v8/spnego" - "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/srv/db/common" ) // getAuth returns Kerberos authenticator used by SQL Server driver. diff --git a/lib/srv/db/sqlserver/engine.go b/lib/srv/db/sqlserver/engine.go index 23332009b570d..922f6e75aa907 100644 --- a/lib/srv/db/sqlserver/engine.go +++ b/lib/srv/db/sqlserver/engine.go @@ -21,6 +21,8 @@ import ( "io" "net" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/defaults" libevents "github.com/gravitational/teleport/lib/events" @@ -28,8 +30,6 @@ import ( "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/sqlserver/protocol" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) func init() { diff --git a/lib/srv/db/sqlserver/proxy.go b/lib/srv/db/sqlserver/proxy.go index 439c5bef93218..10b85a6298148 100644 --- a/lib/srv/db/sqlserver/proxy.go +++ b/lib/srv/db/sqlserver/proxy.go @@ -20,12 +20,12 @@ import ( "context" "net" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/sqlserver/protocol" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // Proxy accepts connections from SQL Server clients, performs a Pre-Login diff --git a/lib/srv/db/sqlserver/test.go b/lib/srv/db/sqlserver/test.go index c84f16da6df1e..1696794201f7a 100644 --- a/lib/srv/db/sqlserver/test.go +++ b/lib/srv/db/sqlserver/test.go @@ -22,16 +22,15 @@ import ( "net" "strconv" + mssql "github.com/denisenkom/go-mssqldb" + "github.com/denisenkom/go-mssqldb/msdsn" + "github.com/gravitational/trace" "github.com/sirupsen/logrus" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/srv/db/sqlserver/protocol" "github.com/gravitational/teleport/lib/utils" - - mssql "github.com/denisenkom/go-mssqldb" - "github.com/denisenkom/go-mssqldb/msdsn" - "github.com/gravitational/trace" ) // MakeTestClient returns SQL Server client used in tests. diff --git a/lib/srv/db/streamer.go b/lib/srv/db/streamer.go index fd6e33c82a073..f6bdb208afb4a 100644 --- a/lib/srv/db/streamer.go +++ b/lib/srv/db/streamer.go @@ -21,6 +21,8 @@ import ( "os" "path/filepath" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -30,8 +32,6 @@ import ( "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/srv/db/common" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // newStreamWriter creates a streamer that will be used to stream the diff --git a/lib/srv/db/watcher.go b/lib/srv/db/watcher.go index 3be5241d87c13..6e3c7df48330f 100644 --- a/lib/srv/db/watcher.go +++ b/lib/srv/db/watcher.go @@ -19,12 +19,12 @@ package db import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv/db/cloud/watchers" - - "github.com/gravitational/trace" ) // startReconciler starts reconciler that registers/unregisters proxied diff --git a/lib/srv/db/watcher_test.go b/lib/srv/db/watcher_test.go index 1408fabe8b6a2..0916fd3a47324 100644 --- a/lib/srv/db/watcher_test.go +++ b/lib/srv/db/watcher_test.go @@ -22,13 +22,13 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/services" - "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/services" ) // TestWatcher verifies that database server properly detects and applies diff --git a/lib/srv/desktop/audit.go b/lib/srv/desktop/audit.go index 1989fbf7a3053..1eb38543bce9c 100644 --- a/lib/srv/desktop/audit.go +++ b/lib/srv/desktop/audit.go @@ -20,11 +20,12 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/types/events" libevents "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" ) func (s *WindowsService) onSessionStart(ctx context.Context, emitter events.Emitter, id *tlsca.Identity, startTime time.Time, windowsUser, sessionID string, desktop types.WindowsDesktop, err error) { diff --git a/lib/srv/desktop/audit_test.go b/lib/srv/desktop/audit_test.go index 1bad4d6f440b6..6bf1afbdb5fe5 100644 --- a/lib/srv/desktop/audit_test.go +++ b/lib/srv/desktop/audit_test.go @@ -23,15 +23,16 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/types/events" libevents "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/events/eventstest" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) func setup() (*WindowsService, *tlsca.Identity, *eventstest.MockEmitter) { diff --git a/lib/srv/desktop/discovery.go b/lib/srv/desktop/discovery.go index 6764d3f028e4a..45a10df136d4b 100644 --- a/lib/srv/desktop/discovery.go +++ b/lib/srv/desktop/discovery.go @@ -22,12 +22,13 @@ import ( "time" "github.com/go-ldap/ldap/v3" + "github.com/gravitational/trace" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) // computerAttributes are the attributes we fetch when discovering diff --git a/lib/srv/desktop/discovery_test.go b/lib/srv/desktop/discovery_test.go index aa83c2c0b3740..881c4f75b4503 100644 --- a/lib/srv/desktop/discovery_test.go +++ b/lib/srv/desktop/discovery_test.go @@ -19,8 +19,9 @@ import ( "testing" "github.com/go-ldap/ldap/v3" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) // TestDiscoveryLDAPFilter verifies that WindowsService produces a valid diff --git a/lib/srv/desktop/rdp/rdpclient/client_common.go b/lib/srv/desktop/rdp/rdpclient/client_common.go index 9373a699862b0..13c42aa7e0dd5 100644 --- a/lib/srv/desktop/rdp/rdpclient/client_common.go +++ b/lib/srv/desktop/rdp/rdpclient/client_common.go @@ -22,9 +22,10 @@ import ( "image/png" "time" - "github.com/gravitational/teleport/lib/srv/desktop/tdp" "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/srv/desktop/tdp" ) // Config for creating a new Client. diff --git a/lib/srv/desktop/tdp/conn.go b/lib/srv/desktop/tdp/conn.go index 07162cdfa1019..eb7f1b16dd784 100644 --- a/lib/srv/desktop/tdp/conn.go +++ b/lib/srv/desktop/tdp/conn.go @@ -22,8 +22,9 @@ import ( "net" "sync" - "github.com/gravitational/teleport/lib/srv" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/srv" ) // Conn is a desktop protocol connection. diff --git a/lib/srv/desktop/windows_server.go b/lib/srv/desktop/windows_server.go index 79f3e0b73ef7e..a11c5e7cd63c8 100644 --- a/lib/srv/desktop/windows_server.go +++ b/lib/srv/desktop/windows_server.go @@ -35,11 +35,10 @@ import ( "time" "github.com/go-ldap/ldap/v3" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" - "github.com/gravitational/trace" - "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" diff --git a/lib/srv/desktop/windows_server_test.go b/lib/srv/desktop/windows_server_test.go index bc6a05afa575b..2562af93817bf 100644 --- a/lib/srv/desktop/windows_server_test.go +++ b/lib/srv/desktop/windows_server_test.go @@ -23,15 +23,16 @@ import ( "testing" "time" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/auth" libevents "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/events/eventstest" "github.com/gravitational/teleport/lib/srv/desktop/tdp" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) func TestConfigWildcardBaseDN(t *testing.T) { diff --git a/lib/srv/discovery/discovery.go b/lib/srv/discovery/discovery.go index d0da00146a96b..e6bbb39be99db 100644 --- a/lib/srv/discovery/discovery.go +++ b/lib/srv/discovery/discovery.go @@ -23,6 +23,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" @@ -33,8 +36,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv/discovery/fetchers" "github.com/gravitational/teleport/lib/srv/server" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // Config provides configuration for the discovery server. diff --git a/lib/srv/discovery/discovery_test.go b/lib/srv/discovery/discovery_test.go index 77e60ffb25249..2353fef725535 100644 --- a/lib/srv/discovery/discovery_test.go +++ b/lib/srv/discovery/discovery_test.go @@ -36,6 +36,9 @@ import ( "github.com/aws/aws-sdk-go/service/eks/eksiface" "github.com/aws/aws-sdk-go/service/ssm" "github.com/aws/aws-sdk-go/service/ssm/ssmiface" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/types/events" @@ -45,8 +48,6 @@ import ( "github.com/gravitational/teleport/lib/cloud/azure" libevents "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/services" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) type mockSSMClient struct { diff --git a/lib/srv/discovery/fetchers/aks.go b/lib/srv/discovery/fetchers/aks.go index 47f8fc3340340..4ab8eea99e754 100644 --- a/lib/srv/discovery/fetchers/aks.go +++ b/lib/srv/discovery/fetchers/aks.go @@ -19,12 +19,13 @@ package fetchers import ( "context" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/cloud/azure" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) type aksFetcher struct { diff --git a/lib/srv/discovery/fetchers/aks_test.go b/lib/srv/discovery/fetchers/aks_test.go index 130857ff60c25..29d8f2285e10e 100644 --- a/lib/srv/discovery/fetchers/aks_test.go +++ b/lib/srv/discovery/fetchers/aks_test.go @@ -20,11 +20,12 @@ import ( "context" "testing" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/cloud/azure" "github.com/gravitational/teleport/lib/services" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) func TestAKSFetcher(t *testing.T) { diff --git a/lib/srv/discovery/fetchers/eks.go b/lib/srv/discovery/fetchers/eks.go index b76ed8d13111a..d974e9e3542d7 100644 --- a/lib/srv/discovery/fetchers/eks.go +++ b/lib/srv/discovery/fetchers/eks.go @@ -20,15 +20,15 @@ import ( "context" "sync" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/eks/eksiface" + "github.com/gravitational/trace" "github.com/sirupsen/logrus" "golang.org/x/sync/errgroup" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" ) const ( diff --git a/lib/srv/discovery/fetchers/eks_test.go b/lib/srv/discovery/fetchers/eks_test.go index 5e61427f560ae..d208f969b286d 100644 --- a/lib/srv/discovery/fetchers/eks_test.go +++ b/lib/srv/discovery/fetchers/eks_test.go @@ -25,10 +25,11 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/eks/eksiface" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" ) func TestEKSFetcher(t *testing.T) { diff --git a/lib/srv/discovery/kube_watcher.go b/lib/srv/discovery/kube_watcher.go index c9bfd78b7ee36..2e5cc4778b202 100644 --- a/lib/srv/discovery/kube_watcher.go +++ b/lib/srv/discovery/kube_watcher.go @@ -21,10 +21,11 @@ import ( "sync" "time" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/services" "github.com/gravitational/trace" "golang.org/x/sync/errgroup" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/services" ) const ( diff --git a/lib/srv/exec.go b/lib/srv/exec.go index 618806829cdfd..4307f8a98f915 100644 --- a/lib/srv/exec.go +++ b/lib/srv/exec.go @@ -29,6 +29,8 @@ import ( "syscall" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -37,9 +39,6 @@ import ( apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) const ( diff --git a/lib/srv/exec_linux_test.go b/lib/srv/exec_linux_test.go index 1cc058c28e4d8..6f5269c97c94a 100644 --- a/lib/srv/exec_linux_test.go +++ b/lib/srv/exec_linux_test.go @@ -29,8 +29,9 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/utils" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils" ) // TestMain will re-execute Teleport to run a command if "exec" is passed to diff --git a/lib/srv/exec_test.go b/lib/srv/exec_test.go index cea942ba56bf4..042ee4fcbae42 100644 --- a/lib/srv/exec_test.go +++ b/lib/srv/exec_test.go @@ -23,11 +23,12 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/sshutils" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) // TestEmitExecAuditEvent make sure the full command and exit code for a diff --git a/lib/srv/forward/sshserver.go b/lib/srv/forward/sshserver.go index bf86f50ab7db1..f2736eba5fcb2 100644 --- a/lib/srv/forward/sshserver.go +++ b/lib/srv/forward/sshserver.go @@ -23,6 +23,12 @@ import ( "net" "sync" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + semconv "go.opentelemetry.io/otel/semconv/v1.10.0" + oteltrace "go.opentelemetry.io/otel/trace" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" @@ -43,13 +49,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils/x11" "github.com/gravitational/teleport/lib/teleagent" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - semconv "go.opentelemetry.io/otel/semconv/v1.10.0" - oteltrace "go.opentelemetry.io/otel/trace" ) // Server is a forwarding server. Server is used to create a single in-memory diff --git a/lib/srv/forward/subsystem.go b/lib/srv/forward/subsystem.go index 782a6624f1ce7..f0d0417d0daa0 100644 --- a/lib/srv/forward/subsystem.go +++ b/lib/srv/forward/subsystem.go @@ -20,16 +20,14 @@ import ( "context" "io" - "golang.org/x/crypto/ssh" - "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/srv" - - log "github.com/sirupsen/logrus" ) // remoteSubsystem is a subsystem that executes on a remote node. diff --git a/lib/srv/heartbeat.go b/lib/srv/heartbeat.go index e9a85b4869bc8..c649517b0a3f5 100644 --- a/lib/srv/heartbeat.go +++ b/lib/srv/heartbeat.go @@ -21,14 +21,14 @@ import ( "fmt" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" ) // HeartbeatI abstracts over the basic interfact of Heartbeat and HeartbeatV2. This can be removed diff --git a/lib/srv/heartbeat_test.go b/lib/srv/heartbeat_test.go index ba960706a1cca..d2b1d51e495cd 100644 --- a/lib/srv/heartbeat_test.go +++ b/lib/srv/heartbeat_test.go @@ -21,14 +21,13 @@ import ( "testing" "time" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" - - "github.com/gravitational/trace" ) // TestHeartbeatKeepAlive tests keep alive cycle used for nodes and apps. diff --git a/lib/srv/heartbeatv2.go b/lib/srv/heartbeatv2.go index da4e19cc8304f..0bccf39aed2f7 100644 --- a/lib/srv/heartbeatv2.go +++ b/lib/srv/heartbeatv2.go @@ -20,6 +20,9 @@ import ( "context" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -30,9 +33,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/utils/interval" - - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) // SSHServerHeartbeatConfig configures the HeartbeatV2 for an ssh server. diff --git a/lib/srv/heartbeatv2_test.go b/lib/srv/heartbeatv2_test.go index e75d29eca8708..7882e0197c821 100644 --- a/lib/srv/heartbeatv2_test.go +++ b/lib/srv/heartbeatv2_test.go @@ -23,13 +23,13 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/inventory" - - "github.com/stretchr/testify/require" ) type fakeHeartbeatDriver struct { diff --git a/lib/srv/keepalive.go b/lib/srv/keepalive.go index 19e8d83518a76..a8c537d331e81 100644 --- a/lib/srv/keepalive.go +++ b/lib/srv/keepalive.go @@ -20,12 +20,11 @@ import ( "context" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/defaults" ) // RequestSender is an interface that implements SendRequest. It is used so diff --git a/lib/srv/keepalive_test.go b/lib/srv/keepalive_test.go index 5218c2ed46d82..1c902f174cc66 100644 --- a/lib/srv/keepalive_test.go +++ b/lib/srv/keepalive_test.go @@ -23,7 +23,6 @@ import ( "time" "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) diff --git a/lib/srv/mock.go b/lib/srv/mock.go index f797f915c9e9d..4d6cb3b13288e 100644 --- a/lib/srv/mock.go +++ b/lib/srv/mock.go @@ -25,6 +25,12 @@ import ( "os/user" "testing" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" @@ -41,11 +47,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) func newTestServerContext(t *testing.T, srv Server, roleSet services.RoleSet) *ServerContext { diff --git a/lib/srv/monitor.go b/lib/srv/monitor.go index e8f6b2c3f15c6..696948ebb131e 100644 --- a/lib/srv/monitor.go +++ b/lib/srv/monitor.go @@ -24,16 +24,16 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + log "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - log "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) // ActivityTracker is a connection activity tracker, diff --git a/lib/srv/reexec.go b/lib/srv/reexec.go index dc02af35796f1..0ca8455e76653 100644 --- a/lib/srv/reexec.go +++ b/lib/srv/reexec.go @@ -33,6 +33,7 @@ import ( "time" "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/auditd" @@ -42,8 +43,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/sshutils/x11" "github.com/gravitational/teleport/lib/utils" - - log "github.com/sirupsen/logrus" ) // FileFD is a file descriptor passed down from a parent process when diff --git a/lib/srv/regular/get_home_dir.go b/lib/srv/regular/get_home_dir.go index 5b557c45666d8..6cbe55d05e6a5 100644 --- a/lib/srv/regular/get_home_dir.go +++ b/lib/srv/regular/get_home_dir.go @@ -23,10 +23,10 @@ import ( "os/user" "strings" - "github.com/gravitational/teleport/lib/srv" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/lib/srv" ) type homeDirSubsys struct { diff --git a/lib/srv/regular/proxy.go b/lib/srv/regular/proxy.go index 4c065be40a3d6..037b73e1fbf35 100644 --- a/lib/srv/regular/proxy.go +++ b/lib/srv/regular/proxy.go @@ -27,6 +27,10 @@ import ( "strings" "sync" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" @@ -42,11 +46,6 @@ import ( "github.com/gravitational/teleport/lib/srv" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/prometheus/client_golang/prometheus" - "github.com/sirupsen/logrus" ) var ( // failedConnectingToNode counts failed attempts to connect to a node diff --git a/lib/srv/regular/sftp.go b/lib/srv/regular/sftp.go index 5505443158f1b..25c10669cdac4 100644 --- a/lib/srv/regular/sftp.go +++ b/lib/srv/regular/sftp.go @@ -25,14 +25,14 @@ import ( "os/exec" "github.com/gogo/protobuf/jsonpb" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/srv" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) // number of goroutines that copy SFTP data from a SSH channel to diff --git a/lib/srv/regular/sites.go b/lib/srv/regular/sites.go index 38778d45fd91c..d4ad0cbfff110 100644 --- a/lib/srv/regular/sites.go +++ b/lib/srv/regular/sites.go @@ -20,12 +20,11 @@ import ( "context" "encoding/json" + "github.com/gravitational/trace" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/srv" - - "github.com/gravitational/trace" ) // proxySubsys is an SSH subsystem for easy proxyneling through proxy server diff --git a/lib/srv/regular/sshserver.go b/lib/srv/regular/sshserver.go index c1087644447bd..65b587e867140 100644 --- a/lib/srv/regular/sshserver.go +++ b/lib/srv/regular/sshserver.go @@ -30,6 +30,14 @@ import ( "strings" "sync" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" + semconv "go.opentelemetry.io/otel/semconv/v1.10.0" + oteltrace "go.opentelemetry.io/otel/trace" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -56,14 +64,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils/x11" "github.com/gravitational/teleport/lib/teleagent" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/prometheus/client_golang/prometheus" - "github.com/sirupsen/logrus" - semconv "go.opentelemetry.io/otel/semconv/v1.10.0" - oteltrace "go.opentelemetry.io/otel/trace" - "golang.org/x/crypto/ssh" ) const sftpSubsystem = "sftp" diff --git a/lib/srv/regular/sshserver_test.go b/lib/srv/regular/sshserver_test.go index 1cfebbf64e514..d8d86c91e0e2e 100644 --- a/lib/srv/regular/sshserver_test.go +++ b/lib/srv/regular/sshserver_test.go @@ -36,7 +36,12 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" "github.com/mailgun/timetools" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" @@ -63,13 +68,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/sshutils/x11" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" - - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) // teleportTestUser is additional user used for tests diff --git a/lib/srv/server/cloudwatcher.go b/lib/srv/server/cloudwatcher.go index 7fc8075fa035a..5dd23d699f041 100644 --- a/lib/srv/server/cloudwatcher.go +++ b/lib/srv/server/cloudwatcher.go @@ -23,12 +23,13 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/cloud" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/srv/db/common" - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) const ( diff --git a/lib/srv/server/cloudwatcher_test.go b/lib/srv/server/cloudwatcher_test.go index 6aa7a26e164b9..8b62188f9e9c2 100644 --- a/lib/srv/server/cloudwatcher_test.go +++ b/lib/srv/server/cloudwatcher_test.go @@ -24,10 +24,11 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/cloud" "github.com/gravitational/teleport/lib/services" - "github.com/stretchr/testify/require" ) type mockClients struct { diff --git a/lib/srv/server/ssm_install.go b/lib/srv/server/ssm_install.go index 75c522002a820..e55d07d7bc415 100644 --- a/lib/srv/server/ssm_install.go +++ b/lib/srv/server/ssm_install.go @@ -26,11 +26,12 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ssm" "github.com/aws/aws-sdk-go/service/ssm/ssmiface" + "github.com/gravitational/trace" + "golang.org/x/sync/errgroup" + "github.com/gravitational/teleport/api/types/events" apievents "github.com/gravitational/teleport/api/types/events" libevents "github.com/gravitational/teleport/lib/events" - "github.com/gravitational/trace" - "golang.org/x/sync/errgroup" ) // SSMInstallerConfig represents configuration for an SSM install diff --git a/lib/srv/server/ssm_install_test.go b/lib/srv/server/ssm_install_test.go index 51b83ab3400b2..b1c274aaba910 100644 --- a/lib/srv/server/ssm_install_test.go +++ b/lib/srv/server/ssm_install_test.go @@ -26,9 +26,10 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ssm" "github.com/aws/aws-sdk-go/service/ssm/ssmiface" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types/events" libevent "github.com/gravitational/teleport/lib/events" - "github.com/stretchr/testify/require" ) type mockSSMClient struct { diff --git a/lib/srv/sess_test.go b/lib/srv/sess_test.go index 261094124ef73..31dcb3b2b0bd3 100644 --- a/lib/srv/sess_test.go +++ b/lib/srv/sess_test.go @@ -22,6 +22,12 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -32,12 +38,6 @@ import ( "github.com/gravitational/teleport/lib/modules" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" ) func TestParseAccessRequestIDs(t *testing.T) { diff --git a/lib/srv/sessiontracker.go b/lib/srv/sessiontracker.go index 872b0f9ae1137..bfd7f5b9a2e58 100644 --- a/lib/srv/sessiontracker.go +++ b/lib/srv/sessiontracker.go @@ -21,13 +21,13 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" - "github.com/jonboulle/clockwork" - - "github.com/gravitational/trace" ) // SessionTracker is a session tracker for a specific session. It tracks diff --git a/lib/srv/sessiontracker_test.go b/lib/srv/sessiontracker_test.go index 5f903fb599c9a..e78d322c94bcc 100644 --- a/lib/srv/sessiontracker_test.go +++ b/lib/srv/sessiontracker_test.go @@ -21,12 +21,12 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" ) func TestSessionTracker(t *testing.T) { diff --git a/lib/srv/term_test.go b/lib/srv/term_test.go index 7c86c03ab1331..e54cce723f308 100644 --- a/lib/srv/term_test.go +++ b/lib/srv/term_test.go @@ -22,7 +22,6 @@ import ( "testing" "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) diff --git a/lib/srv/termhandlers.go b/lib/srv/termhandlers.go index 1c78586e867f6..df8617bc636a2 100644 --- a/lib/srv/termhandlers.go +++ b/lib/srv/termhandlers.go @@ -20,9 +20,8 @@ import ( "context" "encoding/json" - "golang.org/x/crypto/ssh" - "github.com/gravitational/trace" + "golang.org/x/crypto/ssh" rsession "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/sshutils" diff --git a/lib/srv/uacc/uacc_linux.go b/lib/srv/uacc/uacc_linux.go index 076d4838c09b2..b270d1acd6bf9 100644 --- a/lib/srv/uacc/uacc_linux.go +++ b/lib/srv/uacc/uacc_linux.go @@ -31,9 +31,9 @@ import ( "time" "unsafe" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) // Due to thread safety design in glibc we must serialize all access to the accounting database. diff --git a/lib/srv/usermgmt_linux.go b/lib/srv/usermgmt_linux.go index 930d63cac42f7..6caecaad8d172 100644 --- a/lib/srv/usermgmt_linux.go +++ b/lib/srv/usermgmt_linux.go @@ -22,9 +22,10 @@ import ( "os/user" "path/filepath" - "github.com/gravitational/teleport/lib/utils/host" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/utils/host" ) // HostUsersProvisioningBackend is used to implement HostUsersBackend diff --git a/lib/srv/usermgmt_test.go b/lib/srv/usermgmt_test.go index c3289ddb475e8..ec08b0519671a 100644 --- a/lib/srv/usermgmt_test.go +++ b/lib/srv/usermgmt_test.go @@ -23,13 +23,14 @@ import ( "strings" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/backend/memory" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/services/local" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) type testHostUserBackend struct { diff --git a/lib/sshutils/authority.go b/lib/sshutils/authority.go index f24a64a058499..0f52232db2625 100644 --- a/lib/sshutils/authority.go +++ b/lib/sshutils/authority.go @@ -17,10 +17,10 @@ limitations under the License. package sshutils import ( - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/types" ) // GetCheckers returns public keys that can be used to check cert authorities diff --git a/lib/sshutils/ctx.go b/lib/sshutils/ctx.go index 32584270cc3fa..721e8396c6053 100644 --- a/lib/sshutils/ctx.go +++ b/lib/sshutils/ctx.go @@ -23,13 +23,12 @@ import ( "sync" "time" - "github.com/gravitational/teleport/lib/teleagent" + "github.com/gravitational/trace" "github.com/jonboulle/clockwork" - "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" - "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/teleagent" ) // ConnectionContext manages connection-level state. diff --git a/lib/sshutils/req.go b/lib/sshutils/req.go index e75afc774c8f1..7a543f0b683fb 100644 --- a/lib/sshutils/req.go +++ b/lib/sshutils/req.go @@ -19,11 +19,10 @@ package sshutils import ( "encoding/binary" + "github.com/gravitational/trace" "golang.org/x/crypto/ssh" "github.com/gravitational/teleport" - - "github.com/gravitational/trace" ) // EnvReqParams are parameters for env request diff --git a/lib/sshutils/scp/http.go b/lib/sshutils/scp/http.go index 8e0220810f2d1..dff02d41d4670 100644 --- a/lib/sshutils/scp/http.go +++ b/lib/sshutils/scp/http.go @@ -26,10 +26,10 @@ import ( "strconv" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/events" "github.com/gravitational/teleport/lib/httplib" - - "github.com/gravitational/trace" ) const ( diff --git a/lib/sshutils/scp/local.go b/lib/sshutils/scp/local.go index 9e102dc49919c..39a10a955d8a0 100644 --- a/lib/sshutils/scp/local.go +++ b/lib/sshutils/scp/local.go @@ -22,8 +22,9 @@ import ( "path/filepath" "time" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) // localFileSystem provides API for accessing the files on diff --git a/lib/sshutils/scp/scp.go b/lib/sshutils/scp/scp.go index 178b7d5718c96..a8ce9a2befb53 100644 --- a/lib/sshutils/scp/scp.go +++ b/lib/sshutils/scp/scp.go @@ -33,11 +33,11 @@ import ( "strings" "time" - "github.com/gravitational/teleport/lib/events" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/events" + "github.com/gravitational/teleport/lib/utils" ) const ( diff --git a/lib/sshutils/scp/scp_test.go b/lib/sshutils/scp/scp_test.go index e7e9d4d0f4853..4ee27fd7acc4e 100644 --- a/lib/sshutils/scp/scp_test.go +++ b/lib/sshutils/scp/scp_test.go @@ -28,13 +28,12 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/google/go-cmp/cmp" + "github.com/gravitational/trace" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/sshutils/server_test.go b/lib/sshutils/server_test.go index 030dc361e6d0b..5b4443387b928 100644 --- a/lib/sshutils/server_test.go +++ b/lib/sshutils/server_test.go @@ -23,14 +23,12 @@ import ( "testing" "time" - "golang.org/x/crypto/ssh" - "github.com/gravitational/trace" - - "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/lib/utils" ) func TestMain(m *testing.M) { diff --git a/lib/sshutils/sftp/remote.go b/lib/sshutils/sftp/remote.go index f00c3cefe2d5b..e64eab2971633 100644 --- a/lib/sshutils/sftp/remote.go +++ b/lib/sshutils/sftp/remote.go @@ -22,9 +22,8 @@ import ( "os" "time" - "github.com/pkg/sftp" - "github.com/gravitational/trace" + "github.com/pkg/sftp" ) // remoteFS provides API for accessing the files on diff --git a/lib/sshutils/sftp/sftp.go b/lib/sshutils/sftp/sftp.go index af94311153c75..ea138680be675 100644 --- a/lib/sshutils/sftp/sftp.go +++ b/lib/sshutils/sftp/sftp.go @@ -30,14 +30,14 @@ import ( "strings" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/sshutils/scp" "github.com/gravitational/trace" - "github.com/pkg/sftp" "github.com/schollz/progressbar/v3" log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/sshutils/scp" ) // Options control aspects of a file transfer diff --git a/lib/sshutils/sftp/sftp_test.go b/lib/sshutils/sftp/sftp_test.go index c30471a3fb2eb..41cb2fdf1cd34 100644 --- a/lib/sshutils/sftp/sftp_test.go +++ b/lib/sshutils/sftp/sftp_test.go @@ -28,9 +28,9 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils" ) const fileMaxSize = 1000 diff --git a/lib/sshutils/signer.go b/lib/sshutils/signer.go index c3f9d866145d6..c75c9d071e205 100644 --- a/lib/sshutils/signer.go +++ b/lib/sshutils/signer.go @@ -19,11 +19,10 @@ package sshutils import ( "crypto" - "github.com/gravitational/teleport/api/utils/sshutils" - + "github.com/gravitational/trace" "golang.org/x/crypto/ssh" - "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/utils/sshutils" ) // NewSigner returns new ssh Signer from private key + certificate pair. The diff --git a/lib/sshutils/x11/forward.go b/lib/sshutils/x11/forward.go index fcda8a52ee143..9e01a1e8f147c 100644 --- a/lib/sshutils/x11/forward.go +++ b/lib/sshutils/x11/forward.go @@ -21,9 +21,10 @@ import ( "io" "sync" - "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/lib/sshutils" ) // forwardIO forwards io between two XServer connections until diff --git a/lib/tbot/botfs/botfs.go b/lib/tbot/botfs/botfs.go index 33b12c3982183..a374d628e61a6 100644 --- a/lib/tbot/botfs/botfs.go +++ b/lib/tbot/botfs/botfs.go @@ -24,10 +24,11 @@ import ( "strconv" "syscall" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/constants" "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/constants" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/lib/tbot/botfs/fs_linux.go b/lib/tbot/botfs/fs_linux.go index 7541a28270369..b3d38f3f8d91e 100644 --- a/lib/tbot/botfs/fs_linux.go +++ b/lib/tbot/botfs/fs_linux.go @@ -28,10 +28,11 @@ import ( "sync" "github.com/coreos/go-semver/semver" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" "github.com/joshlf/go-acl" "golang.org/x/sys/unix" + + "github.com/gravitational/teleport/lib/utils" ) // Openat2MinKernel is the kernel release that adds support for the openat2() diff --git a/lib/tbot/ca_rotation_test.go b/lib/tbot/ca_rotation_test.go index df83299edf125..751b552a26799 100644 --- a/lib/tbot/ca_rotation_test.go +++ b/lib/tbot/ca_rotation_test.go @@ -19,9 +19,10 @@ package tbot import ( "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" ) func Test_filterCAEvent(t *testing.T) { diff --git a/lib/tbot/config/config.go b/lib/tbot/config/config.go index 76e424ca64d29..da713e5a6d840 100644 --- a/lib/tbot/config/config.go +++ b/lib/tbot/config/config.go @@ -23,14 +23,14 @@ import ( "strings" "time" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" "github.com/sirupsen/logrus" "gopkg.in/yaml.v3" - "github.com/gravitational/kingpin" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) const ( diff --git a/lib/tbot/config/config_storage.go b/lib/tbot/config/config_storage.go index 57a3a810a15bc..0a128f2c71748 100644 --- a/lib/tbot/config/config_storage.go +++ b/lib/tbot/config/config_storage.go @@ -19,8 +19,9 @@ package config import ( "path/filepath" - "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/defaults" ) var defaultStoragePath = filepath.Join(defaults.DataDir, "bot") diff --git a/lib/tbot/config/configtemplate.go b/lib/tbot/config/configtemplate.go index 6dd2290e37e48..354777d3bc6f4 100644 --- a/lib/tbot/config/configtemplate.go +++ b/lib/tbot/config/configtemplate.go @@ -24,14 +24,15 @@ import ( "reflect" "strings" + "github.com/gravitational/trace" + "gopkg.in/yaml.v3" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils/keys" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" - "gopkg.in/yaml.v3" ) const ( diff --git a/lib/tbot/config/configtemplate_cockroach.go b/lib/tbot/config/configtemplate_cockroach.go index e7da25ca90464..a4ebfe3556530 100644 --- a/lib/tbot/config/configtemplate_cockroach.go +++ b/lib/tbot/config/configtemplate_cockroach.go @@ -19,11 +19,12 @@ package config import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client/identityfile" "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" ) const defaultCockroachDirName = "cockroach" diff --git a/lib/tbot/config/configtemplate_identity.go b/lib/tbot/config/configtemplate_identity.go index 38271386aae49..eea2cbff41830 100644 --- a/lib/tbot/config/configtemplate_identity.go +++ b/lib/tbot/config/configtemplate_identity.go @@ -19,11 +19,12 @@ package config import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client/identityfile" "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" ) const defaultIdentityFileName = "identity" diff --git a/lib/tbot/config/configtemplate_kubernetes.go b/lib/tbot/config/configtemplate_kubernetes.go index 983f36df86249..2189cd8492e13 100644 --- a/lib/tbot/config/configtemplate_kubernetes.go +++ b/lib/tbot/config/configtemplate_kubernetes.go @@ -23,6 +23,10 @@ import ( "net" "os" + "github.com/gravitational/trace" + "k8s.io/client-go/tools/clientcmd" + clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/client/webclient" "github.com/gravitational/teleport/api/constants" @@ -33,10 +37,6 @@ import ( "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) const defaultKubeconfigPath = "kubeconfig.yaml" diff --git a/lib/tbot/config/configtemplate_kubernetes_test.go b/lib/tbot/config/configtemplate_kubernetes_test.go index 6909b35623010..b14ecdcdfa3d6 100644 --- a/lib/tbot/config/configtemplate_kubernetes_test.go +++ b/lib/tbot/config/configtemplate_kubernetes_test.go @@ -23,9 +23,10 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/tbot/botfs" "github.com/gravitational/teleport/lib/utils/golden" - "github.com/stretchr/testify/require" ) // TestTemplateKubernetesRender renders a Kubernetes template and compares it diff --git a/lib/tbot/config/configtemplate_mongo.go b/lib/tbot/config/configtemplate_mongo.go index 40c06cc1b2b4d..4d51112c31879 100644 --- a/lib/tbot/config/configtemplate_mongo.go +++ b/lib/tbot/config/configtemplate_mongo.go @@ -19,11 +19,12 @@ package config import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client/identityfile" "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" ) // defaultMongoPrefix is the default prefix in generated MongoDB certs. diff --git a/lib/tbot/config/configtemplate_ssh_client.go b/lib/tbot/config/configtemplate_ssh_client.go index c65a01564206a..2cf12a9d7cfa5 100644 --- a/lib/tbot/config/configtemplate_ssh_client.go +++ b/lib/tbot/config/configtemplate_ssh_client.go @@ -25,14 +25,15 @@ import ( "sync" "github.com/coreos/go-semver/semver" + "github.com/gravitational/trace" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/config/openssh" "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "golang.org/x/crypto/ssh" ) // TemplateSSHClient contains parameters for the ssh_config config diff --git a/lib/tbot/config/configtemplate_ssh_client_test.go b/lib/tbot/config/configtemplate_ssh_client_test.go index 0722373ea3259..d99e7add48c8c 100644 --- a/lib/tbot/config/configtemplate_ssh_client_test.go +++ b/lib/tbot/config/configtemplate_ssh_client_test.go @@ -24,10 +24,11 @@ import ( "testing" "github.com/coreos/go-semver/semver" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/tbot/botfs" "github.com/gravitational/teleport/lib/tbot/identity" "github.com/gravitational/teleport/lib/utils/golden" - "github.com/stretchr/testify/require" ) func TestTemplateSSHClient_Render(t *testing.T) { diff --git a/lib/tbot/config/configtemplate_ssh_host_cert.go b/lib/tbot/config/configtemplate_ssh_host_cert.go index 830d74c6ae231..b41ca289837df 100644 --- a/lib/tbot/config/configtemplate_ssh_host_cert.go +++ b/lib/tbot/config/configtemplate_ssh_host_cert.go @@ -20,13 +20,14 @@ import ( "context" "strings" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/client/identityfile" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" ) const ( diff --git a/lib/tbot/config/configtemplate_ssh_host_cert_test.go b/lib/tbot/config/configtemplate_ssh_host_cert_test.go index ba845cc2aa177..78bac1caa7743 100644 --- a/lib/tbot/config/configtemplate_ssh_host_cert_test.go +++ b/lib/tbot/config/configtemplate_ssh_host_cert_test.go @@ -22,11 +22,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/fixtures" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/stretchr/testify/require" ) type mockHostCertAuth struct { diff --git a/lib/tbot/config/configtemplate_tls.go b/lib/tbot/config/configtemplate_tls.go index fb5319addaaca..42ede87ad2372 100644 --- a/lib/tbot/config/configtemplate_tls.go +++ b/lib/tbot/config/configtemplate_tls.go @@ -19,12 +19,13 @@ package config import ( "context" + "github.com/gravitational/trace" + "gopkg.in/yaml.v3" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client/identityfile" "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" - "gopkg.in/yaml.v3" ) const defaultTLSPrefix = "tls" diff --git a/lib/tbot/config/configtemplate_tls_cas.go b/lib/tbot/config/configtemplate_tls_cas.go index 8dd459ea04252..26d683d024c85 100644 --- a/lib/tbot/config/configtemplate_tls_cas.go +++ b/lib/tbot/config/configtemplate_tls_cas.go @@ -19,11 +19,12 @@ package config import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" ) const ( diff --git a/lib/tbot/config/destination.go b/lib/tbot/config/destination.go index 336ffc2d260da..eeb49ac6db10c 100644 --- a/lib/tbot/config/destination.go +++ b/lib/tbot/config/destination.go @@ -17,8 +17,9 @@ limitations under the License. package config import ( - "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/tbot/bot" ) // DestinationMixin is a reusable struct for all config elements that accept a diff --git a/lib/tbot/config/destination_directory.go b/lib/tbot/config/destination_directory.go index 0bf453791627f..896f8368d596c 100644 --- a/lib/tbot/config/destination_directory.go +++ b/lib/tbot/config/destination_directory.go @@ -25,9 +25,10 @@ import ( "path" "path/filepath" - "github.com/gravitational/teleport/lib/tbot/botfs" "github.com/gravitational/trace" "gopkg.in/yaml.v3" + + "github.com/gravitational/teleport/lib/tbot/botfs" ) // DestinationDirectory is a Destination that writes to the local filesystem diff --git a/lib/tbot/configtemplate_test.go b/lib/tbot/configtemplate_test.go index 8f064f2fa571b..0c2ff67c97aad 100644 --- a/lib/tbot/configtemplate_test.go +++ b/lib/tbot/configtemplate_test.go @@ -21,6 +21,8 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/identityfile" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/tbot/bot" @@ -28,7 +30,6 @@ import ( "github.com/gravitational/teleport/lib/tbot/testhelpers" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" ) // Note: This test lives in main to avoid otherwise inevitable import cycles diff --git a/lib/tbot/identity/identity.go b/lib/tbot/identity/identity.go index b0c14c6cf685f..303da98298635 100644 --- a/lib/tbot/identity/identity.go +++ b/lib/tbot/identity/identity.go @@ -22,6 +22,10 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -32,9 +36,6 @@ import ( "github.com/gravitational/teleport/lib/tbot/bot" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) const ( diff --git a/lib/tbot/identity_test.go b/lib/tbot/identity_test.go index acc75f78848f5..5869d8be307df 100644 --- a/lib/tbot/identity_test.go +++ b/lib/tbot/identity_test.go @@ -22,10 +22,11 @@ package tbot import ( "testing" - "github.com/gravitational/teleport/lib/tbot/config" - "github.com/gravitational/teleport/lib/tbot/identity" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/tbot/config" + "github.com/gravitational/teleport/lib/tbot/identity" ) func TestLoadEmptyIdentity(t *testing.T) { diff --git a/lib/tbot/renew_test.go b/lib/tbot/renew_test.go index 9273329c6ce63..8523fc0e78654 100644 --- a/lib/tbot/renew_test.go +++ b/lib/tbot/renew_test.go @@ -21,6 +21,9 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/utils" libconfig "github.com/gravitational/teleport/lib/config" @@ -28,8 +31,6 @@ import ( "github.com/gravitational/teleport/lib/tbot/testhelpers" "github.com/gravitational/teleport/lib/tlsca" libutils "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) // TestOnboardViaToken ensures a bot can join using token auth. diff --git a/lib/tbot/tbot.go b/lib/tbot/tbot.go index a8d0f741cbe9d..0a2924d3cd54b 100644 --- a/lib/tbot/tbot.go +++ b/lib/tbot/tbot.go @@ -24,6 +24,10 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "golang.org/x/sync/errgroup" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/client/webclient" "github.com/gravitational/teleport/api/types" @@ -31,9 +35,6 @@ import ( "github.com/gravitational/teleport/lib/tbot/config" "github.com/gravitational/teleport/lib/tbot/identity" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - "golang.org/x/sync/errgroup" ) type Bot struct { diff --git a/lib/tbot/tshwrap/wrap.go b/lib/tbot/tshwrap/wrap.go index 8732566b5adfb..24a7c32b444a2 100644 --- a/lib/tbot/tshwrap/wrap.go +++ b/lib/tbot/tshwrap/wrap.go @@ -24,6 +24,9 @@ import ( "runtime" "github.com/coreos/go-semver/semver" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/identityfile" @@ -32,8 +35,6 @@ import ( "github.com/gravitational/teleport/lib/tbot/config" "github.com/gravitational/teleport/lib/tbot/identity" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) const ( diff --git a/lib/tbot/tshwrap/wrap_test.go b/lib/tbot/tshwrap/wrap_test.go index e6828d48252de..939caba7c7d00 100644 --- a/lib/tbot/tshwrap/wrap_test.go +++ b/lib/tbot/tshwrap/wrap_test.go @@ -21,13 +21,14 @@ import ( "path/filepath" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/tbot/config" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) // TestTSHSupported ensures that the tsh version check works as expected (and, diff --git a/lib/teleagent/agent.go b/lib/teleagent/agent.go index 5e207d0833d97..31cc144985ace 100644 --- a/lib/teleagent/agent.go +++ b/lib/teleagent/agent.go @@ -23,12 +23,12 @@ import ( "strconv" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh/agent" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/utils" ) // Agent extends the agent.ExtendedAgent interface. diff --git a/lib/teleterm/api/uri/uri_test.go b/lib/teleterm/api/uri/uri_test.go index 935c85de4aa4c..54a6756d39e40 100644 --- a/lib/teleterm/api/uri/uri_test.go +++ b/lib/teleterm/api/uri/uri_test.go @@ -20,9 +20,9 @@ import ( "fmt" "testing" - "github.com/gravitational/teleport/lib/teleterm/api/uri" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/teleterm/api/uri" ) func TestString(t *testing.T) { diff --git a/lib/teleterm/apiserver/apiserver.go b/lib/teleterm/apiserver/apiserver.go index 86c5329b0c1f5..3cf50ba6fcedf 100644 --- a/lib/teleterm/apiserver/apiserver.go +++ b/lib/teleterm/apiserver/apiserver.go @@ -20,13 +20,13 @@ import ( "path/filepath" "strings" - api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" - "github.com/gravitational/teleport/lib/teleterm/apiserver/handler" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "google.golang.org/grpc" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/apiserver/handler" + "github.com/gravitational/teleport/lib/utils" ) // New creates an instance of API Server diff --git a/lib/teleterm/apiserver/config.go b/lib/teleterm/apiserver/config.go index 9581f5c39b6b6..b2f4449171645 100644 --- a/lib/teleterm/apiserver/config.go +++ b/lib/teleterm/apiserver/config.go @@ -15,11 +15,10 @@ package apiserver import ( - "github.com/gravitational/teleport/lib/teleterm/daemon" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/teleterm/daemon" ) // Config is the APIServer configuration diff --git a/lib/teleterm/apiserver/grpccredentials.go b/lib/teleterm/apiserver/grpccredentials.go index 6e6ff0fe44448..ad023d25e4cf6 100644 --- a/lib/teleterm/apiserver/grpccredentials.go +++ b/lib/teleterm/apiserver/grpccredentials.go @@ -20,12 +20,12 @@ import ( "os" "path/filepath" - "github.com/gravitational/teleport/api/utils/keys" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + + "github.com/gravitational/teleport/api/utils/keys" + "github.com/gravitational/teleport/lib/utils" ) const ( diff --git a/lib/teleterm/apiserver/handler/handler.go b/lib/teleterm/apiserver/handler/handler.go index 732be218378e5..656f741108921 100644 --- a/lib/teleterm/apiserver/handler/handler.go +++ b/lib/teleterm/apiserver/handler/handler.go @@ -15,10 +15,10 @@ package handler import ( + "github.com/gravitational/trace" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/daemon" - - "github.com/gravitational/trace" ) // New creates an instance of Handler diff --git a/lib/teleterm/apiserver/handler/handler_access_requests.go b/lib/teleterm/apiserver/handler/handler_access_requests.go index c4a2033d55e3e..9fc3c9dc2a89b 100644 --- a/lib/teleterm/apiserver/handler/handler_access_requests.go +++ b/lib/teleterm/apiserver/handler/handler_access_requests.go @@ -17,11 +17,11 @@ package handler import ( "context" - api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" - "github.com/gravitational/teleport/lib/teleterm/clusters" + "github.com/gravitational/trace" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/gravitational/trace" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/clusters" ) func (s *Handler) GetRequestableRoles(ctx context.Context, req *api.GetRequestableRolesRequest) (*api.GetRequestableRolesResponse, error) { diff --git a/lib/teleterm/apiserver/handler/handler_apps.go b/lib/teleterm/apiserver/handler/handler_apps.go index fbc13d616b61d..579cad4fd65c0 100644 --- a/lib/teleterm/apiserver/handler/handler_apps.go +++ b/lib/teleterm/apiserver/handler/handler_apps.go @@ -18,10 +18,10 @@ import ( "context" "sort" + "github.com/gravitational/trace" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/clusters" - - "github.com/gravitational/trace" ) // ListApps lists cluster applications diff --git a/lib/teleterm/apiserver/handler/handler_auth.go b/lib/teleterm/apiserver/handler/handler_auth.go index 7047614fc6513..71cf5bea7f227 100644 --- a/lib/teleterm/apiserver/handler/handler_auth.go +++ b/lib/teleterm/apiserver/handler/handler_auth.go @@ -17,9 +17,9 @@ package handler import ( "context" - api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" - "github.com/gravitational/trace" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" ) // Login logs in a user to a cluster diff --git a/lib/teleterm/apiserver/handler/handler_clusters.go b/lib/teleterm/apiserver/handler/handler_clusters.go index e234201a1a16f..0f93ae87405e2 100644 --- a/lib/teleterm/apiserver/handler/handler_clusters.go +++ b/lib/teleterm/apiserver/handler/handler_clusters.go @@ -17,10 +17,10 @@ package handler import ( "context" + "github.com/gravitational/trace" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/clusters" - - "github.com/gravitational/trace" ) // ListRootClusters lists root clusters diff --git a/lib/teleterm/apiserver/handler/handler_databases.go b/lib/teleterm/apiserver/handler/handler_databases.go index 6a3920704770f..877bd098fc1a6 100644 --- a/lib/teleterm/apiserver/handler/handler_databases.go +++ b/lib/teleterm/apiserver/handler/handler_databases.go @@ -18,10 +18,10 @@ import ( "context" "sort" + "github.com/gravitational/trace" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/clusters" - - "github.com/gravitational/trace" ) // GetAllDatabases gets all databases with no pagination diff --git a/lib/teleterm/apiserver/handler/handler_file_transfer.go b/lib/teleterm/apiserver/handler/handler_file_transfer.go index 7ee22d9758dca..8a517bbad64fa 100644 --- a/lib/teleterm/apiserver/handler/handler_file_transfer.go +++ b/lib/teleterm/apiserver/handler/handler_file_transfer.go @@ -15,8 +15,9 @@ package handler import ( - api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/trace" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" ) func (s *Handler) TransferFile(request *api.FileTransferRequest, server api.TerminalService_TransferFileServer) error { diff --git a/lib/teleterm/apiserver/handler/handler_gateways.go b/lib/teleterm/apiserver/handler/handler_gateways.go index 08533dda5cb75..22bc8a30dc4eb 100644 --- a/lib/teleterm/apiserver/handler/handler_gateways.go +++ b/lib/teleterm/apiserver/handler/handler_gateways.go @@ -17,11 +17,11 @@ package handler import ( "context" + "github.com/gravitational/trace" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/daemon" "github.com/gravitational/teleport/lib/teleterm/gateway" - - "github.com/gravitational/trace" ) // CreateGateway creates a gateway diff --git a/lib/teleterm/apiserver/handler/handler_kubes.go b/lib/teleterm/apiserver/handler/handler_kubes.go index cb57ea4d30065..f97dfbd2a12f4 100644 --- a/lib/teleterm/apiserver/handler/handler_kubes.go +++ b/lib/teleterm/apiserver/handler/handler_kubes.go @@ -18,10 +18,10 @@ import ( "context" "sort" + "github.com/gravitational/trace" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/clusters" - - "github.com/gravitational/trace" ) // GetAllKubes lists kubernetes clusters diff --git a/lib/teleterm/apiserver/handler/handler_servers.go b/lib/teleterm/apiserver/handler/handler_servers.go index 189ffcf8e9baf..685f6ee6db5ca 100644 --- a/lib/teleterm/apiserver/handler/handler_servers.go +++ b/lib/teleterm/apiserver/handler/handler_servers.go @@ -18,10 +18,10 @@ import ( "context" "sort" + "github.com/gravitational/trace" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/clusters" - - "github.com/gravitational/trace" ) // GetAllServers returns a full list of nodes without pagination or sorting. diff --git a/lib/teleterm/apiserver/middleware.go b/lib/teleterm/apiserver/middleware.go index 44a22a937f060..bd740ec768aa7 100644 --- a/lib/teleterm/apiserver/middleware.go +++ b/lib/teleterm/apiserver/middleware.go @@ -21,7 +21,6 @@ import ( "github.com/gravitational/trace" "github.com/gravitational/trace/trail" - "github.com/sirupsen/logrus" "google.golang.org/grpc" ) diff --git a/lib/teleterm/clusters/cluster.go b/lib/teleterm/clusters/cluster.go index 6a20c2c618681..b26bae4758954 100644 --- a/lib/teleterm/clusters/cluster.go +++ b/lib/teleterm/clusters/cluster.go @@ -19,18 +19,17 @@ package clusters import ( "context" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/client" - "github.com/gravitational/teleport/lib/teleterm/api/uri" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/client" + "github.com/gravitational/teleport/lib/teleterm/api/uri" ) // Cluster describes user settings and access to various resources. diff --git a/lib/teleterm/clusters/cluster_access_requests.go b/lib/teleterm/clusters/cluster_access_requests.go index 37f114ce5d533..8395e45195e35 100644 --- a/lib/teleterm/clusters/cluster_access_requests.go +++ b/lib/teleterm/clusters/cluster_access_requests.go @@ -18,6 +18,8 @@ import ( "context" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/auth" @@ -25,8 +27,6 @@ import ( "github.com/gravitational/teleport/lib/services" api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/api/uri" - - "github.com/gravitational/trace" ) type AccessRequest struct { diff --git a/lib/teleterm/clusters/cluster_apps.go b/lib/teleterm/clusters/cluster_apps.go index 318ffb06de47b..bde0d97494589 100644 --- a/lib/teleterm/clusters/cluster_apps.go +++ b/lib/teleterm/clusters/cluster_apps.go @@ -19,12 +19,12 @@ package clusters import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/teleterm/api/uri" - - "github.com/gravitational/trace" ) // App describes an app diff --git a/lib/teleterm/clusters/cluster_auth.go b/lib/teleterm/clusters/cluster_auth.go index 674be70ba11b7..8ce09c594765f 100644 --- a/lib/teleterm/clusters/cluster_auth.go +++ b/lib/teleterm/clusters/cluster_auth.go @@ -22,6 +22,8 @@ import ( "fmt" "sort" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/webclient" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/utils/keys" @@ -31,8 +33,6 @@ import ( dbprofile "github.com/gravitational/teleport/lib/client/db" "github.com/gravitational/teleport/lib/kube/kubeconfig" api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" - - "github.com/gravitational/trace" ) // SyncAuthPreference fetches Teleport auth preferences and stores it in the cluster profile diff --git a/lib/teleterm/clusters/cluster_auth_test.go b/lib/teleterm/clusters/cluster_auth_test.go index ba01ac1c7dec6..3df6c12694c22 100644 --- a/lib/teleterm/clusters/cluster_auth_test.go +++ b/lib/teleterm/clusters/cluster_auth_test.go @@ -20,12 +20,12 @@ import ( "context" "testing" - wancli "github.com/gravitational/teleport/lib/auth/webauthncli" - api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/trace" - "github.com/stretchr/testify/require" "google.golang.org/grpc" + + wancli "github.com/gravitational/teleport/lib/auth/webauthncli" + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" ) func TestPwdlessLoginPrompt_PromptPIN(t *testing.T) { diff --git a/lib/teleterm/clusters/cluster_databases.go b/lib/teleterm/clusters/cluster_databases.go index 59b5f9b2dc701..aa31ded18c898 100644 --- a/lib/teleterm/clusters/cluster_databases.go +++ b/lib/teleterm/clusters/cluster_databases.go @@ -19,6 +19,8 @@ package clusters import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -30,8 +32,6 @@ import ( api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/api/uri" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" ) // Database describes database diff --git a/lib/teleterm/clusters/cluster_file_transfer.go b/lib/teleterm/clusters/cluster_file_transfer.go index 1bc18b0f5d2b6..360d40d21ba40 100644 --- a/lib/teleterm/clusters/cluster_file_transfer.go +++ b/lib/teleterm/clusters/cluster_file_transfer.go @@ -21,10 +21,10 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/sshutils/sftp" api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" - - "github.com/gravitational/trace" ) type FileTransferProgressSender = func(progress *api.FileTransferProgress) error diff --git a/lib/teleterm/clusters/cluster_gateways.go b/lib/teleterm/clusters/cluster_gateways.go index a1558501cd713..b98fab7ed5e50 100644 --- a/lib/teleterm/clusters/cluster_gateways.go +++ b/lib/teleterm/clusters/cluster_gateways.go @@ -19,9 +19,9 @@ package clusters import ( "context" - "github.com/gravitational/teleport/lib/teleterm/gateway" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/teleterm/gateway" ) type CreateGatewayParams struct { diff --git a/lib/teleterm/clusters/cluster_kubes.go b/lib/teleterm/clusters/cluster_kubes.go index 538782f15c30c..f620c001fc909 100644 --- a/lib/teleterm/clusters/cluster_kubes.go +++ b/lib/teleterm/clusters/cluster_kubes.go @@ -19,6 +19,8 @@ package clusters import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -26,8 +28,6 @@ import ( "github.com/gravitational/teleport/lib/client" api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/api/uri" - - "github.com/gravitational/trace" ) // Kube describes kubernetes service diff --git a/lib/teleterm/clusters/cluster_leaves.go b/lib/teleterm/clusters/cluster_leaves.go index a60649c22608b..6e896fc34217c 100644 --- a/lib/teleterm/clusters/cluster_leaves.go +++ b/lib/teleterm/clusters/cluster_leaves.go @@ -19,11 +19,11 @@ package clusters import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/teleterm/api/uri" - - "github.com/gravitational/trace" ) // LeafCluster describes a leaf (trusted) cluster diff --git a/lib/teleterm/clusters/cluster_servers.go b/lib/teleterm/clusters/cluster_servers.go index 1d9130d531bd2..564da3024a73b 100644 --- a/lib/teleterm/clusters/cluster_servers.go +++ b/lib/teleterm/clusters/cluster_servers.go @@ -19,6 +19,8 @@ package clusters import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -26,8 +28,6 @@ import ( "github.com/gravitational/teleport/lib/client" api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/api/uri" - - "github.com/gravitational/trace" ) // Database describes database diff --git a/lib/teleterm/clusters/config.go b/lib/teleterm/clusters/config.go index c3a627e0f182f..9ba26d2d5043c 100644 --- a/lib/teleterm/clusters/config.go +++ b/lib/teleterm/clusters/config.go @@ -18,7 +18,6 @@ package clusters import ( "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" ) diff --git a/lib/teleterm/clusters/dbcmd_cli_command_provider.go b/lib/teleterm/clusters/dbcmd_cli_command_provider.go index 2b6fc3075ccd4..9934766904ef1 100644 --- a/lib/teleterm/clusters/dbcmd_cli_command_provider.go +++ b/lib/teleterm/clusters/dbcmd_cli_command_provider.go @@ -18,11 +18,11 @@ import ( "fmt" "strings" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/client/db/dbcmd" "github.com/gravitational/teleport/lib/teleterm/gateway" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" ) // DbcmdCLICommandProvider provides CLI commands for database gateways. It needs Storage to read diff --git a/lib/teleterm/clusters/dbcmd_cli_command_provider_test.go b/lib/teleterm/clusters/dbcmd_cli_command_provider_test.go index bc8b2545c6484..22a696a172748 100644 --- a/lib/teleterm/clusters/dbcmd_cli_command_provider_test.go +++ b/lib/teleterm/clusters/dbcmd_cli_command_provider_test.go @@ -20,14 +20,13 @@ import ( "strings" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/teleterm/api/uri" "github.com/gravitational/teleport/lib/teleterm/gateway" - - "github.com/gravitational/trace" - - "github.com/stretchr/testify/require" ) type fakeExec struct{} diff --git a/lib/teleterm/clusters/gateway_creator.go b/lib/teleterm/clusters/gateway_creator.go index e09799d57945f..8f7d4bbf5574a 100644 --- a/lib/teleterm/clusters/gateway_creator.go +++ b/lib/teleterm/clusters/gateway_creator.go @@ -17,9 +17,9 @@ package clusters import ( "context" - "github.com/gravitational/teleport/lib/teleterm/gateway" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/teleterm/gateway" ) type GatewayCreator struct { diff --git a/lib/teleterm/clusters/storage.go b/lib/teleterm/clusters/storage.go index 55bb213254878..9d6f5ef29c1df 100644 --- a/lib/teleterm/clusters/storage.go +++ b/lib/teleterm/clusters/storage.go @@ -20,11 +20,11 @@ import ( "context" "net" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/profile" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/teleterm/api/uri" - - "github.com/gravitational/trace" ) // NewStorage creates an instance of Cluster profile storage. diff --git a/lib/teleterm/config.go b/lib/teleterm/config.go index 3578defd94053..a6351ee605ec6 100644 --- a/lib/teleterm/config.go +++ b/lib/teleterm/config.go @@ -18,9 +18,9 @@ import ( "os" "syscall" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) // Config describes teleterm configuration diff --git a/lib/teleterm/daemon/config.go b/lib/teleterm/daemon/config.go index df05e99dd3dc7..7329ba420cc51 100644 --- a/lib/teleterm/daemon/config.go +++ b/lib/teleterm/daemon/config.go @@ -17,12 +17,11 @@ limitations under the License. package daemon import ( - "github.com/gravitational/teleport/lib/teleterm/clusters" - "github.com/gravitational/teleport/lib/teleterm/gateway" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/lib/teleterm/clusters" + "github.com/gravitational/teleport/lib/teleterm/gateway" ) // Config is the cluster service config diff --git a/lib/teleterm/daemon/daemon.go b/lib/teleterm/daemon/daemon.go index 95cc25f693f8d..6377294cec433 100644 --- a/lib/teleterm/daemon/daemon.go +++ b/lib/teleterm/daemon/daemon.go @@ -18,13 +18,13 @@ import ( "context" "sync" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client/db/dbcmd" api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" "github.com/gravitational/teleport/lib/teleterm/clusters" "github.com/gravitational/teleport/lib/teleterm/gateway" - - "github.com/gravitational/trace" ) // New creates an instance of Daemon service diff --git a/lib/teleterm/daemon/daemon_test.go b/lib/teleterm/daemon/daemon_test.go index e99d2ccd740ab..3a466c5cc1f90 100644 --- a/lib/teleterm/daemon/daemon_test.go +++ b/lib/teleterm/daemon/daemon_test.go @@ -21,14 +21,14 @@ import ( "net/http/httptest" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/teleterm/api/uri" "github.com/gravitational/teleport/lib/teleterm/clusters" "github.com/gravitational/teleport/lib/teleterm/gateway" "github.com/gravitational/teleport/lib/teleterm/gatewaytest" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) type mockGatewayCreator struct { diff --git a/lib/teleterm/gateway/config.go b/lib/teleterm/gateway/config.go index 2c103afa3a930..da699070baeb3 100644 --- a/lib/teleterm/gateway/config.go +++ b/lib/teleterm/gateway/config.go @@ -19,13 +19,13 @@ package gateway import ( "runtime" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/teleterm/api/uri" - "github.com/gravitational/trace" - - "github.com/google/uuid" - "github.com/sirupsen/logrus" ) // Config describes gateway configuration diff --git a/lib/teleterm/gateway/gateway.go b/lib/teleterm/gateway/gateway.go index 3f9840fc91a99..011b900807590 100644 --- a/lib/teleterm/gateway/gateway.go +++ b/lib/teleterm/gateway/gateway.go @@ -23,14 +23,14 @@ import ( "net" "strconv" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/utils/keys" alpn "github.com/gravitational/teleport/lib/srv/alpnproxy" alpncommon "github.com/gravitational/teleport/lib/srv/alpnproxy/common" "github.com/gravitational/teleport/lib/teleterm/api/uri" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" ) // New creates an instance of Gateway. It starts a listener on the specified port but it doesn't diff --git a/lib/teleterm/gateway/gateway_test.go b/lib/teleterm/gateway/gateway_test.go index b55b14cbc0e7e..0df061d4c95c5 100644 --- a/lib/teleterm/gateway/gateway_test.go +++ b/lib/teleterm/gateway/gateway_test.go @@ -21,12 +21,12 @@ import ( "net/http/httptest" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/teleterm/api/uri" "github.com/gravitational/teleport/lib/teleterm/gatewaytest" - - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) func TestCLICommandUsesCLICommandProvider(t *testing.T) { diff --git a/lib/teleterm/gatewaytest/helpers.go b/lib/teleterm/gatewaytest/helpers.go index 9816558db96ba..a00abe1a1019a 100644 --- a/lib/teleterm/gatewaytest/helpers.go +++ b/lib/teleterm/gatewaytest/helpers.go @@ -20,10 +20,10 @@ import ( "testing" "time" - apiutils "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + apiutils "github.com/gravitational/teleport/api/utils" ) const timeout = time.Second * 5 diff --git a/lib/teleterm/teleterm.go b/lib/teleterm/teleterm.go index 906eda902b935..7101ce6273e68 100644 --- a/lib/teleterm/teleterm.go +++ b/lib/teleterm/teleterm.go @@ -19,13 +19,12 @@ import ( "os" "os/signal" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/lib/teleterm/apiserver" "github.com/gravitational/teleport/lib/teleterm/clusters" "github.com/gravitational/teleport/lib/teleterm/daemon" - - "github.com/gravitational/trace" - - log "github.com/sirupsen/logrus" ) // Serve starts daemon service diff --git a/lib/teleterm/teleterm_test.go b/lib/teleterm/teleterm_test.go index 3a26487927b74..3ec05f4ec77c9 100644 --- a/lib/teleterm/teleterm_test.go +++ b/lib/teleterm/teleterm_test.go @@ -24,8 +24,9 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/teleterm" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/teleterm" ) func TestStart(t *testing.T) { diff --git a/lib/tlsca/ca_test.go b/lib/tlsca/ca_test.go index 93db0abb530f7..ceb169c5290ba 100644 --- a/lib/tlsca/ca_test.go +++ b/lib/tlsca/ca_test.go @@ -24,14 +24,14 @@ import ( "testing" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/lib/fixtures" - "github.com/google/go-cmp/cmp" "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/lib/fixtures" ) // TestPrincipals makes sure that SAN extension of generated x509 cert gets diff --git a/lib/utils/anonymizer_test.go b/lib/utils/anonymizer_test.go index 195036983cdca..0d278a06f25a8 100644 --- a/lib/utils/anonymizer_test.go +++ b/lib/utils/anonymizer_test.go @@ -20,7 +20,6 @@ import ( "testing" "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) diff --git a/lib/utils/archive_test.go b/lib/utils/archive_test.go index f9b6babc736e8..ccc5cbe6505cc 100644 --- a/lib/utils/archive_test.go +++ b/lib/utils/archive_test.go @@ -24,9 +24,10 @@ import ( "testing" "time" - "github.com/gravitational/teleport" "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport" ) type mockFileReader struct { diff --git a/lib/utils/certs.go b/lib/utils/certs.go index d4ca5ec554ea5..4e645f78c8e33 100644 --- a/lib/utils/certs.go +++ b/lib/utils/certs.go @@ -27,12 +27,12 @@ import ( "math/big" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/utils/tlsutils" - "github.com/gravitational/trace" "github.com/jonboulle/clockwork" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/utils/tlsutils" ) // ParseKeyStorePEM parses signing key store from PEM encoded key pair diff --git a/lib/utils/certs_test.go b/lib/utils/certs_test.go index 18a0bf946ac82..8aca60c78b60e 100644 --- a/lib/utils/certs_test.go +++ b/lib/utils/certs_test.go @@ -20,11 +20,10 @@ import ( "runtime" "testing" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/constants" ) func TestRejectsInvalidPEMData(t *testing.T) { diff --git a/lib/utils/chconn_test.go b/lib/utils/chconn_test.go index 6e61ba7ba2f3b..e5861facc758d 100644 --- a/lib/utils/chconn_test.go +++ b/lib/utils/chconn_test.go @@ -25,11 +25,11 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/utils/sshutils" - "github.com/stretchr/testify/require" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/utils/sshutils" ) // TestChConn validates that reads from the channel connection can be diff --git a/lib/utils/checker.go b/lib/utils/checker.go index 0acd51b798bd8..6849351c757ea 100644 --- a/lib/utils/checker.go +++ b/lib/utils/checker.go @@ -24,10 +24,10 @@ import ( "crypto/rsa" "time" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/trace" "golang.org/x/crypto/ssh" + + "github.com/gravitational/teleport/api/constants" ) // CreateCertificate creates a valid 2048-bit RSA certificate. diff --git a/lib/utils/cli.go b/lib/utils/cli.go index a634c600dcd9e..6f680a695c225 100644 --- a/lib/utils/cli.go +++ b/lib/utils/cli.go @@ -32,11 +32,10 @@ import ( "testing" "unicode" + "github.com/gravitational/kingpin" "github.com/gravitational/trace" "github.com/sirupsen/logrus" - "github.com/gravitational/kingpin" - "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" diff --git a/lib/utils/cli_test.go b/lib/utils/cli_test.go index 732c3437693d4..7b892c90f15a4 100644 --- a/lib/utils/cli_test.go +++ b/lib/utils/cli_test.go @@ -24,7 +24,6 @@ import ( "testing" "github.com/gravitational/trace" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" ) diff --git a/lib/utils/distro.go b/lib/utils/distro.go index e66fa591ace89..52d2e1c80ee61 100644 --- a/lib/utils/distro.go +++ b/lib/utils/distro.go @@ -19,9 +19,8 @@ package utils import ( "bufio" "io" - "strings" - "strconv" + "strings" "github.com/gravitational/trace" ) diff --git a/lib/utils/environment.go b/lib/utils/environment.go index 81134b4c483c8..eaa98bb81d20a 100644 --- a/lib/utils/environment.go +++ b/lib/utils/environment.go @@ -19,9 +19,9 @@ import ( "os" "strings" - "github.com/gravitational/teleport" - log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" ) // ReadEnvironmentFile will read environment variables from a passed in location. diff --git a/lib/utils/errors.go b/lib/utils/errors.go index 7c9da074d4b97..90c6034ab97b3 100644 --- a/lib/utils/errors.go +++ b/lib/utils/errors.go @@ -22,8 +22,9 @@ import ( "strings" "syscall" - "github.com/gravitational/teleport/api/constants" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/constants" ) // IsUseOfClosedNetworkError returns true if the specified error diff --git a/lib/utils/fncache_test.go b/lib/utils/fncache_test.go index a953ff6b02137..324db8a0102e2 100644 --- a/lib/utils/fncache_test.go +++ b/lib/utils/fncache_test.go @@ -25,12 +25,11 @@ import ( "testing" "time" - apiutils "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" "github.com/stretchr/testify/require" + + apiutils "github.com/gravitational/teleport/api/utils" ) func TestFnCache_New(t *testing.T) { diff --git a/lib/utils/fs.go b/lib/utils/fs.go index 03210501184e7..5ead3c15566c5 100644 --- a/lib/utils/fs.go +++ b/lib/utils/fs.go @@ -24,9 +24,9 @@ import ( "time" "github.com/gofrs/flock" + "github.com/gravitational/trace" "github.com/gravitational/teleport" - "github.com/gravitational/trace" ) // ErrUnsuccessfulLockTry designates an error when we temporarily couldn't acquire lock diff --git a/lib/utils/fuzz_test.go b/lib/utils/fuzz_test.go index 547f085d0b66c..11ce04da41d0a 100644 --- a/lib/utils/fuzz_test.go +++ b/lib/utils/fuzz_test.go @@ -18,12 +18,11 @@ package utils import ( "bytes" + "net/http" "strings" "testing" "github.com/stretchr/testify/require" - - "net/http" ) func FuzzParseProxyJump(f *testing.F) { diff --git a/lib/utils/grpc.go b/lib/utils/grpc.go index 941911e66c70b..c658a84756694 100644 --- a/lib/utils/grpc.go +++ b/lib/utils/grpc.go @@ -20,7 +20,6 @@ import ( "context" "github.com/gravitational/trace/trail" - "google.golang.org/grpc" ) diff --git a/lib/utils/grpc_test.go b/lib/utils/grpc_test.go index e7ae07ed71bb1..702ae85c3b7a5 100644 --- a/lib/utils/grpc_test.go +++ b/lib/utils/grpc_test.go @@ -27,7 +27,6 @@ import ( "github.com/gravitational/trace" "github.com/stretchr/testify/require" "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" pb "google.golang.org/grpc/examples/features/proto/echo" ) diff --git a/lib/utils/jsontools.go b/lib/utils/jsontools.go index 4e412a7fc19a0..951f89b34a9db 100644 --- a/lib/utils/jsontools.go +++ b/lib/utils/jsontools.go @@ -22,10 +22,9 @@ import ( "reflect" "unicode" + "github.com/ghodss/yaml" "github.com/gravitational/trace" jsoniter "github.com/json-iterator/go" - - "github.com/ghodss/yaml" kyaml "k8s.io/apimachinery/pkg/util/yaml" ) diff --git a/lib/utils/jsontools_test.go b/lib/utils/jsontools_test.go index 9f8033a2c3bec..f01f78a50ba1c 100644 --- a/lib/utils/jsontools_test.go +++ b/lib/utils/jsontools_test.go @@ -19,8 +19,9 @@ import ( "bytes" "testing" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) // TestMarshalMapConsistency ensures serialized byte comparisons succeed diff --git a/lib/utils/kernel.go b/lib/utils/kernel.go index 9f4d88103cfd1..42adadc488c7b 100644 --- a/lib/utils/kernel.go +++ b/lib/utils/kernel.go @@ -24,10 +24,10 @@ import ( "runtime" "strings" - "github.com/gravitational/teleport/api/constants" + "github.com/coreos/go-semver/semver" "github.com/gravitational/trace" - "github.com/coreos/go-semver/semver" + "github.com/gravitational/teleport/api/constants" ) // KernelVersion parses /proc/sys/kernel/osrelease and returns the kernel diff --git a/lib/utils/otp.go b/lib/utils/otp.go index acd81262cee36..e975d1adf8015 100644 --- a/lib/utils/otp.go +++ b/lib/utils/otp.go @@ -21,7 +21,6 @@ import ( "net/url" "github.com/gravitational/trace" - "github.com/pquerna/otp" ) diff --git a/lib/utils/parse/parse.go b/lib/utils/parse/parse.go index dcc5e7f56929b..ad1f55cb4ae7a 100644 --- a/lib/utils/parse/parse.go +++ b/lib/utils/parse/parse.go @@ -28,8 +28,9 @@ import ( "strings" "unicode" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/utils" ) // Expression is an expression template diff --git a/lib/utils/prompt/context_reader.go b/lib/utils/prompt/context_reader.go index 7e7b659b3213e..005ea0277d1b3 100644 --- a/lib/utils/prompt/context_reader.go +++ b/lib/utils/prompt/context_reader.go @@ -26,9 +26,8 @@ import ( "sync" "github.com/gravitational/trace" - "golang.org/x/term" - log "github.com/sirupsen/logrus" + "golang.org/x/term" ) // ErrReaderClosed is returned from ContextReader.ReadContext after it is diff --git a/lib/utils/proxy/proxy.go b/lib/utils/proxy/proxy.go index 99e0699dab05f..e2c0900a86046 100644 --- a/lib/utils/proxy/proxy.go +++ b/lib/utils/proxy/proxy.go @@ -23,16 +23,16 @@ import ( "net/url" "time" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport" apiclient "github.com/gravitational/teleport/api/client" apiproxy "github.com/gravitational/teleport/api/client/proxy" "github.com/gravitational/teleport/api/observability/tracing" tracessh "github.com/gravitational/teleport/api/observability/tracing/ssh" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/lib/utils/roles_test.go b/lib/utils/roles_test.go index 41975b8c34e1d..7529d32daa254 100644 --- a/lib/utils/roles_test.go +++ b/lib/utils/roles_test.go @@ -19,10 +19,10 @@ package utils import ( "testing" - "github.com/gravitational/teleport/api/types" - "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func TestParsing(t *testing.T) { diff --git a/lib/utils/socks/socks.go b/lib/utils/socks/socks.go index 7dd0a1ba2779a..3d10df10aed3f 100644 --- a/lib/utils/socks/socks.go +++ b/lib/utils/socks/socks.go @@ -23,10 +23,10 @@ import ( "net" "strconv" - "github.com/gravitational/teleport" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/lib/utils/socks/socks_test.go b/lib/utils/socks/socks_test.go index 4a127ffdcada1..bf0a792f9161b 100644 --- a/lib/utils/socks/socks_test.go +++ b/lib/utils/socks/socks_test.go @@ -22,12 +22,11 @@ import ( "os" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" "golang.org/x/net/proxy" "github.com/gravitational/teleport/lib/utils" - "github.com/stretchr/testify/require" - - "github.com/gravitational/trace" ) func TestMain(m *testing.M) { diff --git a/lib/utils/tls.go b/lib/utils/tls.go index d415cd4fb2526..1b604a39016b8 100644 --- a/lib/utils/tls.go +++ b/lib/utils/tls.go @@ -29,10 +29,10 @@ import ( "os" "time" - "github.com/gravitational/teleport/api/constants" "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport/api/constants" ) // TLSConfig returns default TLS configuration strong defaults. diff --git a/lib/utils/tlsdial.go b/lib/utils/tlsdial.go index accfac2605799..802b554ece3c4 100644 --- a/lib/utils/tlsdial.go +++ b/lib/utils/tlsdial.go @@ -6,11 +6,10 @@ package utils import ( "context" + "crypto/tls" "net" "strings" - "crypto/tls" - "github.com/gravitational/trace" ) diff --git a/lib/utils/uid.go b/lib/utils/uid.go index 90fe53b704034..4fa44004e1945 100644 --- a/lib/utils/uid.go +++ b/lib/utils/uid.go @@ -17,9 +17,9 @@ limitations under the License. package utils import ( - "github.com/gravitational/teleport/lib/fixtures" - "github.com/google/uuid" + + "github.com/gravitational/teleport/lib/fixtures" ) // UID provides an interface for generating unique identifiers. diff --git a/lib/utils/unpack.go b/lib/utils/unpack.go index cd4f09249e93a..6cc7fb1b998d6 100644 --- a/lib/utils/unpack.go +++ b/lib/utils/unpack.go @@ -19,15 +19,14 @@ package utils import ( "archive/tar" "io" - "strings" - "os" "path/filepath" - - "github.com/gravitational/teleport" + "strings" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" ) // Extract extracts the contents of the specified tarball under dir. The diff --git a/lib/utils/utils.go b/lib/utils/utils.go index f22ab421b884e..a2ae45bf293cd 100644 --- a/lib/utils/utils.go +++ b/lib/utils/utils.go @@ -34,15 +34,15 @@ import ( "sync" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/constants" - apiutils "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/teleport/lib/modules" - "github.com/google/uuid" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/util/validation" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/constants" + apiutils "github.com/gravitational/teleport/api/utils" + "github.com/gravitational/teleport/lib/modules" ) // WriteContextCloser provides close method with context diff --git a/lib/utils/utils_test.go b/lib/utils/utils_test.go index 020622828ad67..0f6896b29c26d 100644 --- a/lib/utils/utils_test.go +++ b/lib/utils/utils_test.go @@ -27,12 +27,10 @@ import ( "time" "github.com/google/uuid" - - "github.com/gravitational/teleport/lib/fixtures" - + "github.com/gravitational/trace" "github.com/stretchr/testify/require" - "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/fixtures" ) func TestMain(m *testing.M) { diff --git a/lib/versioncontrol/github/github.go b/lib/versioncontrol/github/github.go index a868958949675..ac673afa104c7 100644 --- a/lib/versioncontrol/github/github.go +++ b/lib/versioncontrol/github/github.go @@ -24,13 +24,12 @@ import ( "net/http" "strings" - "github.com/gravitational/teleport" - vc "github.com/gravitational/teleport/lib/versioncontrol" - "github.com/gravitational/trace" "github.com/sirupsen/logrus" - "golang.org/x/mod/semver" + + "github.com/gravitational/teleport" + vc "github.com/gravitational/teleport/lib/versioncontrol" ) // NOTE: when making modifications to package, make sure to run tests with diff --git a/lib/versioncontrol/github/github_test.go b/lib/versioncontrol/github/github_test.go index e342f7bb5a31c..f9fe7198a4840 100644 --- a/lib/versioncontrol/github/github_test.go +++ b/lib/versioncontrol/github/github_test.go @@ -22,10 +22,10 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + apiutils "github.com/gravitational/teleport/api/utils" vc "github.com/gravitational/teleport/lib/versioncontrol" - - "github.com/stretchr/testify/require" ) // TestGithubAPI tests the github releases iterator against the real github diff --git a/lib/web/apiserver.go b/lib/web/apiserver.go index 6a826b4f588b1..b35a2767c08a6 100644 --- a/lib/web/apiserver.go +++ b/lib/web/apiserver.go @@ -35,6 +35,16 @@ import ( "sync" "time" + "github.com/gravitational/oxy/ratelimit" + "github.com/gravitational/roundtrip" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/julienschmidt/httprouter" + lemma_secret "github.com/mailgun/lemma/secret" + "github.com/sirupsen/logrus" + "golang.org/x/crypto/ssh" + "golang.org/x/mod/semver" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/client/webclient" @@ -63,17 +73,6 @@ import ( "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/web/app" "github.com/gravitational/teleport/lib/web/ui" - - "github.com/gravitational/oxy/ratelimit" - "github.com/gravitational/roundtrip" - "github.com/gravitational/trace" - - "github.com/jonboulle/clockwork" - "github.com/julienschmidt/httprouter" - lemma_secret "github.com/mailgun/lemma/secret" - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" - "golang.org/x/mod/semver" ) const ( diff --git a/lib/web/apiserver_login_test.go b/lib/web/apiserver_login_test.go index 3bc30dd50a103..ce21110b4dbf1 100644 --- a/lib/web/apiserver_login_test.go +++ b/lib/web/apiserver_login_test.go @@ -24,17 +24,17 @@ import ( "time" "github.com/gravitational/roundtrip" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" + wanlib "github.com/gravitational/teleport/lib/auth/webauthn" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" - - wanlib "github.com/gravitational/teleport/lib/auth/webauthn" ) func TestWebauthnLogin_ssh(t *testing.T) { diff --git a/lib/web/apiserver_test.go b/lib/web/apiserver_test.go index 28b6cecc9f9a8..7f017d31fd9d1 100644 --- a/lib/web/apiserver_test.go +++ b/lib/web/apiserver_test.go @@ -50,8 +50,25 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/gorilla/websocket" - "github.com/gravitational/roundtrip" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/julienschmidt/httprouter" + lemma_secret "github.com/mailgun/lemma/secret" + "github.com/pquerna/otp/totp" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/ssh" + "golang.org/x/exp/slices" + "golang.org/x/text/encoding/unicode" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" + authztypes "k8s.io/client-go/kubernetes/typed/authorization/v1" + "k8s.io/client-go/tools/clientcmd" + clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" authproto "github.com/gravitational/teleport/api/client/proto" @@ -89,24 +106,6 @@ import ( "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/web/ui" - "github.com/gravitational/trace" - - "github.com/jonboulle/clockwork" - "github.com/julienschmidt/httprouter" - lemma_secret "github.com/mailgun/lemma/secret" - "github.com/pquerna/otp/totp" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/ssh" - "golang.org/x/exp/slices" - "golang.org/x/text/encoding/unicode" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - authztypes "k8s.io/client-go/kubernetes/typed/authorization/v1" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) const hostID = "00000000-0000-0000-0000-000000000000" diff --git a/lib/web/app/fragment.go b/lib/web/app/fragment.go index 27065ddd422b3..2a10b12737c56 100644 --- a/lib/web/app/fragment.go +++ b/lib/web/app/fragment.go @@ -23,13 +23,13 @@ import ( "net/http" "time" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/httplib" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - - "github.com/julienschmidt/httprouter" ) type fragmentRequest struct { diff --git a/lib/web/app/handler.go b/lib/web/app/handler.go index 4ed1120d2c581..3d85642957615 100644 --- a/lib/web/app/handler.go +++ b/lib/web/app/handler.go @@ -26,19 +26,18 @@ import ( "net/http" "net/url" + oxyutils "github.com/gravitational/oxy/utils" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/julienschmidt/httprouter" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - oxyutils "github.com/gravitational/oxy/utils" - "github.com/gravitational/trace" - - "github.com/jonboulle/clockwork" - "github.com/julienschmidt/httprouter" - "github.com/sirupsen/logrus" ) // HandlerConfig is the configuration for an application handler. diff --git a/lib/web/app/handler_test.go b/lib/web/app/handler_test.go index d02039f94f400..fccaca2b7ca29 100644 --- a/lib/web/app/handler_test.go +++ b/lib/web/app/handler_test.go @@ -31,6 +31,11 @@ import ( "testing" "time" + "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/auth" @@ -41,12 +46,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/google/uuid" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - - "github.com/stretchr/testify/require" ) // TestAuthPOST tests the handler of POST /x-teleport-auth. diff --git a/lib/web/app/logout.go b/lib/web/app/logout.go index cf7c50b2ddc9f..7597278631c72 100644 --- a/lib/web/app/logout.go +++ b/lib/web/app/logout.go @@ -21,10 +21,10 @@ import ( "net/http" "time" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" + + "github.com/gravitational/teleport/api/types" ) func (h *Handler) handleLogout(w http.ResponseWriter, r *http.Request, p httprouter.Params, session *session) error { diff --git a/lib/web/app/match.go b/lib/web/app/match.go index 968ee98acc0ae..76cf02f2d29c9 100644 --- a/lib/web/app/match.go +++ b/lib/web/app/match.go @@ -21,14 +21,14 @@ import ( "math/rand" "strings" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" ) // Getter returns a list of registered apps and the local cluster name. diff --git a/lib/web/app/match_test.go b/lib/web/app/match_test.go index b4045863e35e3..f8908586e8a2a 100644 --- a/lib/web/app/match_test.go +++ b/lib/web/app/match_test.go @@ -21,11 +21,12 @@ import ( "net" "testing" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/tlsca" - "github.com/stretchr/testify/require" ) func TestMatchAll(t *testing.T) { diff --git a/lib/web/app/middleware.go b/lib/web/app/middleware.go index b7a572a0d1dfe..9bd58e85d603e 100644 --- a/lib/web/app/middleware.go +++ b/lib/web/app/middleware.go @@ -21,10 +21,10 @@ import ( "net/url" "path" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" + + "github.com/gravitational/teleport/lib/utils" ) // withRouterAuth authenticates requests then hands the request to a diff --git a/lib/web/app/session.go b/lib/web/app/session.go index c3133a5d414c6..62dffe413b136 100644 --- a/lib/web/app/session.go +++ b/lib/web/app/session.go @@ -21,17 +21,16 @@ import ( "sync" "time" + "github.com/gravitational/oxy/forward" + oxyutils "github.com/gravitational/oxy/utils" + "github.com/gravitational/trace" + "github.com/gravitational/ttlmap" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/srv/app/common" "github.com/gravitational/teleport/lib/tlsca" - - "github.com/gravitational/trace" - "github.com/gravitational/ttlmap" - - "github.com/gravitational/oxy/forward" - oxyutils "github.com/gravitational/oxy/utils" - "github.com/sirupsen/logrus" ) // session holds a request forwarder and web session for this request. diff --git a/lib/web/app/transport.go b/lib/web/app/transport.go index b0c3bb00b77cd..13dfd6ab9b2f5 100644 --- a/lib/web/app/transport.go +++ b/lib/web/app/transport.go @@ -25,6 +25,9 @@ import ( "strings" "sync" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" @@ -34,9 +37,6 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - "github.com/sirupsen/logrus" - - "github.com/gravitational/trace" ) // transportConfig is configuration for a rewriting transport. diff --git a/lib/web/apps.go b/lib/web/apps.go index 9c39e50653de8..8d96d9b47e267 100644 --- a/lib/web/apps.go +++ b/lib/web/apps.go @@ -22,6 +22,9 @@ import ( "context" "net/http" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" apievents "github.com/gravitational/teleport/api/types/events" @@ -33,9 +36,6 @@ import ( "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/web/app" "github.com/gravitational/teleport/lib/web/ui" - - "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" ) // clusterAppsGet returns a list of applications in a form the UI can present. diff --git a/lib/web/conn_upgrade.go b/lib/web/conn_upgrade.go index 080755b1afc60..9f1638a74a2d2 100644 --- a/lib/web/conn_upgrade.go +++ b/lib/web/conn_upgrade.go @@ -22,10 +22,11 @@ import ( "net" "net/http" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" "github.com/julienschmidt/httprouter" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/utils" ) // selectConnectionUpgrade selects the requested upgrade type and returns the diff --git a/lib/web/connection_diagnostic.go b/lib/web/connection_diagnostic.go index 32b10d63313f7..ee968c5f47eed 100644 --- a/lib/web/connection_diagnostic.go +++ b/lib/web/connection_diagnostic.go @@ -19,12 +19,13 @@ package web import ( "net/http" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + "github.com/gravitational/teleport/lib/client/conntest" "github.com/gravitational/teleport/lib/httplib" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/web/ui" - "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" ) // getConnectionDiagnostic returns a connection diagnostic connection diagnostics. diff --git a/lib/web/desktop/playback.go b/lib/web/desktop/playback.go index 2f8d62feeab8e..2f6d374fd30d9 100644 --- a/lib/web/desktop/playback.go +++ b/lib/web/desktop/playback.go @@ -25,12 +25,13 @@ import ( "sync" "time" - apievents "github.com/gravitational/teleport/api/types/events" - "github.com/gravitational/teleport/lib/session" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" "github.com/sirupsen/logrus" "golang.org/x/net/websocket" + + apievents "github.com/gravitational/teleport/api/types/events" + "github.com/gravitational/teleport/lib/session" + "github.com/gravitational/teleport/lib/utils" ) const ( diff --git a/lib/web/desktop/playback_test.go b/lib/web/desktop/playback_test.go index 3348112580795..be47322b3cc87 100644 --- a/lib/web/desktop/playback_test.go +++ b/lib/web/desktop/playback_test.go @@ -24,12 +24,13 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "golang.org/x/net/websocket" + apievents "github.com/gravitational/teleport/api/types/events" "github.com/gravitational/teleport/lib/session" "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/web/desktop" - "github.com/stretchr/testify/require" - "golang.org/x/net/websocket" ) func TestStreamsDesktopEvents(t *testing.T) { diff --git a/lib/web/desktop_playback.go b/lib/web/desktop_playback.go index 905543d960cfc..a91c8e5a18ee4 100644 --- a/lib/web/desktop_playback.go +++ b/lib/web/desktop_playback.go @@ -19,11 +19,12 @@ package web import ( "net/http" - "github.com/gravitational/teleport/lib/reversetunnel" - "github.com/gravitational/teleport/lib/web/desktop" "github.com/gravitational/trace" "github.com/julienschmidt/httprouter" "golang.org/x/net/websocket" + + "github.com/gravitational/teleport/lib/reversetunnel" + "github.com/gravitational/teleport/lib/web/desktop" ) func (h *Handler) desktopPlaybackHandle( diff --git a/lib/web/files.go b/lib/web/files.go index db711871cabf7..04fc28dd4912c 100644 --- a/lib/web/files.go +++ b/lib/web/files.go @@ -19,15 +19,15 @@ package web import ( "net/http" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/sshutils/scp" - - "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" ) // fileTransferRequest describes HTTP file transfer request diff --git a/lib/web/join_tokens.go b/lib/web/join_tokens.go index cb02d199b0496..ad008261c3a40 100644 --- a/lib/web/join_tokens.go +++ b/lib/web/join_tokens.go @@ -32,6 +32,10 @@ import ( "time" "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + "k8s.io/apimachinery/pkg/util/validation" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" @@ -42,9 +46,6 @@ import ( "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/teleport/lib/web/scripts" "github.com/gravitational/teleport/lib/web/ui" - "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" - "k8s.io/apimachinery/pkg/util/validation" ) // nodeJoinToken contains node token fields for the UI. diff --git a/lib/web/join_tokens_test.go b/lib/web/join_tokens_test.go index 45a7c3df15e8a..94706a5d118c5 100644 --- a/lib/web/join_tokens_test.go +++ b/lib/web/join_tokens_test.go @@ -23,6 +23,7 @@ import ( "testing" "time" + "github.com/gravitational/trace" "github.com/stretchr/testify/require" "github.com/gravitational/teleport/api/client/proto" @@ -30,7 +31,6 @@ import ( "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/fixtures" - "github.com/gravitational/trace" ) func TestCreateNodeJoinToken(t *testing.T) { diff --git a/lib/web/mfa.go b/lib/web/mfa.go index b985b02408e28..f968af4d4b411 100644 --- a/lib/web/mfa.go +++ b/lib/web/mfa.go @@ -20,13 +20,14 @@ import ( "net/http" "strings" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/lib/auth/webauthn" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/httplib" "github.com/gravitational/teleport/lib/web/ui" - "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" ) // getMFADevicesWithTokenHandle retrieves the list of registered MFA devices for the user defined in token. diff --git a/lib/web/mfa_codec.go b/lib/web/mfa_codec.go index 0cbce7dbb27d7..f0e471416cc23 100644 --- a/lib/web/mfa_codec.go +++ b/lib/web/mfa_codec.go @@ -21,12 +21,13 @@ import ( "encoding/json" proto "github.com/gogo/protobuf/proto" + "github.com/gravitational/trace" + authproto "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/srv/desktop/tdp" "github.com/gravitational/teleport/lib/web/mfajson" - "github.com/gravitational/trace" ) // mfaCodec converts MFA challenges/responses between their native types and a format diff --git a/lib/web/resources.go b/lib/web/resources.go index 91d38067e7c6c..f0988f9c1ae29 100644 --- a/lib/web/resources.go +++ b/lib/web/resources.go @@ -21,6 +21,10 @@ import ( "net/http" "strings" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + kyaml "k8s.io/apimachinery/pkg/util/yaml" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/client" @@ -29,11 +33,6 @@ import ( "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/web/ui" - - "github.com/gravitational/trace" - - "github.com/julienschmidt/httprouter" - kyaml "k8s.io/apimachinery/pkg/util/yaml" ) // checkAccessToRegisteredResource checks if calling user has access to at least one registered resource. diff --git a/lib/web/resources_test.go b/lib/web/resources_test.go index db526f7a30375..1bfcc99c81baf 100644 --- a/lib/web/resources_test.go +++ b/lib/web/resources_test.go @@ -21,14 +21,13 @@ import ( "net/http" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/web/ui" - - "github.com/gravitational/trace" - - "github.com/stretchr/testify/require" ) func TestExtractResourceAndValidate(t *testing.T) { diff --git a/lib/web/servers.go b/lib/web/servers.go index 2798922060b67..a3bb9a7981b0e 100644 --- a/lib/web/servers.go +++ b/lib/web/servers.go @@ -19,12 +19,12 @@ package web import ( "net/http" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/web/ui" - - "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" ) // clusterKubesGet returns a list of kube clusters in a form the UI can present. diff --git a/lib/web/sessions.go b/lib/web/sessions.go index ae7002ae24982..a858654eb4f3f 100644 --- a/lib/web/sessions.go +++ b/lib/web/sessions.go @@ -26,8 +26,12 @@ import ( "sync" "time" + "github.com/gravitational/trace" + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" + "google.golang.org/grpc" "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/breaker" @@ -44,11 +48,6 @@ import ( "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" - "github.com/sirupsen/logrus" - "google.golang.org/grpc" ) // SessionContext is a context associated with a user's diff --git a/lib/web/sessions_test.go b/lib/web/sessions_test.go index 419401e5eeefc..3f77fbf7da346 100644 --- a/lib/web/sessions_test.go +++ b/lib/web/sessions_test.go @@ -18,9 +18,8 @@ import ( "errors" "testing" - "github.com/stretchr/testify/require" - "github.com/gravitational/trace" + "github.com/stretchr/testify/require" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/reversetunnel" diff --git a/lib/web/ui/cluster.go b/lib/web/ui/cluster.go index 34169c2dd25d0..e5656c0538e20 100644 --- a/lib/web/ui/cluster.go +++ b/lib/web/ui/cluster.go @@ -21,11 +21,12 @@ import ( "sort" "time" + "github.com/gravitational/trace" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" ) // Cluster describes a cluster diff --git a/lib/web/ui/perf_test.go b/lib/web/ui/perf_test.go index ef2c3e0f3428a..46faafa49b2c3 100644 --- a/lib/web/ui/perf_test.go +++ b/lib/web/ui/perf_test.go @@ -22,6 +22,9 @@ import ( "testing" "time" + "github.com/google/uuid" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -31,9 +34,6 @@ import ( "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/services/local" - - "github.com/google/uuid" - "github.com/stretchr/testify/require" ) const clusterName = "bench.example.com" diff --git a/lib/web/ui/resource.go b/lib/web/ui/resource.go index e0628fa877da8..a3d349256ed03 100644 --- a/lib/web/ui/resource.go +++ b/lib/web/ui/resource.go @@ -19,11 +19,10 @@ package ui import ( "fmt" - "github.com/gravitational/teleport/api/types" - + yaml "github.com/ghodss/yaml" "github.com/gravitational/trace" - yaml "github.com/ghodss/yaml" + "github.com/gravitational/teleport/api/types" ) // ResourceItem is UI representation of a resource (roles, trusted clusters, auth connectors). diff --git a/lib/web/ui/server_test.go b/lib/web/ui/server_test.go index 7827dcae9f487..27c8ce2227cea 100644 --- a/lib/web/ui/server_test.go +++ b/lib/web/ui/server_test.go @@ -19,10 +19,11 @@ package ui import ( "testing" + "github.com/stretchr/testify/require" + apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" - "github.com/stretchr/testify/require" ) func TestGetAllowedKubeUsersAndGroupsForCluster(t *testing.T) { diff --git a/lib/web/ui/user.go b/lib/web/ui/user.go index 92b180e756d78..68fad8a03edfe 100644 --- a/lib/web/ui/user.go +++ b/lib/web/ui/user.go @@ -17,8 +17,9 @@ limitations under the License. package ui import ( - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/api/types" ) type UserListEntry struct { diff --git a/lib/web/ui/usercontext_test.go b/lib/web/ui/usercontext_test.go index 82455cee482a1..6df4d44238b0a 100644 --- a/lib/web/ui/usercontext_test.go +++ b/lib/web/ui/usercontext_test.go @@ -20,11 +20,12 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/services" - "github.com/stretchr/testify/require" ) func TestNewUserContext(t *testing.T) { diff --git a/lib/web/users.go b/lib/web/users.go index c71b388cca269..3f0d56ca559a0 100644 --- a/lib/web/users.go +++ b/lib/web/users.go @@ -21,15 +21,14 @@ import ( "net/http" "time" + "github.com/gravitational/trace" + "github.com/julienschmidt/httprouter" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" wanlib "github.com/gravitational/teleport/lib/auth/webauthn" "github.com/gravitational/teleport/lib/httplib" "github.com/gravitational/teleport/lib/web/ui" - - "github.com/gravitational/trace" - - "github.com/julienschmidt/httprouter" ) func (h *Handler) updateUserHandle(w http.ResponseWriter, r *http.Request, params httprouter.Params, ctx *SessionContext) (interface{}, error) { diff --git a/lib/web/users_test.go b/lib/web/users_test.go index bcab1a890a97d..bebc06cb81bf7 100644 --- a/lib/web/users_test.go +++ b/lib/web/users_test.go @@ -23,13 +23,12 @@ import ( "net/http" "testing" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" - "github.com/julienschmidt/httprouter" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/types" ) func TestRequestParameters(t *testing.T) { diff --git a/lib/web/web.go b/lib/web/web.go index 2b3af1c9a5fed..57c8cf3f08bd3 100644 --- a/lib/web/web.go +++ b/lib/web/web.go @@ -17,11 +17,10 @@ limitations under the License. package web import ( - "github.com/gravitational/teleport" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" + + "github.com/gravitational/teleport" ) var log = newPackageLogger() diff --git a/operator/controllers/resources/reconciler.go b/operator/controllers/resources/reconciler.go index 2fbc41334be8f..d9f999b0f5f8d 100644 --- a/operator/controllers/resources/reconciler.go +++ b/operator/controllers/resources/reconciler.go @@ -19,13 +19,12 @@ package resources import ( "context" + "github.com/gravitational/trace" apierrors "k8s.io/apimachinery/pkg/api/errors" ctrl "sigs.k8s.io/controller-runtime" kclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" - - "github.com/gravitational/trace" ) // DeletionFinalizer is a name of finalizer added to resource's 'finalizers' field diff --git a/operator/controllers/resources/role_controller_test.go b/operator/controllers/resources/role_controller_test.go index 4988c8c7ee128..a5791604562c6 100644 --- a/operator/controllers/resources/role_controller_test.go +++ b/operator/controllers/resources/role_controller_test.go @@ -26,7 +26,6 @@ import ( "github.com/gravitational/trace" "github.com/mitchellh/mapstructure" "github.com/stretchr/testify/require" - kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/yaml" diff --git a/operator/controllers/resources/suite_test.go b/operator/controllers/resources/suite_test.go index 7bc1c099bb009..d6986ceb6f668 100644 --- a/operator/controllers/resources/suite_test.go +++ b/operator/controllers/resources/suite_test.go @@ -23,13 +23,10 @@ import ( "testing" "time" - "github.com/gravitational/teleport/api/breaker" - "github.com/gravitational/teleport/api/identityfile" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/auth/authclient" - "github.com/gravitational/teleport/lib/service" - "github.com/gravitational/teleport/lib/utils" - + "github.com/google/uuid" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" @@ -39,13 +36,14 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" - "github.com/google/uuid" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - + "github.com/gravitational/teleport/api/breaker" + "github.com/gravitational/teleport/api/identityfile" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/integration/helpers" + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/auth/authclient" + "github.com/gravitational/teleport/lib/service" + "github.com/gravitational/teleport/lib/utils" resourcesv2 "github.com/gravitational/teleport/operator/apis/resources/v2" resourcesv5 "github.com/gravitational/teleport/operator/apis/resources/v5" //+kubebuilder:scaffold:imports diff --git a/operator/controllers/resources/user_controller_test.go b/operator/controllers/resources/user_controller_test.go index a6ff8f7065fd6..2c97a60797a82 100644 --- a/operator/controllers/resources/user_controller_test.go +++ b/operator/controllers/resources/user_controller_test.go @@ -25,7 +25,6 @@ import ( "github.com/mitchellh/mapstructure" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/operator/controllers/resources/utils.go b/operator/controllers/resources/utils.go index 9d18cd203b90c..9c631681f8cc8 100644 --- a/operator/controllers/resources/utils.go +++ b/operator/controllers/resources/utils.go @@ -20,12 +20,12 @@ import ( "context" "fmt" + "github.com/gravitational/trace" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kclient "sigs.k8s.io/controller-runtime/pkg/client" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" ) const ( diff --git a/operator/controllers/resources/utils_test.go b/operator/controllers/resources/utils_test.go index ac0f01789c99f..14532731ef5be 100644 --- a/operator/controllers/resources/utils_test.go +++ b/operator/controllers/resources/utils_test.go @@ -19,10 +19,11 @@ package resources import ( "testing" - "github.com/gravitational/teleport/api/types" "github.com/gravitational/trace" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/gravitational/teleport/api/types" ) func TestCheckOwnership(t *testing.T) { diff --git a/operator/crdgen/main.go b/operator/crdgen/main.go index e352cc3fce9ac..36daef9b33ecd 100644 --- a/operator/crdgen/main.go +++ b/operator/crdgen/main.go @@ -20,12 +20,11 @@ import ( "fmt" "os" - "github.com/gravitational/trace" - gogodesc "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" "github.com/gogo/protobuf/protoc-gen-gogo/generator" gogoplugin "github.com/gogo/protobuf/protoc-gen-gogo/plugin" "github.com/gogo/protobuf/vanity/command" + "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "sigs.k8s.io/yaml" ) diff --git a/operator/crdgen/schemagen.go b/operator/crdgen/schemagen.go index f00857b5f5a79..fd714753bc863 100644 --- a/operator/crdgen/schemagen.go +++ b/operator/crdgen/schemagen.go @@ -21,19 +21,15 @@ import ( "regexp" "strings" - "golang.org/x/exp/slices" - - crdmarkers "sigs.k8s.io/controller-tools/pkg/crd/markers" - "sigs.k8s.io/controller-tools/pkg/loader" - "sigs.k8s.io/controller-tools/pkg/markers" - "github.com/gobuffalo/flect" + "github.com/gravitational/trace" + "golang.org/x/exp/slices" apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - crdtools "sigs.k8s.io/controller-tools/pkg/crd" - - "github.com/gravitational/trace" + crdmarkers "sigs.k8s.io/controller-tools/pkg/crd/markers" + "sigs.k8s.io/controller-tools/pkg/loader" + "sigs.k8s.io/controller-tools/pkg/markers" ) const k8sKindPrefix = "Teleport" diff --git a/operator/main.go b/operator/main.go index 255edcdc82913..5688d4c73407e 100644 --- a/operator/main.go +++ b/operator/main.go @@ -16,21 +16,20 @@ limitations under the License. package main +//nolint:goimports import ( "flag" "os" "time" "github.com/gravitational/trace" - - // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) - // to ensure that exec-entrypoint and run can make use of them. - _ "k8s.io/client-go/plugin/pkg/client/auth" - apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) + // to ensure that exec-entrypoint and run can make use of them. + _ "k8s.io/client-go/plugin/pkg/client/auth" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" diff --git a/operator/sidecar/sidecar.go b/operator/sidecar/sidecar.go index 33e0f3e011998..cf82a6b1f40ee 100644 --- a/operator/sidecar/sidecar.go +++ b/operator/sidecar/sidecar.go @@ -19,6 +19,7 @@ package sidecar import ( "path/filepath" + "github.com/gravitational/trace" log "github.com/sirupsen/logrus" "github.com/gravitational/teleport" @@ -29,7 +30,6 @@ import ( "github.com/gravitational/teleport/lib/config" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) const ( diff --git a/operator/sidecar/tbot.go b/operator/sidecar/tbot.go index 3440f943a994b..95f6aac8d1242 100644 --- a/operator/sidecar/tbot.go +++ b/operator/sidecar/tbot.go @@ -21,6 +21,9 @@ import ( "fmt" "time" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" @@ -30,8 +33,6 @@ import ( "github.com/gravitational/teleport/lib/tbot/identity" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) const ( diff --git a/tool/common/common_test.go b/tool/common/common_test.go index 2d7aa4dd78844..26c23dc947760 100644 --- a/tool/common/common_test.go +++ b/tool/common/common_test.go @@ -19,8 +19,9 @@ import ( "context" "testing" - "github.com/gravitational/teleport/api/types" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) type mockedAlertGetter struct { diff --git a/tool/tbot/db.go b/tool/tbot/db.go index 598b7ed1e14fd..6be3b18a4b064 100644 --- a/tool/tbot/db.go +++ b/tool/tbot/db.go @@ -19,10 +19,11 @@ package main import ( "path/filepath" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/tbot/config" "github.com/gravitational/teleport/lib/tbot/tshwrap" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) func onDBCommand(botConfig *config.BotConfig, cf *config.CLIConf) error { diff --git a/tool/tbot/init.go b/tool/tbot/init.go index 25d0b37ae9b78..2b15e4b5282db 100644 --- a/tool/tbot/init.go +++ b/tool/tbot/init.go @@ -26,11 +26,12 @@ import ( "strings" "github.com/google/uuid" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/lib/tbot/botfs" "github.com/gravitational/teleport/lib/tbot/config" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" ) // RootUID is the UID of the root user diff --git a/tool/tbot/init_test.go b/tool/tbot/init_test.go index d9a26991d4464..7de95edc5d251 100644 --- a/tool/tbot/init_test.go +++ b/tool/tbot/init_test.go @@ -25,12 +25,13 @@ import ( "strings" "testing" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/lib/tbot/botfs" "github.com/gravitational/teleport/lib/tbot/config" "github.com/gravitational/teleport/lib/tbot/identity" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) // usernamesToTry contains a list of usernames we can use as ACL targets in diff --git a/tool/tbot/kube.go b/tool/tbot/kube.go index 4e519a4643152..512093f3ccf80 100644 --- a/tool/tbot/kube.go +++ b/tool/tbot/kube.go @@ -21,10 +21,6 @@ import ( "fmt" "time" - "github.com/gravitational/teleport/api/identityfile" - "github.com/gravitational/teleport/lib/tbot/config" - "github.com/gravitational/teleport/lib/tbot/tshwrap" - "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/trace" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -32,6 +28,11 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/pkg/apis/clientauthentication" clientauthv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" + + "github.com/gravitational/teleport/api/identityfile" + "github.com/gravitational/teleport/lib/tbot/config" + "github.com/gravitational/teleport/lib/tbot/tshwrap" + "github.com/gravitational/teleport/lib/tlsca" ) func getCredentialData(idFile *identityfile.IdentityFile) ([]byte, error) { diff --git a/tool/tbot/main.go b/tool/tbot/main.go index 52ef94e5f4790..9b106708d70d5 100644 --- a/tool/tbot/main.go +++ b/tool/tbot/main.go @@ -25,13 +25,14 @@ import ( "strings" "syscall" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "gopkg.in/yaml.v2" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/tbot" "github.com/gravitational/teleport/lib/tbot/config" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/sirupsen/logrus" - "gopkg.in/yaml.v2" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/tool/tbot/main_test.go b/tool/tbot/main_test.go index 3997d6e673f6b..5937c09190550 100644 --- a/tool/tbot/main_test.go +++ b/tool/tbot/main_test.go @@ -21,8 +21,9 @@ import ( "path/filepath" "testing" - "github.com/gravitational/teleport/lib/utils/golden" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/utils/golden" ) func TestRun_Configure(t *testing.T) { diff --git a/tool/tbot/proxy.go b/tool/tbot/proxy.go index 47bcac34ad4c6..52838bd1ceb87 100644 --- a/tool/tbot/proxy.go +++ b/tool/tbot/proxy.go @@ -19,9 +19,10 @@ package main import ( "path/filepath" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/tbot/config" "github.com/gravitational/teleport/lib/tbot/tshwrap" - "github.com/gravitational/trace" ) func onProxyCommand(botConfig *config.BotConfig, cf *config.CLIConf) error { diff --git a/tool/tctl/common/access_request_command.go b/tool/tctl/common/access_request_command.go index ff7ef693cbf76..0a27ebcd16111 100644 --- a/tool/tctl/common/access_request_command.go +++ b/tool/tctl/common/access_request_command.go @@ -26,13 +26,14 @@ import ( "time" "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/asciitable" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" - "github.com/gravitational/trace" ) // AccessRequestCommand implements `tctl users` set of commands diff --git a/tool/tctl/common/alert_command.go b/tool/tctl/common/alert_command.go index f26d843f3bec3..59fadc543044e 100644 --- a/tool/tctl/common/alert_command.go +++ b/tool/tctl/common/alert_command.go @@ -22,16 +22,15 @@ import ( "strings" "time" + "github.com/google/uuid" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/asciitable" "github.com/gravitational/teleport/lib/auth" libclient "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/service" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" - - "github.com/google/uuid" ) // AlertCommand implements the `tctl alerts` family of commands. diff --git a/tool/tctl/common/auth_command.go b/tool/tctl/common/auth_command.go index f80dc92123b66..7e748f4a41000 100644 --- a/tool/tctl/common/auth_command.go +++ b/tool/tctl/common/auth_command.go @@ -26,6 +26,10 @@ import ( "text/template" "time" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" @@ -40,10 +44,6 @@ import ( "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) // AuthCommand implements `tctl auth` group of commands diff --git a/tool/tctl/common/bots_command.go b/tool/tctl/common/bots_command.go index d8cfd9e1726ea..75c778b221869 100644 --- a/tool/tctl/common/bots_command.go +++ b/tool/tctl/common/bots_command.go @@ -27,6 +27,8 @@ import ( "github.com/google/uuid" "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/constants" @@ -35,7 +37,6 @@ import ( "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" ) type BotsCommand struct { diff --git a/tool/tctl/common/collection.go b/tool/tctl/common/collection.go index f334f0c02a151..9b7b5977c79f8 100644 --- a/tool/tctl/common/collection.go +++ b/tool/tctl/common/collection.go @@ -25,6 +25,8 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" @@ -32,8 +34,6 @@ import ( "github.com/gravitational/teleport/lib/reversetunnel" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) type ResourceCollection interface { diff --git a/tool/tctl/common/collection_test.go b/tool/tctl/common/collection_test.go index 393be4eda3c2a..74a7f048efd3a 100644 --- a/tool/tctl/common/collection_test.go +++ b/tool/tctl/common/collection_test.go @@ -21,9 +21,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/asciitable" - "github.com/stretchr/testify/require" ) var ( diff --git a/tool/tctl/common/db_command.go b/tool/tctl/common/db_command.go index 85c3cdda9f07a..641e837d62670 100644 --- a/tool/tctl/common/db_command.go +++ b/tool/tctl/common/db_command.go @@ -21,6 +21,9 @@ import ( "os" "text/template" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" @@ -29,9 +32,6 @@ import ( libclient "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" ) // DBCommand implements "tctl db" group of commands. diff --git a/tool/tctl/common/desktop_command.go b/tool/tctl/common/desktop_command.go index de6788299a681..b36072a55cd0c 100644 --- a/tool/tctl/common/desktop_command.go +++ b/tool/tctl/common/desktop_command.go @@ -21,9 +21,9 @@ import ( "os" "github.com/gravitational/kingpin" - "github.com/gravitational/teleport" "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/service" diff --git a/tool/tctl/common/inventory_command.go b/tool/tctl/common/inventory_command.go index 3641ec86ce881..06ad6e6f095e6 100644 --- a/tool/tctl/common/inventory_command.go +++ b/tool/tctl/common/inventory_command.go @@ -21,13 +21,13 @@ import ( "fmt" "strings" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/lib/asciitable" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/service" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" ) // InventoryCommand implements the `tctl inventory` family of commands. diff --git a/tool/tctl/common/node_command.go b/tool/tctl/common/node_command.go index dd47f410e5914..a9c12b3c5e05b 100644 --- a/tool/tctl/common/node_command.go +++ b/tool/tctl/common/node_command.go @@ -26,10 +26,10 @@ import ( "time" "github.com/gravitational/kingpin" - "github.com/gravitational/teleport" "github.com/gravitational/trace" log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" apidefaults "github.com/gravitational/teleport/api/defaults" diff --git a/tool/tctl/common/proxy_command.go b/tool/tctl/common/proxy_command.go index 04d3b624d8a2a..97dc41d7d598e 100644 --- a/tool/tctl/common/proxy_command.go +++ b/tool/tctl/common/proxy_command.go @@ -18,12 +18,12 @@ import ( "context" "os" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/service" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" ) // ProxyCommand returns information about connected proxies diff --git a/tool/tctl/common/resource_command.go b/tool/tctl/common/resource_command.go index 4e97be014a645..7b89a52245896 100644 --- a/tool/tctl/common/resource_command.go +++ b/tool/tctl/common/resource_command.go @@ -23,6 +23,11 @@ import ( "os" "time" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + kyaml "k8s.io/apimachinery/pkg/util/yaml" + "github.com/gravitational/teleport" apidefaults "github.com/gravitational/teleport/api/defaults" "github.com/gravitational/teleport/api/types" @@ -34,11 +39,6 @@ import ( "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - log "github.com/sirupsen/logrus" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" - kyaml "k8s.io/apimachinery/pkg/util/yaml" ) // ResourceCreateHandler is the generic implementation of a resource creation handler diff --git a/tool/tctl/common/status_command.go b/tool/tctl/common/status_command.go index 78654859b2c90..df132ee6e92f0 100644 --- a/tool/tctl/common/status_command.go +++ b/tool/tctl/common/status_command.go @@ -21,13 +21,14 @@ import ( "fmt" "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/asciitable" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/tlsca" - "github.com/gravitational/trace" ) // StatusCommand implements `tctl token` group of commands. diff --git a/tool/tctl/common/token_command.go b/tool/tctl/common/token_command.go index 6f71e8ad8eda1..a1cb277e217a8 100644 --- a/tool/tctl/common/token_command.go +++ b/tool/tctl/common/token_command.go @@ -27,6 +27,10 @@ import ( "time" "github.com/ghodss/yaml" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" @@ -36,10 +40,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/tlsca" - log "github.com/sirupsen/logrus" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" ) // TokensCommand implements `tctl tokens` group of commands diff --git a/tool/tctl/common/token_command_test.go b/tool/tctl/common/token_command_test.go index 755f6e534c08b..cb531931bb6ab 100644 --- a/tool/tctl/common/token_command_test.go +++ b/tool/tctl/common/token_command_test.go @@ -21,10 +21,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/config" - "github.com/stretchr/testify/require" ) type addedToken struct { diff --git a/tool/tctl/common/top_command.go b/tool/tctl/common/top_command.go index 314faa2798e2b..7d8ea453038e1 100644 --- a/tool/tctl/common/top_command.go +++ b/tool/tctl/common/top_command.go @@ -26,13 +26,6 @@ import ( "strings" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/constants" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/auth" - "github.com/gravitational/teleport/lib/service" - "github.com/gravitational/teleport/lib/utils" - "github.com/dustin/go-humanize" ui "github.com/gizak/termui/v3" "github.com/gizak/termui/v3/widgets" @@ -41,6 +34,13 @@ import ( "github.com/gravitational/trace" dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/service" + "github.com/gravitational/teleport/lib/utils" ) // TopCommand implements `tctl top` group of commands. diff --git a/tool/tctl/common/user_command.go b/tool/tctl/common/user_command.go index 7435d36ab92f8..6e99875a60e36 100644 --- a/tool/tctl/common/user_command.go +++ b/tool/tctl/common/user_command.go @@ -25,6 +25,8 @@ import ( "time" "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" @@ -32,7 +34,6 @@ import ( "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/service" - "github.com/gravitational/trace" ) // UserCommand implements `tctl users` set of commands diff --git a/tool/tctl/common/user_command_test.go b/tool/tctl/common/user_command_test.go index aacee3ee9612d..e02a5c2f77c52 100644 --- a/tool/tctl/common/user_command_test.go +++ b/tool/tctl/common/user_command_test.go @@ -19,11 +19,12 @@ import ( "testing" "time" + "github.com/gravitational/trace" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/config" - "github.com/gravitational/trace" - "github.com/stretchr/testify/require" ) func TestTrimDurationSuffix(t *testing.T) { diff --git a/tool/tctl/sso/configure/command.go b/tool/tctl/sso/configure/command.go index 844aefb3fa305..28af2d7aaf8f7 100644 --- a/tool/tctl/sso/configure/command.go +++ b/tool/tctl/sso/configure/command.go @@ -18,15 +18,14 @@ import ( "context" "os" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" - - "github.com/sirupsen/logrus" ) // SSOConfigureCommand implements common.CLICommand interface diff --git a/tool/tctl/sso/configure/github.go b/tool/tctl/sso/configure/github.go index 1f1839c731880..76da98e3fbebf 100644 --- a/tool/tctl/sso/configure/github.go +++ b/tool/tctl/sso/configure/github.go @@ -19,14 +19,13 @@ import ( "fmt" "os" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" "github.com/sirupsen/logrus" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" ) type ghExtraFlags struct { diff --git a/tool/tctl/sso/tester/command.go b/tool/tctl/sso/tester/command.go index 150c40c2f8207..afcbad48b79c8 100644 --- a/tool/tctl/sso/tester/command.go +++ b/tool/tctl/sso/tester/command.go @@ -21,6 +21,10 @@ import ( "os" "strings" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + kyaml "k8s.io/apimachinery/pkg/util/yaml" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/client" @@ -28,11 +32,6 @@ import ( "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" - - kyaml "k8s.io/apimachinery/pkg/util/yaml" ) // SSOTestCommand implements common.CLICommand interface diff --git a/tool/tctl/sso/tester/format.go b/tool/tctl/sso/tester/format.go index 92d532bc125c9..5e85c8b5fa8eb 100644 --- a/tool/tctl/sso/tester/format.go +++ b/tool/tctl/sso/tester/format.go @@ -18,9 +18,9 @@ import ( "encoding/json" "fmt" - "github.com/gravitational/teleport/api/types" - "github.com/ghodss/yaml" + + "github.com/gravitational/teleport/api/types" ) func FormatString(description string, msg string) string { diff --git a/tool/tctl/sso/tester/format_test.go b/tool/tctl/sso/tester/format_test.go index 1a9b53e38d704..688ba0453835f 100644 --- a/tool/tctl/sso/tester/format_test.go +++ b/tool/tctl/sso/tester/format_test.go @@ -18,10 +18,10 @@ import ( "fmt" "testing" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/api/types" ) func Test_formatString(t *testing.T) { diff --git a/tool/tctl/sso/tester/github.go b/tool/tctl/sso/tester/github.go index 80dbc7df38cab..e30fd2a30ba83 100644 --- a/tool/tctl/sso/tester/github.go +++ b/tool/tctl/sso/tester/github.go @@ -17,14 +17,14 @@ package tester import ( "context" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/constants" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/services" - - "github.com/gravitational/trace" ) func githubTest(c auth.ClientI, connector types.GithubConnector) (*AuthRequestInfo, error) { diff --git a/tool/teleport/common/configurator.go b/tool/teleport/common/configurator.go index 158550eeabc15..c7a89a576f2be 100644 --- a/tool/teleport/common/configurator.go +++ b/tool/teleport/common/configurator.go @@ -21,13 +21,13 @@ import ( "os" "strings" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/types" apiutils "github.com/gravitational/teleport/api/utils" "github.com/gravitational/teleport/lib/config" dbconfigurators "github.com/gravitational/teleport/lib/configurators/databases" "github.com/gravitational/teleport/lib/utils/prompt" - - "github.com/gravitational/trace" ) // awsDatabaseTypes list of databases supported on the configurator. diff --git a/tool/teleport/common/sftp.go b/tool/teleport/common/sftp.go index ccef2a3c894ad..315d1c575a21d 100644 --- a/tool/teleport/common/sftp.go +++ b/tool/teleport/common/sftp.go @@ -24,15 +24,15 @@ import ( "os" "time" - apievents "github.com/gravitational/teleport/api/types/events" - "github.com/gravitational/teleport/lib/events" - "github.com/gravitational/teleport/lib/utils" - "github.com/gravitational/trace" - "github.com/gogo/protobuf/jsonpb" + "github.com/gravitational/trace" "github.com/pkg/sftp" log "github.com/sirupsen/logrus" "golang.org/x/sys/unix" + + apievents "github.com/gravitational/teleport/api/types/events" + "github.com/gravitational/teleport/lib/events" + "github.com/gravitational/teleport/lib/utils" ) type compositeCh struct { diff --git a/tool/teleport/common/teleport.go b/tool/teleport/common/teleport.go index 1d26f664fb8f7..5d5896789b5dd 100644 --- a/tool/teleport/common/teleport.go +++ b/tool/teleport/common/teleport.go @@ -27,6 +27,10 @@ import ( "strconv" "strings" + "github.com/gravitational/kingpin" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/config" @@ -37,10 +41,6 @@ import ( "github.com/gravitational/teleport/lib/srv" "github.com/gravitational/teleport/lib/sshutils/scp" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/kingpin" - "github.com/gravitational/trace" - log "github.com/sirupsen/logrus" ) // Options combines init/start teleport options diff --git a/tool/teleport/common/teleport_test.go b/tool/teleport/common/teleport_test.go index e24ae186037d3..631e2f661813f 100644 --- a/tool/teleport/common/teleport_test.go +++ b/tool/teleport/common/teleport_test.go @@ -22,15 +22,14 @@ import ( "path/filepath" "testing" + "github.com/gravitational/trace" + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/config" "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/utils" - - log "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - - "github.com/gravitational/trace" ) func TestMain(m *testing.M) { diff --git a/tool/tsh/access_request.go b/tool/tsh/access_request.go index 823ccdc39963a..fcb1147b6ee70 100644 --- a/tool/tsh/access_request.go +++ b/tool/tsh/access_request.go @@ -23,6 +23,9 @@ import ( "strings" "time" + "github.com/ghodss/yaml" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client" "github.com/gravitational/teleport/api/client/proto" @@ -31,9 +34,6 @@ import ( "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/utils" - - "github.com/ghodss/yaml" - "github.com/gravitational/trace" ) var requestLoginHint = "use 'tsh login --request-id=' to login with an approved request" diff --git a/tool/tsh/app.go b/tool/tsh/app.go index edfb23c0e3eb3..a126f4daa0453 100644 --- a/tool/tsh/app.go +++ b/tool/tsh/app.go @@ -26,6 +26,9 @@ import ( "text/template" "time" + "github.com/ghodss/yaml" + "github.com/gravitational/trace" + "github.com/gravitational/teleport" "github.com/gravitational/teleport/api/client/proto" "github.com/gravitational/teleport/api/types" @@ -34,9 +37,6 @@ import ( "github.com/gravitational/teleport/lib/defaults" "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/teleport/lib/utils" - - "github.com/ghodss/yaml" - "github.com/gravitational/trace" ) // onAppLogin implements "tsh app login" command. diff --git a/tool/tsh/app_test.go b/tool/tsh/app_test.go index dd31696949cdf..35cb0b6e21da1 100644 --- a/tool/tsh/app_test.go +++ b/tool/tsh/app_test.go @@ -19,8 +19,9 @@ package main import ( "testing" - "github.com/gravitational/teleport/lib/client" "github.com/stretchr/testify/assert" + + "github.com/gravitational/teleport/lib/client" ) func TestFormatAppConfig(t *testing.T) { diff --git a/tool/tsh/config.go b/tool/tsh/config.go index 75e64ecb730c4..10ad89bcb148f 100644 --- a/tool/tsh/config.go +++ b/tool/tsh/config.go @@ -21,12 +21,12 @@ import ( "net" "strings" + "github.com/coreos/go-semver/semver" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/api/profile" "github.com/gravitational/teleport/api/utils/keypaths" "github.com/gravitational/teleport/lib/config/openssh" - - "github.com/coreos/go-semver/semver" - "github.com/gravitational/trace" ) // writeSSHConfig generates an OpenSSH config block from the `sshConfigTemplate` diff --git a/tool/tsh/config_test.go b/tool/tsh/config_test.go index 151d52418534e..f31c2b99cd2ca 100644 --- a/tool/tsh/config_test.go +++ b/tool/tsh/config_test.go @@ -20,10 +20,10 @@ import ( "strings" "testing" - "github.com/gravitational/teleport/lib/config/openssh" - "github.com/coreos/go-semver/semver" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/config/openssh" ) // TestWriteSSHConfig tests the writeSSHConfig template output. diff --git a/tool/tsh/daemon.go b/tool/tsh/daemon.go index 7c38275a37380..547dea534ba08 100644 --- a/tool/tsh/daemon.go +++ b/tool/tsh/daemon.go @@ -19,12 +19,12 @@ package main import ( "context" + "github.com/gravitational/trace" + "github.com/sirupsen/logrus" + "github.com/gravitational/teleport/api/profile" "github.com/gravitational/teleport/lib/teleterm" "github.com/gravitational/teleport/lib/utils" - "github.com/sirupsen/logrus" - - "github.com/gravitational/trace" ) // onDaemonStart implements "tsh daemon start" command. diff --git a/tool/tsh/fido2.go b/tool/tsh/fido2.go index 1734bdbcaf82a..7ff2050a1a91e 100644 --- a/tool/tsh/fido2.go +++ b/tool/tsh/fido2.go @@ -18,8 +18,9 @@ import ( "fmt" "os" - wancli "github.com/gravitational/teleport/lib/auth/webauthncli" "github.com/gravitational/trace" + + wancli "github.com/gravitational/teleport/lib/auth/webauthncli" ) func onFIDO2Diag(cf *CLIConf) error { diff --git a/tool/tsh/kube.go b/tool/tsh/kube.go index ec35a8b8bebaa..29be2bc8823a3 100644 --- a/tool/tsh/kube.go +++ b/tool/tsh/kube.go @@ -27,19 +27,6 @@ import ( "strings" "time" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/client/proto" - "github.com/gravitational/teleport/api/profile" - "github.com/gravitational/teleport/api/types" - apiutils "github.com/gravitational/teleport/api/utils" - "github.com/gravitational/teleport/api/utils/keypaths" - "github.com/gravitational/teleport/lib/asciitable" - "github.com/gravitational/teleport/lib/client" - "github.com/gravitational/teleport/lib/defaults" - "github.com/gravitational/teleport/lib/kube/kubeconfig" - kubeutils "github.com/gravitational/teleport/lib/kube/utils" - "github.com/gravitational/teleport/lib/utils" - "github.com/ghodss/yaml" "github.com/gravitational/kingpin" "github.com/gravitational/trace" @@ -61,6 +48,19 @@ import ( "k8s.io/kubectl/pkg/polymorphichelpers" "k8s.io/kubectl/pkg/scheme" "k8s.io/kubectl/pkg/util/term" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/profile" + "github.com/gravitational/teleport/api/types" + apiutils "github.com/gravitational/teleport/api/utils" + "github.com/gravitational/teleport/api/utils/keypaths" + "github.com/gravitational/teleport/lib/asciitable" + "github.com/gravitational/teleport/lib/client" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/kube/kubeconfig" + kubeutils "github.com/gravitational/teleport/lib/kube/utils" + "github.com/gravitational/teleport/lib/utils" ) type kubeCommands struct { diff --git a/tool/tsh/kube_test.go b/tool/tsh/kube_test.go index be7178fb77473..a80b615cdd0e5 100644 --- a/tool/tsh/kube_test.go +++ b/tool/tsh/kube_test.go @@ -27,15 +27,15 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "k8s.io/client-go/tools/clientcmd" + clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib" "github.com/gravitational/teleport/lib/asciitable" "github.com/gravitational/teleport/lib/service" "github.com/gravitational/teleport/lib/utils" - - "github.com/stretchr/testify/require" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) func TestListKube(t *testing.T) { diff --git a/tool/tsh/options.go b/tool/tsh/options.go index 3b13b0c4ca320..1ceac7c0ba7cb 100644 --- a/tool/tsh/options.go +++ b/tool/tsh/options.go @@ -22,10 +22,10 @@ import ( "strings" "time" + "github.com/gravitational/trace" + "github.com/gravitational/teleport/lib/client" "github.com/gravitational/teleport/lib/utils" - - "github.com/gravitational/trace" ) // supportedOptions is a listing of all known OpenSSH options diff --git a/tool/tsh/options_test.go b/tool/tsh/options_test.go index aac0fec776bd0..c677827561576 100644 --- a/tool/tsh/options_test.go +++ b/tool/tsh/options_test.go @@ -20,8 +20,9 @@ import ( "testing" "time" - "github.com/gravitational/teleport/lib/client" "github.com/stretchr/testify/require" + + "github.com/gravitational/teleport/lib/client" ) func TestOptions(t *testing.T) { diff --git a/tool/tsh/touchid.go b/tool/tsh/touchid.go index 90c0676c673d7..7b80f88ef3f3b 100644 --- a/tool/tsh/touchid.go +++ b/tool/tsh/touchid.go @@ -20,11 +20,11 @@ import ( "strings" "time" - "github.com/gravitational/teleport/lib/asciitable" - "github.com/gravitational/teleport/lib/auth/touchid" - "github.com/gravitational/kingpin" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/asciitable" + "github.com/gravitational/teleport/lib/auth/touchid" ) type touchIDCommand struct { diff --git a/tool/tsh/tshconfig.go b/tool/tsh/tshconfig.go index 6d08c408ce4e5..f7affab53dffd 100644 --- a/tool/tsh/tshconfig.go +++ b/tool/tsh/tshconfig.go @@ -24,10 +24,10 @@ import ( "regexp" "strings" - "github.com/gravitational/teleport/api/profile" - "github.com/gravitational/trace" "gopkg.in/yaml.v2" + + "github.com/gravitational/teleport/api/profile" ) // .tsh config must go in a subdir as all .yaml files in .tsh get diff --git a/tool/tsh/winwebauthn.go b/tool/tsh/winwebauthn.go index 12b7d548ab27d..dc22779efd86d 100644 --- a/tool/tsh/winwebauthn.go +++ b/tool/tsh/winwebauthn.go @@ -19,8 +19,9 @@ import ( "os" "github.com/gravitational/kingpin" - "github.com/gravitational/teleport/lib/auth/webauthnwin" "github.com/gravitational/trace" + + "github.com/gravitational/teleport/lib/auth/webauthnwin" ) type webauthnwinCommand struct {