fix: more expressive errors (#22448)
* fix: more expressive errors Closes #22446 * fix: server only logging for untyped errors * chore: fix formattingpull/22465/head
parent
3e275a123d
commit
5015297d40
|
@ -4,9 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,12 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/go-chi/chi/middleware"
|
"github.com/go-chi/chi/middleware"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
icontext "github.com/influxdata/influxdb/v2/context"
|
icontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,18 +11,17 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
|
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/google/go-cmp/cmp/cmpopts"
|
"github.com/google/go-cmp/cmp/cmpopts"
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
icontext "github.com/influxdata/influxdb/v2/context"
|
icontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
itesting "github.com/influxdata/influxdb/v2/testing"
|
itesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"go.uber.org/zap/zaptest"
|
"go.uber.org/zap/zaptest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuthedAuthorizationService struct {
|
type AuthedAuthorizationService struct {
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorization_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -13,6 +11,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2/authorization"
|
"github.com/influxdata/influxdb/v2/authorization"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
"github.com/influxdata/influxdb/v2/inmem"
|
"github.com/influxdata/influxdb/v2/inmem"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/kv/migration/all"
|
"github.com/influxdata/influxdb/v2/kv/migration/all"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"github.com/influxdata/influxdb/v2/tenant"
|
"github.com/influxdata/influxdb/v2/tenant"
|
||||||
|
|
|
@ -5,9 +5,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,9 @@ package authorization
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/metric"
|
"github.com/influxdata/influxdb/v2/kit/metric"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorization
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
// tenantService is a mock implementation of an authorization.tenantService
|
// tenantService is a mock implementation of an authorization.tenantService
|
||||||
|
|
|
@ -4,10 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
|
||||||
"github.com/influxdata/influxdb/v2/kv"
|
"github.com/influxdata/influxdb/v2/kv"
|
||||||
"github.com/influxdata/influxdb/v2/rand"
|
"github.com/influxdata/influxdb/v2/rand"
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,6 @@ import (
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/tracing"
|
"github.com/influxdata/influxdb/v2/kit/tracing"
|
||||||
"github.com/influxdata/influxdb/v2/kv"
|
"github.com/influxdata/influxdb/v2/kv"
|
||||||
"github.com/influxdata/influxdb/v2/snowflake"
|
"github.com/influxdata/influxdb/v2/snowflake"
|
||||||
|
|
|
@ -4,11 +4,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/buger/jsonparser"
|
"github.com/buger/jsonparser"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/kv"
|
"github.com/influxdata/influxdb/v2/kv"
|
||||||
jsonp "github.com/influxdata/influxdb/v2/pkg/jsonparser"
|
jsonp "github.com/influxdata/influxdb/v2/pkg/jsonparser"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,13 +3,13 @@ package authorization_test
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorization"
|
"github.com/influxdata/influxdb/v2/authorization"
|
||||||
"github.com/influxdata/influxdb/v2/inmem"
|
"github.com/influxdata/influxdb/v2/inmem"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kv"
|
"github.com/influxdata/influxdb/v2/kv"
|
||||||
"github.com/influxdata/influxdb/v2/kv/migration/all"
|
"github.com/influxdata/influxdb/v2/kv/migration/all"
|
||||||
"go.uber.org/zap/zaptest"
|
"go.uber.org/zap/zaptest"
|
||||||
|
|
|
@ -3,10 +3,9 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// AuthAgent provides a means to authenticate users with resource and their associate actions. It
|
// AuthAgent provides a means to authenticate users with resource and their associate actions. It
|
||||||
|
|
|
@ -2,12 +2,12 @@ package authorizer_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
icontext "github.com/influxdata/influxdb/v2/context"
|
icontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
|
@ -4,10 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.AuthorizationService = (*AuthorizationService)(nil)
|
var _ influxdb.AuthorizationService = (*AuthorizationService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,11 +4,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
icontext "github.com/influxdata/influxdb/v2/context"
|
icontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func isAllowedAll(a influxdb.Authorizer, permissions []influxdb.Permission) error {
|
func isAllowedAll(a influxdb.Authorizer, permissions []influxdb.Permission) error {
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/tracing"
|
"github.com/influxdata/influxdb/v2/kit/tracing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"github.com/influxdata/influxdb/v2/notification/check"
|
"github.com/influxdata/influxdb/v2/notification/check"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.DashboardService = (*DashboardService)(nil)
|
var _ influxdb.DashboardService = (*DashboardService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,9 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.DocumentService = (*DocumentService)(nil)
|
var _ influxdb.DocumentService = (*DocumentService)(nil)
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.LabelService = (*LabelService)(nil)
|
var _ influxdb.LabelService = (*LabelService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,10 +3,9 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.NotificationEndpointService = (*NotificationEndpointService)(nil)
|
var _ influxdb.NotificationEndpointService = (*NotificationEndpointService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"github.com/influxdata/influxdb/v2/notification/endpoint"
|
"github.com/influxdata/influxdb/v2/notification/endpoint"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.NotificationRuleStore = (*NotificationRuleStore)(nil)
|
var _ influxdb.NotificationRuleStore = (*NotificationRuleStore)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"github.com/influxdata/influxdb/v2/notification/rule"
|
"github.com/influxdata/influxdb/v2/notification/rule"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
|
|
|
@ -3,10 +3,9 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
icontext "github.com/influxdata/influxdb/v2/context"
|
icontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.OrganizationService = (*OrgService)(nil)
|
var _ influxdb.OrganizationService = (*OrgService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PasswordService is a new authorization middleware for a password service.
|
// PasswordService is a new authorization middleware for a password service.
|
||||||
|
|
|
@ -2,12 +2,12 @@ package authorizer_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
icontext "github.com/influxdata/influxdb/v2/context"
|
icontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,9 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/tracing"
|
"github.com/influxdata/influxdb/v2/kit/tracing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.ScraperTargetStoreService = (*ScraperTargetStoreService)(nil)
|
var _ influxdb.ScraperTargetStoreService = (*ScraperTargetStoreService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.SecretService = (*SecretService)(nil)
|
var _ influxdb.SecretService = (*SecretService)(nil)
|
||||||
|
|
|
@ -3,14 +3,14 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.SourceService = (*SourceService)(nil)
|
var _ influxdb.SourceService = (*SourceService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,13 +6,12 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_BackupSqlStore(t *testing.T) {
|
func Test_BackupSqlStore(t *testing.T) {
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.TelegrafConfigStore = (*TelegrafConfigService)(nil)
|
var _ influxdb.TelegrafConfigStore = (*TelegrafConfigService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
type OrgIDResolver interface {
|
type OrgIDResolver interface {
|
||||||
|
|
|
@ -2,14 +2,14 @@ package authorizer_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,10 +3,9 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.UserService = (*UserService)(nil)
|
var _ influxdb.UserService = (*UserService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,9 +3,8 @@ package authorizer
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.VariableService = (*VariableService)(nil)
|
var _ influxdb.VariableService = (*VariableService)(nil)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package authorizer_test
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -12,6 +10,8 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,9 +7,8 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
platform "github.com/influxdata/influxdb/v2"
|
platform "github.com/influxdata/influxdb/v2"
|
||||||
|
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/rand"
|
"github.com/influxdata/influxdb/v2/rand"
|
||||||
"github.com/influxdata/influxdb/v2/snowflake"
|
"github.com/influxdata/influxdb/v2/snowflake"
|
||||||
bolt "go.etcd.io/bbolt"
|
bolt "go.etcd.io/bbolt"
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
|
||||||
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
|
||||||
bolt "go.etcd.io/bbolt"
|
bolt "go.etcd.io/bbolt"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,9 +2,9 @@ package bolt_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
"go.uber.org/zap/zapcore"
|
|
||||||
|
|
||||||
"github.com/influxdata/influx-cli/v2/clients"
|
"github.com/influxdata/influx-cli/v2/clients"
|
||||||
"github.com/influxdata/influx-cli/v2/pkg/stdio"
|
"github.com/influxdata/influx-cli/v2/pkg/stdio"
|
||||||
"github.com/influxdata/influxdb/v2/logger"
|
"github.com/influxdata/influxdb/v2/logger"
|
||||||
|
@ -22,6 +20,7 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2/tsdb/index/tsi1"
|
"github.com/influxdata/influxdb/v2/tsdb/index/tsi1"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"go.uber.org/zap/zapcore"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/cli"
|
"github.com/influxdata/influxdb/v2/kit/cli"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/models"
|
"github.com/influxdata/influxdb/v2/models"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/escape"
|
"github.com/influxdata/influxdb/v2/pkg/escape"
|
||||||
"github.com/influxdata/influxdb/v2/tsdb/engine/tsm1"
|
"github.com/influxdata/influxdb/v2/tsdb/engine/tsm1"
|
||||||
|
|
|
@ -8,10 +8,9 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/http"
|
"github.com/influxdata/influxdb/v2/http"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/prom"
|
"github.com/influxdata/influxdb/v2/kit/prom"
|
||||||
"github.com/influxdata/influxdb/v2/models"
|
"github.com/influxdata/influxdb/v2/models"
|
||||||
"github.com/influxdata/influxdb/v2/storage"
|
"github.com/influxdata/influxdb/v2/storage"
|
||||||
|
|
|
@ -76,8 +76,12 @@ import (
|
||||||
telegrafservice "github.com/influxdata/influxdb/v2/telegraf/service"
|
telegrafservice "github.com/influxdata/influxdb/v2/telegraf/service"
|
||||||
"github.com/influxdata/influxdb/v2/telemetry"
|
"github.com/influxdata/influxdb/v2/telemetry"
|
||||||
"github.com/influxdata/influxdb/v2/tenant"
|
"github.com/influxdata/influxdb/v2/tenant"
|
||||||
_ "github.com/influxdata/influxdb/v2/tsdb/engine/tsm1" // needed for tsm1
|
|
||||||
_ "github.com/influxdata/influxdb/v2/tsdb/index/tsi1" // needed for tsi1
|
// needed for tsm1
|
||||||
|
_ "github.com/influxdata/influxdb/v2/tsdb/engine/tsm1"
|
||||||
|
|
||||||
|
// needed for tsi1
|
||||||
|
_ "github.com/influxdata/influxdb/v2/tsdb/index/tsi1"
|
||||||
authv1 "github.com/influxdata/influxdb/v2/v1/authorization"
|
authv1 "github.com/influxdata/influxdb/v2/v1/authorization"
|
||||||
iqlcoordinator "github.com/influxdata/influxdb/v2/v1/coordinator"
|
iqlcoordinator "github.com/influxdata/influxdb/v2/v1/coordinator"
|
||||||
"github.com/influxdata/influxdb/v2/v1/services/meta"
|
"github.com/influxdata/influxdb/v2/v1/services/meta"
|
||||||
|
@ -658,10 +662,11 @@ func (m *Launcher) run(ctx context.Context, opts *InfluxdOpts) (err error) {
|
||||||
ts.BucketService = replications.NewBucketService(
|
ts.BucketService = replications.NewBucketService(
|
||||||
m.log.With(zap.String("service", "replication_buckets")), ts.BucketService, replicationSvc)
|
m.log.With(zap.String("service", "replication_buckets")), ts.BucketService, replicationSvc)
|
||||||
|
|
||||||
|
errorHandler := kithttp.NewErrorHandler(m.log.With(zap.String("handler", "error_logger")))
|
||||||
m.apibackend = &http.APIBackend{
|
m.apibackend = &http.APIBackend{
|
||||||
AssetsPath: opts.AssetsPath,
|
AssetsPath: opts.AssetsPath,
|
||||||
UIDisabled: opts.UIDisabled,
|
UIDisabled: opts.UIDisabled,
|
||||||
HTTPErrorHandler: kithttp.ErrorHandler(0),
|
HTTPErrorHandler: errorHandler,
|
||||||
Logger: m.log,
|
Logger: m.log,
|
||||||
FluxLogEnabled: opts.FluxLogEnabled,
|
FluxLogEnabled: opts.FluxLogEnabled,
|
||||||
SessionRenewDisabled: opts.SessionRenewDisabled,
|
SessionRenewDisabled: opts.SessionRenewDisabled,
|
||||||
|
@ -720,7 +725,7 @@ func (m *Launcher) run(ctx context.Context, opts *InfluxdOpts) (err error) {
|
||||||
WriteEventRecorder: infprom.NewEventRecorder("write"),
|
WriteEventRecorder: infprom.NewEventRecorder("write"),
|
||||||
QueryEventRecorder: infprom.NewEventRecorder("query"),
|
QueryEventRecorder: infprom.NewEventRecorder("query"),
|
||||||
Flagger: m.flagger,
|
Flagger: m.flagger,
|
||||||
FlagsHandler: feature.NewFlagsHandler(kithttp.ErrorHandler(0), feature.ByKey),
|
FlagsHandler: feature.NewFlagsHandler(errorHandler, feature.ByKey),
|
||||||
}
|
}
|
||||||
|
|
||||||
m.reg.MustRegister(m.apibackend.PrometheusCollectors()...)
|
m.reg.MustRegister(m.apibackend.PrometheusCollectors()...)
|
||||||
|
|
|
@ -4,9 +4,8 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/cli"
|
"github.com/influxdata/influxdb/v2/kit/cli"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,8 +15,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/flux"
|
"github.com/influxdata/flux"
|
||||||
"github.com/influxdata/flux/csv"
|
"github.com/influxdata/flux/csv"
|
||||||
"github.com/influxdata/flux/execute"
|
"github.com/influxdata/flux/execute"
|
||||||
|
@ -29,6 +27,7 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/cmd/influxd/launcher"
|
"github.com/influxdata/influxdb/v2/cmd/influxd/launcher"
|
||||||
phttp "github.com/influxdata/influxdb/v2/http"
|
phttp "github.com/influxdata/influxdb/v2/http"
|
||||||
|
errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/kit/prom"
|
"github.com/influxdata/influxdb/v2/kit/prom"
|
||||||
"github.com/influxdata/influxdb/v2/query"
|
"github.com/influxdata/influxdb/v2/query"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
|
@ -9,9 +9,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
platform "github.com/influxdata/influxdb/v2"
|
platform "github.com/influxdata/influxdb/v2"
|
||||||
|
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/v1/services/meta"
|
"github.com/influxdata/influxdb/v2/v1/services/meta"
|
||||||
"github.com/influxdata/influxql"
|
"github.com/influxdata/influxql"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
|
@ -8,12 +8,11 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorization"
|
"github.com/influxdata/influxdb/v2/authorization"
|
||||||
"github.com/influxdata/influxdb/v2/inmem"
|
"github.com/influxdata/influxdb/v2/inmem"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kv/migration"
|
"github.com/influxdata/influxdb/v2/kv/migration"
|
||||||
"github.com/influxdata/influxdb/v2/kv/migration/all"
|
"github.com/influxdata/influxdb/v2/kv/migration/all"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/testing/assert"
|
"github.com/influxdata/influxdb/v2/pkg/testing/assert"
|
||||||
|
|
|
@ -4,10 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type contextKey string
|
type contextKey string
|
||||||
|
|
|
@ -2,11 +2,11 @@ package context_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
icontext "github.com/influxdata/influxdb/v2/context"
|
icontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetAuthorizer(t *testing.T) {
|
func TestGetAuthorizer(t *testing.T) {
|
||||||
|
|
|
@ -6,12 +6,11 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
influxdb "github.com/influxdata/influxdb/v2"
|
influxdb "github.com/influxdata/influxdb/v2"
|
||||||
icontext "github.com/influxdata/influxdb/v2/context"
|
icontext "github.com/influxdata/influxdb/v2/context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/feature"
|
"github.com/influxdata/influxdb/v2/kit/feature"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/kv"
|
"github.com/influxdata/influxdb/v2/kv"
|
||||||
"github.com/influxdata/influxdb/v2/snowflake"
|
"github.com/influxdata/influxdb/v2/snowflake"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,13 +6,12 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/google/go-cmp/cmp/cmpopts"
|
"github.com/google/go-cmp/cmp/cmpopts"
|
||||||
platform "github.com/influxdata/influxdb/v2"
|
platform "github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/feature"
|
"github.com/influxdata/influxdb/v2/kit/feature"
|
||||||
|
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO(goller): remove opPrefix argument
|
// TODO(goller): remove opPrefix argument
|
||||||
|
|
|
@ -7,12 +7,11 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/go-chi/chi/middleware"
|
"github.com/go-chi/chi/middleware"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
|
@ -3,9 +3,8 @@ package dbrp
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,8 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/tracing"
|
"github.com/influxdata/influxdb/v2/kit/tracing"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,13 +2,13 @@ package dbrp_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/dbrp"
|
"github.com/influxdata/influxdb/v2/dbrp"
|
||||||
"github.com/influxdata/influxdb/v2/http"
|
"github.com/influxdata/influxdb/v2/http"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
||||||
"go.uber.org/zap/zaptest"
|
"go.uber.org/zap/zaptest"
|
||||||
|
|
|
@ -5,12 +5,11 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/go-chi/chi/middleware"
|
"github.com/go-chi/chi/middleware"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,10 +3,9 @@ package dbrp
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ influxdb.DBRPMappingService = (*AuthorizedService)(nil)
|
var _ influxdb.DBRPMappingService = (*AuthorizedService)(nil)
|
||||||
|
|
|
@ -2,14 +2,14 @@ package dbrp_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
influxdbcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
"github.com/influxdata/influxdb/v2/dbrp"
|
"github.com/influxdata/influxdb/v2/dbrp"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
influxdbtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,10 +6,11 @@ package mocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
influxdb "github.com/influxdata/influxdb/v2"
|
influxdb "github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
reflect "reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockBucketService is a mock of BucketService interface
|
// MockBucketService is a mock of BucketService interface
|
||||||
|
|
|
@ -6,10 +6,11 @@ package mocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
influxdb "github.com/influxdata/influxdb/v2"
|
influxdb "github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
reflect "reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockDBRPMappingService is a mock of DBRPMappingService interface
|
// MockDBRPMappingService is a mock of DBRPMappingService interface
|
||||||
|
|
|
@ -29,9 +29,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kv"
|
"github.com/influxdata/influxdb/v2/kv"
|
||||||
"github.com/influxdata/influxdb/v2/snowflake"
|
"github.com/influxdata/influxdb/v2/snowflake"
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,9 +8,10 @@ package fluxinit
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/influxdata/flux/runtime"
|
"github.com/influxdata/flux/runtime"
|
||||||
|
|
||||||
_ "github.com/influxdata/flux/stdlib"
|
_ "github.com/influxdata/flux/stdlib"
|
||||||
_ "github.com/influxdata/influxdb/v2/query/stdlib" // Import the stdlib
|
|
||||||
|
// Import the stdlib
|
||||||
|
_ "github.com/influxdata/influxdb/v2/query/stdlib"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The FluxInit() function prepares the runtime for compilation and execution
|
// The FluxInit() function prepares the runtime for compilation and execution
|
||||||
|
|
|
@ -5,9 +5,8 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/gogo/protobuf/proto"
|
"github.com/gogo/protobuf/proto"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/models"
|
"github.com/influxdata/influxdb/v2/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,9 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -112,7 +112,7 @@ func TestAPIHandler_NotFound(t *testing.T) {
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
|
|
||||||
b := &APIBackend{
|
b := &APIBackend{
|
||||||
HTTPErrorHandler: kithttp.ErrorHandler(0),
|
HTTPErrorHandler: kithttp.NewErrorHandler(zaptest.NewLogger(t)),
|
||||||
Logger: zaptest.NewLogger(t),
|
Logger: zaptest.NewLogger(t),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,11 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
platcontext "github.com/influxdata/influxdb/v2/context"
|
platcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,13 +10,12 @@ import (
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
platform "github.com/influxdata/influxdb/v2"
|
platform "github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/authorization"
|
"github.com/influxdata/influxdb/v2/authorization"
|
||||||
pcontext "github.com/influxdata/influxdb/v2/context"
|
pcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"github.com/influxdata/influxdb/v2/kv"
|
"github.com/influxdata/influxdb/v2/kv"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
|
@ -336,7 +335,7 @@ func TestService_handleGetAuthorizations(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
authorizationBackend := NewMockAuthorizationBackend(t)
|
authorizationBackend := NewMockAuthorizationBackend(t)
|
||||||
authorizationBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
authorizationBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
authorizationBackend.AuthorizationService = tt.fields.AuthorizationService
|
authorizationBackend.AuthorizationService = tt.fields.AuthorizationService
|
||||||
authorizationBackend.UserService = tt.fields.UserService
|
authorizationBackend.UserService = tt.fields.UserService
|
||||||
authorizationBackend.OrganizationService = tt.fields.OrganizationService
|
authorizationBackend.OrganizationService = tt.fields.OrganizationService
|
||||||
|
@ -521,7 +520,7 @@ func TestService_handleGetAuthorization(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
authorizationBackend := NewMockAuthorizationBackend(t)
|
authorizationBackend := NewMockAuthorizationBackend(t)
|
||||||
authorizationBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
authorizationBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
authorizationBackend.AuthorizationService = tt.fields.AuthorizationService
|
authorizationBackend.AuthorizationService = tt.fields.AuthorizationService
|
||||||
authorizationBackend.UserService = tt.fields.UserService
|
authorizationBackend.UserService = tt.fields.UserService
|
||||||
authorizationBackend.OrganizationService = tt.fields.OrganizationService
|
authorizationBackend.OrganizationService = tt.fields.OrganizationService
|
||||||
|
@ -701,7 +700,7 @@ func TestService_handlePostAuthorization(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
authorizationBackend := NewMockAuthorizationBackend(t)
|
authorizationBackend := NewMockAuthorizationBackend(t)
|
||||||
authorizationBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
authorizationBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
authorizationBackend.AuthorizationService = tt.fields.AuthorizationService
|
authorizationBackend.AuthorizationService = tt.fields.AuthorizationService
|
||||||
authorizationBackend.UserService = tt.fields.UserService
|
authorizationBackend.UserService = tt.fields.UserService
|
||||||
authorizationBackend.OrganizationService = tt.fields.OrganizationService
|
authorizationBackend.OrganizationService = tt.fields.OrganizationService
|
||||||
|
@ -815,7 +814,7 @@ func TestService_handleDeleteAuthorization(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
authorizationBackend := NewMockAuthorizationBackend(t)
|
authorizationBackend := NewMockAuthorizationBackend(t)
|
||||||
authorizationBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
authorizationBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
authorizationBackend.AuthorizationService = tt.fields.AuthorizationService
|
authorizationBackend.AuthorizationService = tt.fields.AuthorizationService
|
||||||
authorizationBackend.UserService = tt.fields.UserService
|
authorizationBackend.UserService = tt.fields.UserService
|
||||||
authorizationBackend.OrganizationService = tt.fields.OrganizationService
|
authorizationBackend.OrganizationService = tt.fields.OrganizationService
|
||||||
|
@ -920,7 +919,7 @@ func initAuthorizationService(f platformtesting.AuthorizationFields, t *testing.
|
||||||
}
|
}
|
||||||
|
|
||||||
authorizationBackend := NewMockAuthorizationBackend(t)
|
authorizationBackend := NewMockAuthorizationBackend(t)
|
||||||
authorizationBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
authorizationBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
authorizationBackend.AuthorizationService = authService
|
authorizationBackend.AuthorizationService = authService
|
||||||
authorizationBackend.UserService = mus
|
authorizationBackend.UserService = mus
|
||||||
authorizationBackend.OrganizationService = tenantService
|
authorizationBackend.OrganizationService = tenantService
|
||||||
|
@ -937,7 +936,7 @@ func initAuthorizationService(f platformtesting.AuthorizationFields, t *testing.
|
||||||
}
|
}
|
||||||
|
|
||||||
authZ := NewAuthorizationHandler(zaptest.NewLogger(t), authorizationBackend)
|
authZ := NewAuthorizationHandler(zaptest.NewLogger(t), authorizationBackend)
|
||||||
authN := NewAuthenticationHandler(zaptest.NewLogger(t), kithttp.ErrorHandler(0))
|
authN := NewAuthenticationHandler(zaptest.NewLogger(t), kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
authN.AuthorizationService = authService
|
authN.AuthorizationService = authService
|
||||||
authN.Handler = authZ
|
authN.Handler = authZ
|
||||||
authN.UserService = mus
|
authN.UserService = mus
|
||||||
|
|
|
@ -7,12 +7,11 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
platform "github.com/influxdata/influxdb/v2"
|
platform "github.com/influxdata/influxdb/v2"
|
||||||
platcontext "github.com/influxdata/influxdb/v2/context"
|
platcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
"github.com/influxdata/influxdb/v2/jsonweb"
|
"github.com/influxdata/influxdb/v2/jsonweb"
|
||||||
|
errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/opentracing/opentracing-go"
|
"github.com/opentracing/opentracing-go"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -13,6 +12,7 @@ import (
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
platformhttp "github.com/influxdata/influxdb/v2/http"
|
platformhttp "github.com/influxdata/influxdb/v2/http"
|
||||||
"github.com/influxdata/influxdb/v2/jsonweb"
|
"github.com/influxdata/influxdb/v2/jsonweb"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"go.uber.org/zap/zaptest"
|
"go.uber.org/zap/zaptest"
|
||||||
|
@ -210,7 +210,7 @@ func TestAuthenticationHandler(t *testing.T) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
h := platformhttp.NewAuthenticationHandler(zaptest.NewLogger(t), kithttp.ErrorHandler(0))
|
h := platformhttp.NewAuthenticationHandler(zaptest.NewLogger(t), kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
h.AuthorizationService = tt.fields.AuthorizationService
|
h.AuthorizationService = tt.fields.AuthorizationService
|
||||||
h.SessionService = tt.fields.SessionService
|
h.SessionService = tt.fields.SessionService
|
||||||
h.UserService = &mock.UserService{
|
h.UserService = &mock.UserService{
|
||||||
|
@ -377,7 +377,7 @@ func TestAuthenticationHandler_NoAuthRoutes(t *testing.T) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
h := platformhttp.NewAuthenticationHandler(zaptest.NewLogger(t), kithttp.ErrorHandler(0))
|
h := platformhttp.NewAuthenticationHandler(zaptest.NewLogger(t), kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
h.AuthorizationService = mock.NewAuthorizationService()
|
h.AuthorizationService = mock.NewAuthorizationService()
|
||||||
h.SessionService = mock.NewSessionService()
|
h.SessionService = mock.NewSessionService()
|
||||||
h.Handler = handler
|
h.Handler = handler
|
||||||
|
|
|
@ -9,11 +9,10 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/NYTimes/gziphandler"
|
"github.com/NYTimes/gziphandler"
|
||||||
"github.com/influxdata/influxdb/v2/authorizer"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/authorizer"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/kit/tracing"
|
"github.com/influxdata/influxdb/v2/kit/tracing"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
"go.uber.org/zap/zaptest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBackupMetaService(t *testing.T) {
|
func TestBackupMetaService(t *testing.T) {
|
||||||
|
@ -117,7 +118,7 @@ func TestRequireOperPermissions(t *testing.T) {
|
||||||
r = r.WithContext(ctx)
|
r = r.WithContext(ctx)
|
||||||
|
|
||||||
h := BackupHandler{
|
h := BackupHandler{
|
||||||
HTTPErrorHandler: kithttp.ErrorHandler(0),
|
HTTPErrorHandler: kithttp.NewErrorHandler(zaptest.NewLogger(t)),
|
||||||
}
|
}
|
||||||
h.requireOperPermissions(next).ServeHTTP(rr, r)
|
h.requireOperPermissions(next).ServeHTTP(rr, r)
|
||||||
rs := rr.Result()
|
rs := rr.Result()
|
||||||
|
|
|
@ -425,7 +425,7 @@ func TestService_handleGetCheckQuery(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
checkBackend := NewMockCheckBackend(t)
|
checkBackend := NewMockCheckBackend(t)
|
||||||
checkBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
checkBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
checkBackend.CheckService = tt.fields.CheckService
|
checkBackend.CheckService = tt.fields.CheckService
|
||||||
checkBackend.TaskService = &mock.TaskService{
|
checkBackend.TaskService = &mock.TaskService{
|
||||||
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
||||||
|
@ -567,7 +567,7 @@ func TestService_handleGetCheck(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
checkBackend := NewMockCheckBackend(t)
|
checkBackend := NewMockCheckBackend(t)
|
||||||
checkBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
checkBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
checkBackend.CheckService = tt.fields.CheckService
|
checkBackend.CheckService = tt.fields.CheckService
|
||||||
checkBackend.TaskService = &mock.TaskService{
|
checkBackend.TaskService = &mock.TaskService{
|
||||||
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
||||||
|
@ -838,7 +838,7 @@ func TestService_handleDeleteCheck(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
checkBackend := NewMockCheckBackend(t)
|
checkBackend := NewMockCheckBackend(t)
|
||||||
checkBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
checkBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
checkBackend.CheckService = tt.fields.CheckService
|
checkBackend.CheckService = tt.fields.CheckService
|
||||||
checkBackend.TaskService = &mock.TaskService{
|
checkBackend.TaskService = &mock.TaskService{
|
||||||
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
||||||
|
@ -1005,7 +1005,7 @@ func TestService_handlePatchCheck(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
checkBackend := NewMockCheckBackend(t)
|
checkBackend := NewMockCheckBackend(t)
|
||||||
checkBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
checkBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
checkBackend.CheckService = tt.fields.CheckService
|
checkBackend.CheckService = tt.fields.CheckService
|
||||||
checkBackend.TaskService = &mock.TaskService{
|
checkBackend.TaskService = &mock.TaskService{
|
||||||
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
||||||
|
@ -1200,7 +1200,7 @@ func TestService_handleUpdateCheck(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
checkBackend := NewMockCheckBackend(t)
|
checkBackend := NewMockCheckBackend(t)
|
||||||
checkBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
checkBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
checkBackend.CheckService = tt.fields.CheckService
|
checkBackend.CheckService = tt.fields.CheckService
|
||||||
checkBackend.TaskService = &mock.TaskService{
|
checkBackend.TaskService = &mock.TaskService{
|
||||||
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
FindTaskByIDFn: func(ctx context.Context, id platform.ID) (*taskmodel.Task, error) {
|
||||||
|
|
|
@ -8,13 +8,12 @@ import (
|
||||||
http "net/http"
|
http "net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"github.com/influxdata/influxdb/v2/models"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
pcontext "github.com/influxdata/influxdb/v2/context"
|
pcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/kit/tracing"
|
"github.com/influxdata/influxdb/v2/kit/tracing"
|
||||||
|
"github.com/influxdata/influxdb/v2/models"
|
||||||
"github.com/influxdata/influxdb/v2/predicate"
|
"github.com/influxdata/influxdb/v2/predicate"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,14 +10,13 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"github.com/influxdata/influxdb/v2/models"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
pcontext "github.com/influxdata/influxdb/v2/context"
|
pcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
|
"github.com/influxdata/influxdb/v2/models"
|
||||||
influxtesting "github.com/influxdata/influxdb/v2/testing"
|
influxtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
"go.uber.org/zap/zaptest"
|
"go.uber.org/zap/zaptest"
|
||||||
)
|
)
|
||||||
|
@ -381,7 +380,7 @@ func TestDelete(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
deleteBackend := NewMockDeleteBackend(t)
|
deleteBackend := NewMockDeleteBackend(t)
|
||||||
deleteBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
deleteBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
deleteBackend.DeleteService = tt.fields.DeleteService
|
deleteBackend.DeleteService = tt.fields.DeleteService
|
||||||
deleteBackend.OrganizationService = tt.fields.OrganizationService
|
deleteBackend.OrganizationService = tt.fields.OrganizationService
|
||||||
deleteBackend.BucketService = tt.fields.BucketService
|
deleteBackend.BucketService = tt.fields.BucketService
|
||||||
|
|
|
@ -6,11 +6,10 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/kit/tracing"
|
"github.com/influxdata/influxdb/v2/kit/tracing"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
|
@ -70,7 +70,7 @@ func setup(t *testing.T) (func(auth influxdb.Authorizer) *httptest.Server, func(
|
||||||
}
|
}
|
||||||
|
|
||||||
backend := NewMockDocumentBackend(t)
|
backend := NewMockDocumentBackend(t)
|
||||||
backend.HTTPErrorHandler = http.ErrorHandler(0)
|
backend.HTTPErrorHandler = http.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
backend.DocumentService = authorizer.NewDocumentService(svc)
|
backend.DocumentService = authorizer.NewDocumentService(svc)
|
||||||
serverFn := func(auth influxdb.Authorizer) *httptest.Server {
|
serverFn := func(auth influxdb.Authorizer) *httptest.Server {
|
||||||
handler := httpmock.NewAuthMiddlewareHandler(NewDocumentHandler(backend), auth)
|
handler := httpmock.NewAuthMiddlewareHandler(NewDocumentHandler(backend), auth)
|
||||||
|
|
|
@ -7,11 +7,10 @@ import (
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
pcontext "github.com/influxdata/influxdb/v2/context"
|
pcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
influxtesting "github.com/influxdata/influxdb/v2/testing"
|
influxtesting "github.com/influxdata/influxdb/v2/testing"
|
||||||
|
@ -131,7 +130,7 @@ func TestService_handleGetDocuments(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
documentBackend := NewMockDocumentBackend(t)
|
documentBackend := NewMockDocumentBackend(t)
|
||||||
documentBackend.HTTPErrorHandler = kithttp.ErrorHandler(0)
|
documentBackend.HTTPErrorHandler = kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
documentBackend.DocumentService = tt.fields.DocumentService
|
documentBackend.DocumentService = tt.fields.DocumentService
|
||||||
h := NewDocumentHandler(documentBackend)
|
h := NewDocumentHandler(documentBackend)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
|
|
||||||
khttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
khttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,15 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
stderrors "errors"
|
stderrors "errors"
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/influxdata/influxdb/v2/http"
|
"github.com/influxdata/influxdb/v2/http"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
|
"go.uber.org/zap/zaptest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCheckError(t *testing.T) {
|
func TestCheckError(t *testing.T) {
|
||||||
|
@ -23,7 +24,7 @@ func TestCheckError(t *testing.T) {
|
||||||
{
|
{
|
||||||
name: "platform error",
|
name: "platform error",
|
||||||
write: func(w *httptest.ResponseRecorder) {
|
write: func(w *httptest.ResponseRecorder) {
|
||||||
h := kithttp.ErrorHandler(0)
|
h := kithttp.NewErrorHandler(zaptest.NewLogger(t))
|
||||||
err := &errors.Error{
|
err := &errors.Error{
|
||||||
Msg: "expected",
|
Msg: "expected",
|
||||||
Code: errors.EInvalid,
|
Code: errors.EInvalid,
|
||||||
|
|
|
@ -5,9 +5,8 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/kit/prom"
|
"github.com/influxdata/influxdb/v2/kit/prom"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"github.com/influxdata/influxdb/v2/pprof"
|
"github.com/influxdata/influxdb/v2/pprof"
|
||||||
|
|
|
@ -8,14 +8,13 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
|
|
||||||
"github.com/influxdata/flux"
|
"github.com/influxdata/flux"
|
||||||
"github.com/influxdata/flux/csv"
|
"github.com/influxdata/flux/csv"
|
||||||
"github.com/influxdata/flux/lang"
|
"github.com/influxdata/flux/lang"
|
||||||
platform "github.com/influxdata/influxdb/v2"
|
platform "github.com/influxdata/influxdb/v2"
|
||||||
platformhttp "github.com/influxdata/influxdb/v2/http"
|
platformhttp "github.com/influxdata/influxdb/v2/http"
|
||||||
"github.com/influxdata/influxdb/v2/kit/check"
|
"github.com/influxdata/influxdb/v2/kit/check"
|
||||||
|
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/kit/tracing"
|
"github.com/influxdata/influxdb/v2/kit/tracing"
|
||||||
"github.com/influxdata/influxdb/v2/query"
|
"github.com/influxdata/influxdb/v2/query"
|
||||||
"github.com/influxdata/influxdb/v2/query/influxql"
|
"github.com/influxdata/influxdb/v2/query/influxql"
|
||||||
|
|
|
@ -8,11 +8,10 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
"github.com/influxdata/influxdb/v2/pkg/httpc"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,11 +10,10 @@ import (
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/httprouter"
|
"github.com/influxdata/httprouter"
|
||||||
platform "github.com/influxdata/influxdb/v2"
|
platform "github.com/influxdata/influxdb/v2"
|
||||||
|
platform2 "github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
|
||||||
"github.com/influxdata/influxdb/v2/label"
|
"github.com/influxdata/influxdb/v2/label"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
|
@ -114,7 +113,7 @@ func TestService_handleGetLabels(t *testing.T) {
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.ErrorHandler(0))
|
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
|
|
||||||
r := httptest.NewRequest("GET", "http://any.url", nil)
|
r := httptest.NewRequest("GET", "http://any.url", nil)
|
||||||
|
|
||||||
|
@ -222,7 +221,7 @@ func TestService_handleGetLabel(t *testing.T) {
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.ErrorHandler(0))
|
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
|
|
||||||
r := httptest.NewRequest("GET", "http://any.url", nil)
|
r := httptest.NewRequest("GET", "http://any.url", nil)
|
||||||
|
|
||||||
|
@ -317,7 +316,7 @@ func TestService_handlePostLabel(t *testing.T) {
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.ErrorHandler(0))
|
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
|
|
||||||
l, err := json.Marshal(tt.args.label)
|
l, err := json.Marshal(tt.args.label)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -408,7 +407,7 @@ func TestService_handleDeleteLabel(t *testing.T) {
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.ErrorHandler(0))
|
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
|
|
||||||
r := httptest.NewRequest("GET", "http://any.url", nil)
|
r := httptest.NewRequest("GET", "http://any.url", nil)
|
||||||
|
|
||||||
|
@ -547,7 +546,7 @@ func TestService_handlePatchLabel(t *testing.T) {
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.ErrorHandler(0))
|
h := NewLabelHandler(zaptest.NewLogger(t), tt.fields.LabelService, kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
|
|
||||||
upd := platform.LabelUpdate{}
|
upd := platform.LabelUpdate{}
|
||||||
if len(tt.args.properties) > 0 {
|
if len(tt.args.properties) > 0 {
|
||||||
|
@ -624,7 +623,7 @@ func initLabelService(f platformtesting.LabelFields, t *testing.T) (platform.Lab
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handler := NewLabelHandler(zaptest.NewLogger(t), labelService, kithttp.ErrorHandler(0))
|
handler := NewLabelHandler(zaptest.NewLogger(t), labelService, kithttp.NewErrorHandler(zaptest.NewLogger(t)))
|
||||||
server := httptest.NewServer(handler)
|
server := httptest.NewServer(handler)
|
||||||
client := LabelService{
|
client := LabelService{
|
||||||
Client: mustNewHTTPClient(t, server.URL, ""),
|
Client: mustNewHTTPClient(t, server.URL, ""),
|
||||||
|
|
|
@ -3,12 +3,11 @@ package legacy
|
||||||
import (
|
import (
|
||||||
http2 "net/http"
|
http2 "net/http"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/http/metric"
|
"github.com/influxdata/influxdb/v2/http/metric"
|
||||||
"github.com/influxdata/influxdb/v2/influxql"
|
"github.com/influxdata/influxdb/v2/influxql"
|
||||||
"github.com/influxdata/influxdb/v2/kit/cli"
|
"github.com/influxdata/influxdb/v2/kit/cli"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/influxdata/influxdb/v2/query"
|
"github.com/influxdata/influxdb/v2/query"
|
||||||
"github.com/influxdata/influxdb/v2/storage"
|
"github.com/influxdata/influxdb/v2/storage"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
|
|
@ -3,10 +3,9 @@ package legacy
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
pcontext "github.com/influxdata/influxdb/v2/context"
|
pcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
"github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// getAuthorization extracts authorization information from a context.Context.
|
// getAuthorization extracts authorization information from a context.Context.
|
||||||
|
|
|
@ -7,10 +7,9 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
|
|
||||||
|
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
platcontext "github.com/influxdata/influxdb/v2/context"
|
platcontext "github.com/influxdata/influxdb/v2/context"
|
||||||
|
errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
|
||||||
"github.com/opentracing/opentracing-go"
|
"github.com/opentracing/opentracing-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue