Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Updates to the change log to address build times.
Browse files Browse the repository at this point in the history
  • Loading branch information
dadams39 committed Jan 19, 2023
1 parent 58ad917 commit 0a111cd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Check if the user specified for an exchange backup operation has a mailbox.

### Changed

- Beta Libraries are included in package. This can lead to long build times.


## [v0.1.0] (alpha) - 2023-01-13

Expand Down
20 changes: 20 additions & 0 deletions src/internal/connector/graph/service_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
az "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
ka "github.com/microsoft/kiota-authentication-azure-go"
khttp "github.com/microsoft/kiota-http-go"
beta "github.com/microsoftgraph/msgraph-beta-sdk-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core"
"github.com/pkg/errors"
Expand Down Expand Up @@ -46,6 +47,25 @@ func CreateAdapter(tenant, client, secret string) (*msgraphsdk.GraphRequestAdapt
auth, nil, nil, httpClient)
}

// CreateBetaAdapter uses the provided credentials with the Kiota Azure Libraries.
// Used to access msgraph-beta-sdk-go specific functionality
func CreateBetaAdapter(tenant, client, secret string) (*beta.GraphRequestAdapter, error) {
cred, err := az.NewClientSecretCredential(tenant, client, secret, nil)
if err != nil {
return nil, errors.Wrap(err, "creating beta m365 client credentials")
}

auth, err := ka.NewAzureIdentityAuthenticationProviderWithScopes(
cred,
[]string{"https://graph.microsoft.com/.default"},
)

httpClient := CreateHTTPClient()

return beta.NewGraphRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(
auth, nil, nil, httpClient)
}

// CreateHTTPClient creates the httpClient with middlewares and timeout configured
func CreateHTTPClient() *http.Client {
clientOptions := msgraphsdk.GetDefaultClientOptions()
Expand Down

0 comments on commit 0a111cd

Please sign in to comment.