Compare commits
13 Commits
main
...
beta-page-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ef73b866a | ||
|
|
613de30664 | ||
|
|
0802e97d56 | ||
|
|
d661d45671 | ||
|
|
0cf21f6b2c | ||
|
|
4c000c816d | ||
|
|
29bb06e779 | ||
|
|
6b1e84732e | ||
|
|
39155c68fa | ||
|
|
287dcd6930 | ||
|
|
a9421d7195 | ||
|
|
0a111cd9df | ||
|
|
58ad917d4c |
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -42,6 +42,12 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
## increases swap space for beta and v.1.0
|
||||
- name: Set Swap Space
|
||||
uses: pierotofy/set-swap-space@master
|
||||
with:
|
||||
swap-size-gb: 12
|
||||
|
||||
# single setup and sum cache handling here.
|
||||
# the results will cascade onto both testing and linting.
|
||||
- name: Setup Golang with cache
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
15
src/go.mod
15
src/go.mod
@ -11,12 +11,13 @@ require (
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/kopia/kopia v0.12.2-0.20221229232524-ba938cf58cc8
|
||||
github.com/microsoft/kiota-abstractions-go v0.15.2
|
||||
github.com/microsoft/kiota-authentication-azure-go v0.5.0
|
||||
github.com/microsoft/kiota-http-go v0.11.0
|
||||
github.com/microsoft/kiota-abstractions-go v0.16.0
|
||||
github.com/microsoft/kiota-authentication-azure-go v0.6.0
|
||||
github.com/microsoft/kiota-http-go v0.13.0
|
||||
github.com/microsoft/kiota-serialization-json-go v0.7.2
|
||||
github.com/microsoftgraph/msgraph-sdk-go v0.50.0
|
||||
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1
|
||||
github.com/microsoftgraph/msgraph-beta-sdk-go v0.53.0
|
||||
github.com/microsoftgraph/msgraph-sdk-go v0.52.0
|
||||
github.com/microsoftgraph/msgraph-sdk-go-core v0.33.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/rudderlabs/analytics-go v3.3.3+incompatible
|
||||
github.com/spatialcurrent/go-lazy v0.0.0-20211115014721-47315cc003d1
|
||||
@ -56,8 +57,8 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
|
||||
|
||||
30
src/go.sum
30
src/go.sum
@ -36,12 +36,12 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUXTtj12tQ6zE2GZUgVQw=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 h1:VuHAcMq8pU1IWNT/m5yRaGqbK0BiQKHT8X4DTp9CHdI=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0/go.mod h1:tZoQYdDZNOiIjdSn0dVWVfl0NEPGOJqVLzSrcFk4Is0=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 h1:XUNQ4mw+zJmaA2KXzP9JlQiecy1SI+Eog7xVkPiqIbg=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
@ -267,22 +267,24 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
||||
github.com/microsoft/kiota-abstractions-go v0.15.2 h1:Pp78BbqPvkF2mAMH0Ph37ymwfSH7uF9iYfY1fZ8g630=
|
||||
github.com/microsoft/kiota-abstractions-go v0.15.2/go.mod h1:RT/s9sCzg49i4iO7e2qhyWmX+DlJDgC0P+Wp8fKQQfo=
|
||||
github.com/microsoft/kiota-authentication-azure-go v0.5.0 h1:RVA/tTgMnDIN3u4qPZtvYvVRsQDOFkd3yvi6KXjZJko=
|
||||
github.com/microsoft/kiota-authentication-azure-go v0.5.0/go.mod h1:1Io6h+88FlDRmrajdjSnXPz8oyObUVjNuQZLhrF9kQk=
|
||||
github.com/microsoft/kiota-http-go v0.11.0 h1:0K0y/wZcTvEEX2Xdj5tngJqknqYQpArLdtjB/fo88Dc=
|
||||
github.com/microsoft/kiota-http-go v0.11.0/go.mod h1:4D6vMjT7jQ3IRAJrpFoaDtfS9eMaSjQKHY6ETSV2cc0=
|
||||
github.com/microsoft/kiota-abstractions-go v0.16.0 h1:DZ1L4YsRsQw39iPGnVq2fQkqLXMsazdPwmWsnaH4EZg=
|
||||
github.com/microsoft/kiota-abstractions-go v0.16.0/go.mod h1:RT/s9sCzg49i4iO7e2qhyWmX+DlJDgC0P+Wp8fKQQfo=
|
||||
github.com/microsoft/kiota-authentication-azure-go v0.6.0 h1:Il9bLO34J6D8DY89xYAXoGh9muvlphayqG4eihyT6B8=
|
||||
github.com/microsoft/kiota-authentication-azure-go v0.6.0/go.mod h1:EJCHiLWLXW1/mSgX7lYReAhVO37MzRT5Xi2mcPTwCRQ=
|
||||
github.com/microsoft/kiota-http-go v0.13.0 h1:CZSC+UrBSwjIvLlVh+AEPsDbD0c17AWd/QPRHIljd8k=
|
||||
github.com/microsoft/kiota-http-go v0.13.0/go.mod h1:aWtBlFhCetH0JmouvN3hiSaJoqCEdVHPqlrcLYExs3k=
|
||||
github.com/microsoft/kiota-serialization-form-go v0.2.0 h1:jgPE+8DtrWhL+KwnAwRm13HnMNydbelC/NP9wRGwDUo=
|
||||
github.com/microsoft/kiota-serialization-form-go v0.2.0/go.mod h1:chOuh09tO7IrNtubAumdlG5wnrcYdMkjV7joVVGDyGs=
|
||||
github.com/microsoft/kiota-serialization-json-go v0.7.2 h1:DSb4fNDi5O+DqJwrHo+vRy2kSvfxG5VtN6m1EHzn5Vw=
|
||||
github.com/microsoft/kiota-serialization-json-go v0.7.2/go.mod h1:Ojum5prlijopyCOZ2XctRcVlE2pU8h+43r3tMdiWoDU=
|
||||
github.com/microsoft/kiota-serialization-text-go v0.6.0 h1:3N2vftYZlwKdog69AN7ha+FZT0QxPG7xp/hLv0/W2OQ=
|
||||
github.com/microsoft/kiota-serialization-text-go v0.6.0/go.mod h1:OUA4dNH+f6afiJUs+rQAatJos7QVF5PJkyrqoD89lx4=
|
||||
github.com/microsoftgraph/msgraph-sdk-go v0.50.0 h1:yfPBDr7+tSdq8jKiNCvY5XzQji1kZzOHXvxQ9XxQ4E4=
|
||||
github.com/microsoftgraph/msgraph-sdk-go v0.50.0/go.mod h1:XoTT9lzRSersVV4/lsFup3sOLfOLEf2dMsLckiAAKq8=
|
||||
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1 h1:aVvnO5l8qLCEcvELc5n9grt7UXhAVtpog1QeQKLMlTE=
|
||||
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1/go.mod h1:RE4F2qGCTehGtQGc9Txafc4l+XMpbjYuO4amDLFgOWE=
|
||||
github.com/microsoftgraph/msgraph-beta-sdk-go v0.53.0 h1:FITWxC0U8u9J82iUnTUgKhFw048OFq6hNiShpIgJx2k=
|
||||
github.com/microsoftgraph/msgraph-beta-sdk-go v0.53.0/go.mod h1:hyea6/iVBicq7jjlU8nzmkFys2ajScSI2q1GX9gjnIQ=
|
||||
github.com/microsoftgraph/msgraph-sdk-go v0.52.0 h1:hcFSvgxsN6xG9xGC/Y8jFasU+99OleAVZJb8rKBuISg=
|
||||
github.com/microsoftgraph/msgraph-sdk-go v0.52.0/go.mod h1:RF7cVKAu0EZUmNxXZZ6orJJml02Cf85d1FFOxJ+nbRg=
|
||||
github.com/microsoftgraph/msgraph-sdk-go-core v0.33.0 h1:cDL3ov/IZ2ZarUJdGGPsdR+46ALdd3CRAiDBIylLCoA=
|
||||
github.com/microsoftgraph/msgraph-sdk-go-core v0.33.0/go.mod h1:d0mU3PQAWnN/C4CwPJEZz2QhesrnR5UDnqRu2ODWPkI=
|
||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
||||
github.com/minio/minio-go/v7 v7.0.45 h1:g4IeM9M9pW/Lo8AGGNOjBZYlvmtlE1N5TQEYWXRWzIs=
|
||||
|
||||
@ -278,7 +278,8 @@ func (c Mail) Serialize(
|
||||
|
||||
if retriesErr != nil {
|
||||
logger.Ctx(ctx).Debug("exceeded maximum retries")
|
||||
return nil, support.WrapAndAppend(itemID, errors.Wrap(retriesErr, "attachment failed"), nil)
|
||||
return nil, support.WrapAndAppend(itemID,
|
||||
support.ConnectorStackErrorTraceWrap(retriesErr, "attachment Failed"), nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
absser "github.com/microsoft/kiota-abstractions-go/serialization"
|
||||
beta "github.com/microsoftgraph/msgraph-beta-sdk-go"
|
||||
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@ -45,6 +46,28 @@ func (s Service) Client() *msgraphsdk.GraphServiceClient {
|
||||
return s.client
|
||||
}
|
||||
|
||||
// BetaService provides access to API Calls that are present solely in the Beta library.
|
||||
// Does not fulfill the interface as the base libraries vary.
|
||||
type BetaService struct {
|
||||
adapter *beta.GraphRequestAdapter
|
||||
client *beta.GraphBaseServiceClient
|
||||
}
|
||||
|
||||
func (bs BetaService) Adapter() *beta.GraphRequestAdapter {
|
||||
return bs.adapter
|
||||
}
|
||||
|
||||
func (bs BetaService) Client() *beta.GraphBaseServiceClient {
|
||||
return bs.client
|
||||
}
|
||||
|
||||
func NewBetaService(adapter *beta.GraphRequestAdapter) *BetaService {
|
||||
return &BetaService{
|
||||
adapter: adapter,
|
||||
client: beta.NewGraphBaseServiceClient(adapter),
|
||||
}
|
||||
}
|
||||
|
||||
// Seraialize writes an M365 parsable object into a byte array using the built-in
|
||||
// application/json writer within the adapter.
|
||||
func (s Service) Serialize(object absser.Parsable) ([]byte, error) {
|
||||
|
||||
@ -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"
|
||||
@ -46,6 +47,28 @@ 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"},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "creating beta auth token")
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
@ -43,6 +43,21 @@ func (suite *GraphUnitSuite) TestCreateAdapter() {
|
||||
assert.NotNil(t, adpt)
|
||||
}
|
||||
|
||||
func (suite *GraphUnitSuite) TestBetaService() {
|
||||
t := suite.T()
|
||||
adpt, err := graph.CreateBetaAdapter(
|
||||
suite.credentials.AzureTenantID,
|
||||
suite.credentials.AzureClientID,
|
||||
suite.credentials.AzureClientSecret,
|
||||
)
|
||||
|
||||
assert.NoError(t, err)
|
||||
require.NotNil(t, adpt)
|
||||
|
||||
serv := graph.NewBetaService(adpt)
|
||||
assert.NotNil(t, serv)
|
||||
}
|
||||
|
||||
func (suite *GraphUnitSuite) TestSerializationEndPoint() {
|
||||
t := suite.T()
|
||||
adpt, err := graph.CreateAdapter(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user