Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mvbrock committed Jan 13, 2025
1 parent 4ded09c commit f31b342
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 0 additions & 8 deletions lib/msgraph/paginated.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ func (c *Client) IterateServicePrincipals(ctx context.Context, f func(principal
return iterateSimple(c, ctx, "servicePrincipals", f)
}

// IterateUserMemberships lists all group memberships for a given user ID as directory objects.
// `f` will be called for each directory object in the result set.
// if `f` returns `false`, the iteration is stopped (equivalent to `break` in a normal loop).
// Ref: [https://learn.microsoft.com/en-us/graph/api/group-list-memberof].
func (c *Client) IterateUserMemberships(ctx context.Context, userID string, f func(object *DirectoryObject) bool) error {
return iterateSimple(c, ctx, path.Join("users", userID, "memberOf"), f)
}

// IterateGroupMembers lists all members for the given Entra ID group using pagination.
// `f` will be called for each object in the result set.
// if `f` returns `false`, the iteration is stopped (equivalent to `break` in a normal loop).
Expand Down
5 changes: 4 additions & 1 deletion lib/srv/discovery/fetchers/azure-sync/azure-sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package azuresync

import (
"context"
"github.com/gravitational/teleport/lib/msgraph"
"sync"

"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
Expand All @@ -30,6 +29,7 @@ import (
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/msgraph"
"github.com/gravitational/teleport/lib/srv/discovery/common"
)

Expand Down Expand Up @@ -85,6 +85,9 @@ func NewFetcher(cfg Config, ctx context.Context) (*Fetcher, error) {
graphClient, err := msgraph.NewClient(msgraph.Config{
TokenProvider: cred,
})
if err != nil {
return nil, trace.Wrap(err)
}
roleAssignClient, err := azure.NewRoleAssignmentsClient(cfg.SubscriptionID, cred, nil)
if err != nil {
return nil, trace.Wrap(err)
Expand Down

0 comments on commit f31b342

Please sign in to comment.