Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mvbrock committed Nov 18, 2024
1 parent 88155db commit b20ff8b
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 22 deletions.
1 change: 1 addition & 0 deletions lib/cloud/azure/roleassignments.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package azure

import (
"context"

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2"
Expand Down
1 change: 1 addition & 0 deletions lib/cloud/azure/roledefinitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package azure

import (
"context"

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2"
Expand Down
14 changes: 8 additions & 6 deletions lib/srv/discovery/access_graph_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ package discovery
import (
"context"
"errors"
"io"
"sync"
"time"

"github.com/gravitational/trace"
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"

"github.com/gravitational/teleport/api/types"
"github.com/gravitational/teleport/api/utils/retryutils"
"github.com/gravitational/teleport/entitlements"
accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
"github.com/gravitational/teleport/lib/modules"
"github.com/gravitational/teleport/lib/services"
azure_sync "github.com/gravitational/teleport/lib/srv/discovery/fetchers/azure-sync"
"github.com/gravitational/trace"
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
"io"
"sync"
"time"
)

func (s *Server) reconcileAccessGraphAzure(
Expand Down
2 changes: 1 addition & 1 deletion lib/srv/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"crypto/tls"
"errors"
"fmt"
azure_sync "github.com/gravitational/teleport/lib/srv/discovery/fetchers/azure-sync"
"log/slog"
"slices"
"strings"
Expand Down Expand Up @@ -61,6 +60,7 @@ import (
"github.com/gravitational/teleport/lib/srv/discovery/common"
"github.com/gravitational/teleport/lib/srv/discovery/fetchers"
aws_sync "github.com/gravitational/teleport/lib/srv/discovery/fetchers/aws-sync"
azure_sync "github.com/gravitational/teleport/lib/srv/discovery/fetchers/azure-sync"
"github.com/gravitational/teleport/lib/srv/discovery/fetchers/db"
"github.com/gravitational/teleport/lib/srv/server"
logutils "github.com/gravitational/teleport/lib/utils/log"
Expand Down
3 changes: 2 additions & 1 deletion lib/srv/discovery/fetchers/aws-sync/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
package aws_sync

import (
"github.com/gravitational/teleport/lib/srv/discovery/common"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/testing/protocmp"

"github.com/gravitational/teleport/lib/srv/discovery/common"
)

func TestMergeResources(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lib/srv/discovery/fetchers/aws-sync/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ package aws_sync

import (
"fmt"
"github.com/gravitational/teleport/lib/srv/discovery/common"

"google.golang.org/protobuf/proto"

accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
"github.com/gravitational/teleport/lib/srv/discovery/common"
)

func newResourceList() *accessgraphv1alpha.AWSResourceList {
Expand Down
8 changes: 5 additions & 3 deletions lib/srv/discovery/fetchers/azure-sync/azure-sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ package azure_sync

import (
"context"
"sync"

"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3"
"github.com/gravitational/trace"
"golang.org/x/sync/errgroup"

accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
"github.com/gravitational/teleport/lib/cloud"
"github.com/gravitational/teleport/lib/cloud/azure"
"github.com/gravitational/teleport/lib/srv/discovery/common"
"github.com/gravitational/trace"
"golang.org/x/sync/errgroup"
"sync"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion lib/srv/discovery/fetchers/azure-sync/azure-sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package azure_sync
import (
"context"
"fmt"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3"
"github.com/stretchr/testify/require"
"testing"
)

type testRoleDefCli struct {
Expand Down
3 changes: 2 additions & 1 deletion lib/srv/discovery/fetchers/azure-sync/msggraphclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"io"
"net/http"
"net/url"
"strings"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
)

// GraphClient represents generic MS API client
Expand Down
6 changes: 4 additions & 2 deletions lib/srv/discovery/fetchers/azure-sync/principals.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package azure_sync

import (
"context"
"slices"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
"github.com/gravitational/trace"
"google.golang.org/protobuf/types/known/timestamppb"
"slices"

accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
)

const groupType = "#microsoft.graph.group"
Expand Down
4 changes: 3 additions & 1 deletion lib/srv/discovery/fetchers/azure-sync/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ package azure_sync

import (
"fmt"

"google.golang.org/protobuf/proto"

accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
"github.com/gravitational/teleport/lib/srv/discovery/common"
"google.golang.org/protobuf/proto"
)

func MergeResources(results ...*Resources) *Resources {
Expand Down
6 changes: 4 additions & 2 deletions lib/srv/discovery/fetchers/azure-sync/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
package azure_sync

import (
accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
"github.com/stretchr/testify/require"
"testing"

"github.com/stretchr/testify/require"

accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
)

func TestReconcileResults(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion lib/srv/discovery/fetchers/azure-sync/roleassignments.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ package azure_sync
import (
"context"
"fmt"
accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"

"github.com/gravitational/trace"
"google.golang.org/protobuf/types/known/timestamppb"

accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
)

func (a *Fetcher) fetchRoleAssignments(ctx context.Context) ([]*accessgraphv1alpha.AzureRoleAssignment, error) {
Expand Down
4 changes: 3 additions & 1 deletion lib/srv/discovery/fetchers/azure-sync/roledefinitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ package azure_sync
import (
"context"
"fmt"
accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"

"github.com/gravitational/trace"
"google.golang.org/protobuf/types/known/timestamppb"

accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
)

func (a *Fetcher) fetchRoleDefinitions(ctx context.Context) ([]*accessgraphv1alpha.AzureRoleDefinition, error) {
Expand Down
4 changes: 3 additions & 1 deletion lib/srv/discovery/fetchers/azure-sync/virtualmachines.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ package azure_sync

import (
"context"
accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"

"github.com/gravitational/trace"
"google.golang.org/protobuf/types/known/timestamppb"

accessgraphv1alpha "github.com/gravitational/teleport/gen/proto/go/accessgraph/v1alpha"
)

func (a *Fetcher) fetchVirtualMachines(ctx context.Context) ([]*accessgraphv1alpha.AzureVirtualMachine, error) {
Expand Down

0 comments on commit b20ff8b

Please sign in to comment.