diff --git a/cmd/createrole.go b/cmd/createrole.go index 8dc22ed8f..8c266caa2 100644 --- a/cmd/createrole.go +++ b/cmd/createrole.go @@ -5,12 +5,13 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" + "go.infratographer.com/x/gidx" + "go.infratographer.com/x/viperx" + "go.infratographer.com/permissions-api/internal/config" "go.infratographer.com/permissions-api/internal/iapl" "go.infratographer.com/permissions-api/internal/query" "go.infratographer.com/permissions-api/internal/spicedbx" - "go.infratographer.com/x/gidx" - "go.infratographer.com/x/viperx" ) const ( diff --git a/cmd/schema_mermaid.go b/cmd/schema_mermaid.go index b4de914a8..8b20711e5 100644 --- a/cmd/schema_mermaid.go +++ b/cmd/schema_mermaid.go @@ -6,8 +6,9 @@ import ( "os" "text/template" - "go.infratographer.com/permissions-api/internal/iapl" "gopkg.in/yaml.v3" + + "go.infratographer.com/permissions-api/internal/iapl" ) var ( diff --git a/internal/api/assignments.go b/internal/api/assignments.go index 7cac3efa8..24330a798 100644 --- a/internal/api/assignments.go +++ b/internal/api/assignments.go @@ -3,9 +3,10 @@ package api import ( "net/http" - "go.infratographer.com/permissions-api/internal/types" "go.infratographer.com/x/gidx" + "go.infratographer.com/permissions-api/internal/types" + "github.com/labstack/echo/v4" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" diff --git a/internal/api/permissions.go b/internal/api/permissions.go index c2fc4d81e..1be231a95 100644 --- a/internal/api/permissions.go +++ b/internal/api/permissions.go @@ -8,11 +8,12 @@ import ( "time" "github.com/labstack/echo/v4" - "go.infratographer.com/permissions-api/internal/query" - "go.infratographer.com/permissions-api/internal/types" "go.infratographer.com/x/gidx" "go.opentelemetry.io/otel/codes" "go.uber.org/multierr" + + "go.infratographer.com/permissions-api/internal/query" + "go.infratographer.com/permissions-api/internal/types" ) const ( diff --git a/internal/api/router.go b/internal/api/router.go index e5b869f51..2594c2b96 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -5,12 +5,13 @@ import ( "net/http" "github.com/labstack/echo/v4" - "go.infratographer.com/permissions-api/internal/query" - "go.infratographer.com/permissions-api/internal/types" "go.infratographer.com/x/echojwtx" "go.infratographer.com/x/gidx" "go.opentelemetry.io/otel" "go.uber.org/zap" + + "go.infratographer.com/permissions-api/internal/query" + "go.infratographer.com/permissions-api/internal/types" ) var tracer = otel.Tracer("go.infratographer.com/permissions-api/internal/api") diff --git a/internal/iapl/policy.go b/internal/iapl/policy.go index f1643e288..9cdaa7dcc 100644 --- a/internal/iapl/policy.go +++ b/internal/iapl/policy.go @@ -5,6 +5,7 @@ import ( "os" "go.infratographer.com/permissions-api/internal/types" + "gopkg.in/yaml.v3" ) diff --git a/internal/iapl/policy_test.go b/internal/iapl/policy_test.go index 4dfd21fbe..e01b6121d 100644 --- a/internal/iapl/policy_test.go +++ b/internal/iapl/policy_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "go.infratographer.com/permissions-api/internal/testingx" ) diff --git a/internal/pubsub/subscriber.go b/internal/pubsub/subscriber.go index dc74f9d79..b1fedc607 100644 --- a/internal/pubsub/subscriber.go +++ b/internal/pubsub/subscriber.go @@ -7,8 +7,6 @@ import ( "sync" "time" - "go.infratographer.com/permissions-api/internal/query" - "go.infratographer.com/permissions-api/internal/types" "go.infratographer.com/x/events" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" @@ -16,6 +14,9 @@ import ( "go.opentelemetry.io/otel/trace" "go.uber.org/multierr" "go.uber.org/zap" + + "go.infratographer.com/permissions-api/internal/query" + "go.infratographer.com/permissions-api/internal/types" ) const nakDelay = 10 * time.Second diff --git a/internal/pubsub/subscriber_test.go b/internal/pubsub/subscriber_test.go index 8ce35c531..174a013b2 100644 --- a/internal/pubsub/subscriber_test.go +++ b/internal/pubsub/subscriber_test.go @@ -6,13 +6,14 @@ import ( "testing" "time" - "go.infratographer.com/permissions-api/internal/query" - "go.infratographer.com/permissions-api/internal/query/mock" - "go.infratographer.com/permissions-api/internal/testingx" "go.infratographer.com/x/events" "go.infratographer.com/x/gidx" "go.infratographer.com/x/testing/eventtools" + "go.infratographer.com/permissions-api/internal/query" + "go.infratographer.com/permissions-api/internal/query/mock" + "go.infratographer.com/permissions-api/internal/testingx" + "github.com/stretchr/testify/require" ) diff --git a/internal/query/relations.go b/internal/query/relations.go index 0181444c4..af5e51f07 100644 --- a/internal/query/relations.go +++ b/internal/query/relations.go @@ -8,12 +8,13 @@ import ( "strings" pb "github.com/authzed/authzed-go/proto/authzed/api/v1" - "go.infratographer.com/permissions-api/internal/types" "go.infratographer.com/x/gidx" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" "go.uber.org/multierr" + + "go.infratographer.com/permissions-api/internal/types" ) var roleSubjectRelation = "subject" diff --git a/internal/query/relations_test.go b/internal/query/relations_test.go index c844d40f7..57f534577 100644 --- a/internal/query/relations_test.go +++ b/internal/query/relations_test.go @@ -9,11 +9,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.infratographer.com/x/gidx" + "go.infratographer.com/permissions-api/internal/iapl" "go.infratographer.com/permissions-api/internal/spicedbx" "go.infratographer.com/permissions-api/internal/testingx" "go.infratographer.com/permissions-api/internal/types" - "go.infratographer.com/x/gidx" ) func testEngine(ctx context.Context, t *testing.T, namespace string) Engine { diff --git a/internal/query/roles.go b/internal/query/roles.go index 13ae969d2..6d19254dd 100644 --- a/internal/query/roles.go +++ b/internal/query/roles.go @@ -1,8 +1,9 @@ package query import ( - "go.infratographer.com/permissions-api/internal/types" "go.infratographer.com/x/gidx" + + "go.infratographer.com/permissions-api/internal/types" ) const ( diff --git a/pkg/permissions/mockpermissions/permissions.go b/pkg/permissions/mockpermissions/permissions.go index 7bb455ebd..127b7a538 100644 --- a/pkg/permissions/mockpermissions/permissions.go +++ b/pkg/permissions/mockpermissions/permissions.go @@ -6,9 +6,10 @@ import ( "context" "github.com/stretchr/testify/mock" - "go.infratographer.com/permissions-api/pkg/permissions" "go.infratographer.com/x/events" "go.infratographer.com/x/gidx" + + "go.infratographer.com/permissions-api/pkg/permissions" ) var _ permissions.AuthRelationshipRequestHandler = (*MockPermissions)(nil) diff --git a/pkg/permissions/mockpermissions/permissions_test.go b/pkg/permissions/mockpermissions/permissions_test.go index cfcea1def..d30b0f826 100644 --- a/pkg/permissions/mockpermissions/permissions_test.go +++ b/pkg/permissions/mockpermissions/permissions_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.infratographer.com/permissions-api/pkg/permissions" - "go.infratographer.com/permissions-api/pkg/permissions/mockpermissions" "go.infratographer.com/x/events" "go.infratographer.com/x/gidx" + + "go.infratographer.com/permissions-api/pkg/permissions" + "go.infratographer.com/permissions-api/pkg/permissions/mockpermissions" ) func TestPermissions(t *testing.T) { diff --git a/pkg/permissions/permissions_test.go b/pkg/permissions/permissions_test.go index 90949920e..0867d0a10 100644 --- a/pkg/permissions/permissions_test.go +++ b/pkg/permissions/permissions_test.go @@ -8,9 +8,10 @@ import ( "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" - "go.infratographer.com/permissions-api/pkg/permissions" "go.infratographer.com/x/echojwtx" "go.infratographer.com/x/gidx" + + "go.infratographer.com/permissions-api/pkg/permissions" ) func TestPermissions(t *testing.T) { diff --git a/pkg/permissions/relationships_test.go b/pkg/permissions/relationships_test.go index 75cd6a12f..abc69e20a 100644 --- a/pkg/permissions/relationships_test.go +++ b/pkg/permissions/relationships_test.go @@ -8,10 +8,11 @@ import ( "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" - "go.infratographer.com/permissions-api/pkg/permissions" "go.infratographer.com/x/events" "go.infratographer.com/x/gidx" "go.infratographer.com/x/testing/eventtools" + + "go.infratographer.com/permissions-api/pkg/permissions" ) func TestMiddlewareMissing(t *testing.T) {