Compare commits

...

13 Commits

Author SHA1 Message Date
Danny Adams
7ef73b866a Update for Beta Connector. 2023-01-19 16:41:32 -05:00
Danny Adams
613de30664 Updates to error response. Test to verify time for cache. 2023-01-19 16:23:39 -05:00
Danny
0802e97d56
Update ci.yml
Troubleshooting passed 8 GB.
2023-01-19 10:53:49 -05:00
Danny
d661d45671
Update ci.yml
Troubleshooting
2023-01-19 10:17:52 -05:00
Danny Adams
0cf21f6b2c Incremental increase of swap space. 2023-01-19 09:48:06 -05:00
Danny Adams
4c000c816d Adjust to swap space. 2023-01-19 09:42:30 -05:00
Danny Adams
29bb06e779 Updates to ci.yml
Increases swap space for build.
2023-01-19 09:37:49 -05:00
Danny Adams
6b1e84732e Merge branch 'main' into beta-page-connector 2023-01-19 01:34:33 -05:00
Danny Adams
39155c68fa Updates to msgraph-sdk-go to comply with abstraction changes brought in
via Beta.
2023-01-18 23:49:06 -05:00
Danny Adams
287dcd6930 Testing for new struct added. 2023-01-18 23:35:20 -05:00
Danny Adams
a9421d7195 Beta Servicer created. 2023-01-18 23:34:58 -05:00
Danny Adams
0a111cd9df Updates to the change log to address build times. 2023-01-18 23:33:18 -05:00
Danny Adams
58ad917d4c Beta packages updated. 2023-01-18 22:55:33 -05:00
8 changed files with 98 additions and 23 deletions

View File

@ -41,6 +41,12 @@ jobs:
working-directory: src working-directory: src
steps: steps:
- uses: actions/checkout@v3 - 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. # single setup and sum cache handling here.
# the results will cascade onto both testing and linting. # the results will cascade onto both testing and linting.
@ -633,4 +639,4 @@ jobs:
steps: steps:
- name: Validate docs - name: Validate docs
run: | run: |
curl https://corsobackup.io/docs/quickstart/ | grep https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_x86_64.tar.gz curl https://corsobackup.io/docs/quickstart/ | grep https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_x86_64.tar.gz

View File

@ -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. - 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 ## [v0.1.0] (alpha) - 2023-01-13

View File

@ -11,12 +11,13 @@ require (
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-multierror v1.1.1
github.com/kopia/kopia v0.12.2-0.20221229232524-ba938cf58cc8 github.com/kopia/kopia v0.12.2-0.20221229232524-ba938cf58cc8
github.com/microsoft/kiota-abstractions-go v0.15.2 github.com/microsoft/kiota-abstractions-go v0.16.0
github.com/microsoft/kiota-authentication-azure-go v0.5.0 github.com/microsoft/kiota-authentication-azure-go v0.6.0
github.com/microsoft/kiota-http-go v0.11.0 github.com/microsoft/kiota-http-go v0.13.0
github.com/microsoft/kiota-serialization-json-go v0.7.2 github.com/microsoft/kiota-serialization-json-go v0.7.2
github.com/microsoftgraph/msgraph-sdk-go v0.50.0 github.com/microsoftgraph/msgraph-beta-sdk-go v0.53.0
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1 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/pkg/errors v0.9.1
github.com/rudderlabs/analytics-go v3.3.3+incompatible github.com/rudderlabs/analytics-go v3.3.3+incompatible
github.com/spatialcurrent/go-lazy v0.0.0-20211115014721-47315cc003d1 github.com/spatialcurrent/go-lazy v0.0.0-20211115014721-47315cc003d1
@ -56,8 +57,8 @@ require (
) )
require ( require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // 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/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect

View File

@ -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.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= 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= 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.3.0 h1:VuHAcMq8pU1IWNT/m5yRaGqbK0BiQKHT8X4DTp9CHdI=
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/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 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/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.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8=
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/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 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM=
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= 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= 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/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 h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= 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.16.0 h1:DZ1L4YsRsQw39iPGnVq2fQkqLXMsazdPwmWsnaH4EZg=
github.com/microsoft/kiota-abstractions-go v0.15.2/go.mod h1:RT/s9sCzg49i4iO7e2qhyWmX+DlJDgC0P+Wp8fKQQfo= github.com/microsoft/kiota-abstractions-go v0.16.0/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.6.0 h1:Il9bLO34J6D8DY89xYAXoGh9muvlphayqG4eihyT6B8=
github.com/microsoft/kiota-authentication-azure-go v0.5.0/go.mod h1:1Io6h+88FlDRmrajdjSnXPz8oyObUVjNuQZLhrF9kQk= github.com/microsoft/kiota-authentication-azure-go v0.6.0/go.mod h1:EJCHiLWLXW1/mSgX7lYReAhVO37MzRT5Xi2mcPTwCRQ=
github.com/microsoft/kiota-http-go v0.11.0 h1:0K0y/wZcTvEEX2Xdj5tngJqknqYQpArLdtjB/fo88Dc= github.com/microsoft/kiota-http-go v0.13.0 h1:CZSC+UrBSwjIvLlVh+AEPsDbD0c17AWd/QPRHIljd8k=
github.com/microsoft/kiota-http-go v0.11.0/go.mod h1:4D6vMjT7jQ3IRAJrpFoaDtfS9eMaSjQKHY6ETSV2cc0= 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 h1:jgPE+8DtrWhL+KwnAwRm13HnMNydbelC/NP9wRGwDUo=
github.com/microsoft/kiota-serialization-form-go v0.2.0/go.mod h1:chOuh09tO7IrNtubAumdlG5wnrcYdMkjV7joVVGDyGs= 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 h1:DSb4fNDi5O+DqJwrHo+vRy2kSvfxG5VtN6m1EHzn5Vw=
github.com/microsoft/kiota-serialization-json-go v0.7.2/go.mod h1:Ojum5prlijopyCOZ2XctRcVlE2pU8h+43r3tMdiWoDU= 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 h1:3N2vftYZlwKdog69AN7ha+FZT0QxPG7xp/hLv0/W2OQ=
github.com/microsoft/kiota-serialization-text-go v0.6.0/go.mod h1:OUA4dNH+f6afiJUs+rQAatJos7QVF5PJkyrqoD89lx4= 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-beta-sdk-go v0.53.0 h1:FITWxC0U8u9J82iUnTUgKhFw048OFq6hNiShpIgJx2k=
github.com/microsoftgraph/msgraph-sdk-go v0.50.0/go.mod h1:XoTT9lzRSersVV4/lsFup3sOLfOLEf2dMsLckiAAKq8= github.com/microsoftgraph/msgraph-beta-sdk-go v0.53.0/go.mod h1:hyea6/iVBicq7jjlU8nzmkFys2ajScSI2q1GX9gjnIQ=
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1 h1:aVvnO5l8qLCEcvELc5n9grt7UXhAVtpog1QeQKLMlTE= github.com/microsoftgraph/msgraph-sdk-go v0.52.0 h1:hcFSvgxsN6xG9xGC/Y8jFasU+99OleAVZJb8rKBuISg=
github.com/microsoftgraph/msgraph-sdk-go-core v0.31.1/go.mod h1:RE4F2qGCTehGtQGc9Txafc4l+XMpbjYuO4amDLFgOWE= 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 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= 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= github.com/minio/minio-go/v7 v7.0.45 h1:g4IeM9M9pW/Lo8AGGNOjBZYlvmtlE1N5TQEYWXRWzIs=

View File

@ -278,7 +278,8 @@ func (c Mail) Serialize(
if retriesErr != nil { if retriesErr != nil {
logger.Ctx(ctx).Debug("exceeded maximum retries") 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)
} }
} }

View File

@ -4,6 +4,7 @@ import (
"context" "context"
absser "github.com/microsoft/kiota-abstractions-go/serialization" absser "github.com/microsoft/kiota-abstractions-go/serialization"
beta "github.com/microsoftgraph/msgraph-beta-sdk-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -45,6 +46,28 @@ func (s Service) Client() *msgraphsdk.GraphServiceClient {
return s.client 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 // Seraialize writes an M365 parsable object into a byte array using the built-in
// application/json writer within the adapter. // application/json writer within the adapter.
func (s Service) Serialize(object absser.Parsable) ([]byte, error) { func (s Service) Serialize(object absser.Parsable) ([]byte, error) {

View File

@ -10,6 +10,7 @@ import (
az "github.com/Azure/azure-sdk-for-go/sdk/azidentity" az "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
ka "github.com/microsoft/kiota-authentication-azure-go" ka "github.com/microsoft/kiota-authentication-azure-go"
khttp "github.com/microsoft/kiota-http-go" khttp "github.com/microsoft/kiota-http-go"
beta "github.com/microsoftgraph/msgraph-beta-sdk-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core" msgraphgocore "github.com/microsoftgraph/msgraph-sdk-go-core"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -46,6 +47,28 @@ func CreateAdapter(tenant, client, secret string) (*msgraphsdk.GraphRequestAdapt
auth, nil, nil, httpClient) 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 // CreateHTTPClient creates the httpClient with middlewares and timeout configured
func CreateHTTPClient() *http.Client { func CreateHTTPClient() *http.Client {
clientOptions := msgraphsdk.GetDefaultClientOptions() clientOptions := msgraphsdk.GetDefaultClientOptions()

View File

@ -43,6 +43,21 @@ func (suite *GraphUnitSuite) TestCreateAdapter() {
assert.NotNil(t, adpt) 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() { func (suite *GraphUnitSuite) TestSerializationEndPoint() {
t := suite.T() t := suite.T()
adpt, err := graph.CreateAdapter( adpt, err := graph.CreateAdapter(