Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 3 additions & 33 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1594,12 +1594,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/gofrs/uuid
Version: v4.4.0+incompatible
Dependency : github.com/gofrs/uuid/v5
Version: v5.2.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/gofrs/uuid@v4.4.0+incompatible/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/gofrs/uuid/v5@v5.2.0/LICENSE:

Copyright (C) 2013-2018 by Maxim Bublis <b@codemonkey.ru>

Expand Down Expand Up @@ -12024,36 +12024,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


--------------------------------------------------------------------------------
Dependency : github.com/gofrs/uuid/v5
Version: v5.2.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/gofrs/uuid/v5@v5.2.0/LICENSE:

Copyright (C) 2013-2018 by Maxim Bublis <b@codemonkey.ru>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/gogo/protobuf
Version: v1.3.2
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/elastic/go-ucfg v0.8.8
github.com/fxamacker/cbor/v2 v2.8.0
github.com/go-chi/chi/v5 v5.2.1
github.com/gofrs/uuid v4.4.0+incompatible
github.com/gofrs/uuid/v5 v5.2.0
github.com/google/go-cmp v0.7.0
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-version v1.7.0
Expand Down Expand Up @@ -61,7 +61,6 @@ require (
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gofrs/uuid/v5 v5.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiU
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM=
github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/api/handleEnroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/rollback"
"github.com/elastic/fleet-server/v7/internal/pkg/sqn"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/hashicorp/go-version"
"github.com/miolini/datacounter"
"github.com/rs/zerolog"
Expand Down
15 changes: 4 additions & 11 deletions internal/pkg/apikey/apikey_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
package apikey

import (
"context"
"errors"
"testing"

testlog "github.com/elastic/fleet-server/v7/internal/pkg/testing/log"

"github.com/elastic/go-elasticsearch/v8"
"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/google/go-cmp/cmp"
)

Expand All @@ -32,9 +31,7 @@ const testFleetRoles = `
`

func TestRead_existingKey(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

cfg := elasticsearch.Config{
Username: "elastic",
Expand Down Expand Up @@ -84,9 +81,7 @@ func TestRead_existingKey(t *testing.T) {
}

func TestRead_noKey(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

cfg := elasticsearch.Config{
Username: "elastic",
Expand Down Expand Up @@ -116,9 +111,7 @@ func TestCreateAPIKeyWithMetadata(t *testing.T) {

for _, tt := range tts {
t.Run(tt.name, func(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

cfg := elasticsearch.Config{
Username: "elastic",
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"sync"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/rs/zerolog"

"github.com/elastic/fleet-server/v7/version"
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

testlog "github.com/elastic/fleet-server/v7/internal/pkg/testing/log"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/rs/zerolog"
Expand Down
6 changes: 2 additions & 4 deletions internal/pkg/dl/action_results_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/google/go-cmp/cmp"

"github.com/elastic/fleet-server/v7/internal/pkg/bulk"
Expand Down Expand Up @@ -101,9 +101,7 @@ func (acrs ActionsResults) find(ar model.ActionResult) *model.ActionResult {
}

func TestActionsResultsStored(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

index, bulker, acrs := setupActionResults(ctx, t)

Expand Down
7 changes: 2 additions & 5 deletions internal/pkg/dl/agent_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
package dl

import (
"context"
"encoding/json"
"testing"
"time"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -23,9 +22,7 @@ import (
)

func TestFindAgent_NewModel(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

index, bulker := ftesting.SetupCleanIndex(ctx, t, FleetAgents)

Expand Down
14 changes: 4 additions & 10 deletions internal/pkg/dl/enrollment_api_key_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/google/go-cmp/cmp"
"github.com/rs/xid"

Expand Down Expand Up @@ -53,9 +53,7 @@ func storeRandomEnrollmentAPIKey(ctx context.Context, bulker bulk.Bulk, index st
}

func TestSearchEnrollmentAPIKeyByID(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

index, bulker := ftesting.SetupCleanIndex(ctx, t, FleetEnrollmentAPIKeys)

Expand Down Expand Up @@ -86,9 +84,7 @@ func TestSearchEnrollmentAPIKeyByID(t *testing.T) {

func TestSearchEnrollmentAPIKeyByPolicyID(t *testing.T) {
t.Skip("Flaky test see https://github.com/elastic/fleet-server/issues/1289")
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

index, bulker := ftesting.SetupCleanIndex(ctx, t, FleetEnrollmentAPIKeys)

Expand Down Expand Up @@ -118,9 +114,7 @@ func TestSearchEnrollmentAPIKeyByPolicyID(t *testing.T) {
}

func TestSearchEnrollmentAPIKeyByPolicyIDWithInactiveIDs(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

index, bulker := ftesting.SetupCleanIndex(ctx, t, FleetEnrollmentAPIKeys)

Expand Down
18 changes: 5 additions & 13 deletions internal/pkg/dl/migration_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"testing"
"time"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -72,9 +72,7 @@ func createSomeAgents(ctx context.Context, t *testing.T, n int, apiKey bulk.APIK
}

func TestMigrateOutputs_withDefaultAPIKeyHistory(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

now, err := time.Parse(time.RFC3339, nowStr)
require.NoError(t, err, "could not parse time "+nowStr)
Expand Down Expand Up @@ -164,9 +162,7 @@ func TestMigrateOutputs_withDefaultAPIKeyHistory(t *testing.T) {
}

func TestMigrateOutputs_dontMigrateTwice(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

now, err := time.Parse(time.RFC3339, nowStr)
require.NoError(t, err, "could not parse time "+nowStr)
Expand All @@ -193,9 +189,7 @@ func TestMigrateOutputs_dontMigrateTwice(t *testing.T) {
}

func TestMigrateOutputs_nil_DefaultAPIKeyHistory(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

wantOutputType := "elasticsearch"

Expand Down Expand Up @@ -294,9 +288,7 @@ func TestMigrateOutputs_nil_DefaultAPIKeyHistory(t *testing.T) {
}

func TestMigrateOutputs_no_agent_document(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

now, err := time.Parse(time.RFC3339, nowStr)
require.NoError(t, err, "could not parse time "+nowStr)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/dl/output_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/elastic/fleet-server/v7/internal/pkg/bulk"
"github.com/elastic/fleet-server/v7/internal/pkg/model"
"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
)

func CreateOutputHealth(ctx context.Context, bulker bulk.Bulk, doc model.OutputHealth) error {
Expand Down
14 changes: 4 additions & 10 deletions internal/pkg/dl/policies_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -56,9 +56,7 @@ func storeRandomPolicy(ctx context.Context, bulker bulk.Bulk, index string) (mod
}

func TestQueryLatestPolicies(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

index, bulker := ftesting.SetupCleanIndex(ctx, t, FleetPolicies)

Expand Down Expand Up @@ -87,9 +85,7 @@ func TestQueryLatestPolicies(t *testing.T) {
}

func TestCreatePolicy(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

index, bulker := ftesting.SetupCleanIndex(ctx, t, FleetPolicies)

Expand All @@ -107,9 +103,7 @@ func TestCreatePolicy(t *testing.T) {
}

func TestQueryOutputFromPolicy(t *testing.T) {
ctx, cn := context.WithCancel(context.Background())
defer cn()
ctx = testlog.SetLogger(t).WithContext(ctx)
ctx := testlog.SetLogger(t).WithContext(t.Context())

index, bulker := ftesting.SetupCleanIndex(ctx, t, FleetPolicies)

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/dsl/tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"fmt"
"strings"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
)

const kPrefix = "TMPL."
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/es/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"encoding/json"
"testing"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/google/go-cmp/cmp"
"github.com/rs/xid"

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/file/uploader/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/cache"
"github.com/elastic/fleet-server/v7/internal/pkg/file"
"github.com/elastic/go-elasticsearch/v8"
"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"go.elastic.co/apm/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/logger/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"sync/atomic"
"time"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"github.com/rs/zerolog"

"go.elastic.co/apm/module/apmzerolog/v2"
Expand Down
Loading