Skip to content

Commit

Permalink
eventual consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-r-warren committed Sep 19, 2024
1 parent 1427631 commit 47ecfb5
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/broadinstitute/sherlock/sherlock/internal/models"
"github.com/broadinstitute/sherlock/sherlock/internal/role_propagation/intermediary_user"
"github.com/knadh/koanf"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
"github.com/microsoftgraph/msgraph-sdk-go/users"
Expand Down Expand Up @@ -95,11 +96,14 @@ func (a *AzureAccountEngine) Init(_ context.Context, k *koanf.Koanf) error {

func (a *AzureAccountEngine) LoadCurrentState(ctx context.Context, _ bool) ([]intermediary_user.IntermediaryUser[AzureAccountIdentifier, AzureAccountFields], error) {
currentState := make([]intermediary_user.IntermediaryUser[AzureAccountIdentifier, AzureAccountFields], 0)
headers := abstractions.NewRequestHeaders()
headers.Add("ConsistencyLevel", "eventual")
usersResponse, err := a.client.Users().Get(ctx, &users.UsersRequestBuilderGetRequestConfiguration{
QueryParameters: &users.UsersRequestBuilderGetQueryParameters{
Select: []string{"userPrincipalName", "accountEnabled", "mail", "displayName", "mailNickname", "otherMails"},
Filter: utils.PointerTo(fmt.Sprintf("endsWith(userPrincipalName, '%s')", a.tenantEmailSuffix)),
},
Headers: headers,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 47ecfb5

Please sign in to comment.