diff --git a/go.mod b/go.mod index 6de92af8907..8f8836a37a2 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/go-sql-driver/mysql v1.6.0 github.com/go-stack/stack v1.8.0 github.com/gobwas/glob v0.2.3 - github.com/gofrs/uuid v4.0.0+incompatible + github.com/gofrs/uuid v4.0.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.6.0 github.com/golang/snappy v0.0.4 diff --git a/pkg/api/dashboard_public_test.go b/pkg/api/dashboard_public_test.go index b916ddd2c74..3c99b40b74d 100644 --- a/pkg/api/dashboard_public_test.go +++ b/pkg/api/dashboard_public_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/gofrs/uuid" + "github.com/google/uuid" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/data" "github.com/stretchr/testify/assert" @@ -60,7 +60,7 @@ func TestAPIGetPublicDashboard(t *testing.T) { }) DashboardUid := "dashboard-abcd1234" - token, err := uuid.NewV4() + token, err := uuid.NewRandom() require.NoError(t, err) accessToken := fmt.Sprintf("%x", token) diff --git a/pkg/extensions/main.go b/pkg/extensions/main.go index c6195b78093..72371bdab40 100644 --- a/pkg/extensions/main.go +++ b/pkg/extensions/main.go @@ -8,6 +8,8 @@ import ( _ "github.com/Azure/go-autorest/autorest" _ "github.com/Azure/go-autorest/autorest/adal" _ "github.com/beevik/etree" + _ "github.com/blugelabs/bluge" + _ "github.com/blugelabs/bluge_segment_api" _ "github.com/cortexproject/cortex/pkg/util" _ "github.com/crewjam/saml" _ "github.com/gobwas/glob" diff --git a/pkg/services/dashboards/service/dashboard_public.go b/pkg/services/dashboards/service/dashboard_public.go index 1e1c3124e39..ef5aa58e093 100644 --- a/pkg/services/dashboards/service/dashboard_public.go +++ b/pkg/services/dashboards/service/dashboard_public.go @@ -5,8 +5,7 @@ import ( "fmt" "time" - "github.com/gofrs/uuid" - + "github.com/google/uuid" "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/models" @@ -146,10 +145,10 @@ func (dr *DashboardServiceImpl) BuildPublicDashboardMetricRequest(ctx context.Co // generates a uuid formatted without dashes to use as access token func GenerateAccessToken() (string, error) { - token, err := uuid.NewV4() + token, err := uuid.NewRandom() if err != nil { return "", err } - return fmt.Sprintf("%x", token), nil + return fmt.Sprintf("%x", token[:]), nil } diff --git a/pkg/services/dashboards/service/dashboard_public_test.go b/pkg/services/dashboards/service/dashboard_public_test.go index d6bbfd43ca7..74e2efd62f3 100644 --- a/pkg/services/dashboards/service/dashboard_public_test.go +++ b/pkg/services/dashboards/service/dashboard_public_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/gofrs/uuid" + "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -153,8 +153,8 @@ func TestSavePublicDashboard(t *testing.T) { // Time settings set by db assert.Equal(t, timeSettings, pubdash.TimeSettings) // accessToken is valid uuid - _, err = uuid.FromString(pubdash.AccessToken) - require.NoError(t, err) + _, err = uuid.Parse(pubdash.AccessToken) + require.NoError(t, err, "expected a valid UUID, got %s", pubdash.AccessToken) }) t.Run("Validate pubdash has default time setting value", func(t *testing.T) {