From 93c5f9a256c037c6d1472bd8102b0ecf60dfe5e6 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 12 Dec 2024 12:58:25 +0300 Subject: [PATCH] Dependencies update --- backuper/confluence/confluence-backuper.go | 27 +++++++-------- backuper/jira/jira-backuper.go | 40 ++++++++++------------ go.mod | 6 ++-- go.sum | 16 ++++----- 4 files changed, 41 insertions(+), 48 deletions(-) diff --git a/backuper/confluence/confluence-backuper.go b/backuper/confluence/confluence-backuper.go index 5888205..98c58c1 100644 --- a/backuper/confluence/confluence-backuper.go +++ b/backuper/confluence/confluence-backuper.go @@ -223,10 +223,9 @@ func (b *ConfluenceBackuper) GetReader(backupFile string) (io.ReadCloser, error) log.Debug("Downloading file from %s", backupFileURL) resp, err := req.Request{ - URL: backupFileURL, - BasicAuthUsername: b.config.Email, - BasicAuthPassword: b.config.APIKey, - AutoDiscard: true, + URL: backupFileURL, + Auth: req.AuthBasic{b.config.Email, b.config.APIKey}, + AutoDiscard: true, }.Get() if err != nil { @@ -245,11 +244,10 @@ func (b *ConfluenceBackuper) GetReader(backupFile string) (io.ReadCloser, error) // startBackup starts backup process func (b *ConfluenceBackuper) startBackup() error { resp, err := req.Request{ - URL: b.config.AccountURL() + "/wiki/rest/obm/1.0/runbackup", - BasicAuthUsername: b.config.Email, - BasicAuthPassword: b.config.APIKey, - Accept: req.CONTENT_TYPE_JSON, - ContentType: req.CONTENT_TYPE_JSON, + URL: b.config.AccountURL() + "/wiki/rest/obm/1.0/runbackup", + Auth: req.AuthBasic{b.config.Email, b.config.APIKey}, + Accept: req.CONTENT_TYPE_JSON, + ContentType: req.CONTENT_TYPE_JSON, Body: &BackupPrefs{ WithAttachments: b.config.WithAttachments, ForCloud: b.config.ForCloud, @@ -270,12 +268,11 @@ func (b *ConfluenceBackuper) startBackup() error { // getBackupProgress returns backup progress info func (b *ConfluenceBackuper) getBackupProgress() (*BackupProgressInfo, error) { resp, err := req.Request{ - URL: b.config.AccountURL() + "/wiki/rest/obm/1.0/getprogress", - BasicAuthUsername: b.config.Email, - BasicAuthPassword: b.config.APIKey, - Accept: req.CONTENT_TYPE_JSON, - ContentType: req.CONTENT_TYPE_JSON, - AutoDiscard: true, + URL: b.config.AccountURL() + "/wiki/rest/obm/1.0/getprogress", + Auth: req.AuthBasic{b.config.Email, b.config.APIKey}, + Accept: req.CONTENT_TYPE_JSON, + ContentType: req.CONTENT_TYPE_JSON, + AutoDiscard: true, }.Get() if err != nil { diff --git a/backuper/jira/jira-backuper.go b/backuper/jira/jira-backuper.go index fc5b765..941f585 100644 --- a/backuper/jira/jira-backuper.go +++ b/backuper/jira/jira-backuper.go @@ -232,10 +232,9 @@ func (b *JiraBackuper) GetReader(backupFile string) (io.ReadCloser, error) { log.Debug("Downloading file from %s", backupFileURL) resp, err := req.Request{ - URL: backupFileURL, - BasicAuthUsername: b.config.Email, - BasicAuthPassword: b.config.APIKey, - AutoDiscard: true, + URL: backupFileURL, + Auth: req.AuthBasic{b.config.Email, b.config.APIKey}, + AutoDiscard: true, }.Get() if err != nil { @@ -254,11 +253,10 @@ func (b *JiraBackuper) GetReader(backupFile string) (io.ReadCloser, error) { // startBackup starts backup process func (b *JiraBackuper) startBackup() (string, error) { resp, err := req.Request{ - URL: b.config.AccountURL() + "/rest/backup/1/export/runbackup", - BasicAuthUsername: b.config.Email, - BasicAuthPassword: b.config.APIKey, - Accept: req.CONTENT_TYPE_JSON, - ContentType: req.CONTENT_TYPE_JSON, + URL: b.config.AccountURL() + "/rest/backup/1/export/runbackup", + Auth: req.AuthBasic{b.config.Email, b.config.APIKey}, + Accept: req.CONTENT_TYPE_JSON, + ContentType: req.CONTENT_TYPE_JSON, Body: &BackupPrefs{ WithAttachments: b.config.WithAttachments, ForCloud: b.config.ForCloud, @@ -286,12 +284,11 @@ func (b *JiraBackuper) startBackup() (string, error) { // getLastTaskID returns ID of the last task for backup func (b *JiraBackuper) getLastTaskID() (string, error) { resp, err := req.Request{ - URL: b.config.AccountURL() + "/rest/backup/1/export/lastTaskId", - BasicAuthUsername: b.config.Email, - BasicAuthPassword: b.config.APIKey, - Accept: req.CONTENT_TYPE_JSON, - ContentType: req.CONTENT_TYPE_JSON, - AutoDiscard: true, + URL: b.config.AccountURL() + "/rest/backup/1/export/lastTaskId", + Auth: req.AuthBasic{b.config.Email, b.config.APIKey}, + Accept: req.CONTENT_TYPE_JSON, + ContentType: req.CONTENT_TYPE_JSON, + AutoDiscard: true, }.Get() if err != nil { @@ -308,13 +305,12 @@ func (b *JiraBackuper) getLastTaskID() (string, error) { // getTaskProgress returns progress for task func (b *JiraBackuper) getTaskProgress(taskID string) (*BackupProgressInfo, error) { resp, err := req.Request{ - URL: b.config.AccountURL() + "/rest/backup/1/export/getProgress", - BasicAuthUsername: b.config.Email, - BasicAuthPassword: b.config.APIKey, - Accept: req.CONTENT_TYPE_JSON, - ContentType: req.CONTENT_TYPE_JSON, - Query: req.Query{"taskId": taskID}, - AutoDiscard: true, + URL: b.config.AccountURL() + "/rest/backup/1/export/getProgress", + Auth: req.AuthBasic{b.config.Email, b.config.APIKey}, + Accept: req.CONTENT_TYPE_JSON, + ContentType: req.CONTENT_TYPE_JSON, + Query: req.Query{"taskId": taskID}, + AutoDiscard: true, }.Get() if err != nil { diff --git a/go.mod b/go.mod index cc2bcfa..6231ac6 100644 --- a/go.mod +++ b/go.mod @@ -7,10 +7,10 @@ require ( github.com/aws/aws-sdk-go-v2/credentials v1.17.47 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.43 github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0 - github.com/essentialkaos/ek/v13 v13.14.1 + github.com/essentialkaos/ek/v13 v13.15.1 github.com/essentialkaos/katana v0.4.1 github.com/pkg/sftp v1.13.7 - golang.org/x/crypto v0.29.0 + golang.org/x/crypto v0.31.0 ) require ( @@ -26,5 +26,5 @@ require ( github.com/essentialkaos/depsy v1.3.1 // indirect github.com/essentialkaos/sio v1.1.0 // indirect github.com/kr/fs v0.1.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect ) diff --git a/go.sum b/go.sum index 7519d19..934a203 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/essentialkaos/check v1.4.1 h1:SuxXzrbokPGTPWxGRnzy0hXvtb44mtVrdNxgPa1 github.com/essentialkaos/check v1.4.1/go.mod h1:xQOYwFvnxfVZyt5Qvjoa1SxcRqu5VyP77pgALr3iu+M= github.com/essentialkaos/depsy v1.3.1 h1:00k9QcMsdPM4IzDaEFHsTHBD/zoM0oxtB5+dMUwbQa8= github.com/essentialkaos/depsy v1.3.1/go.mod h1:B5+7Jhv2a2RacOAxIKU2OeJp9QfZjwIpEEPI5X7auWM= -github.com/essentialkaos/ek/v13 v13.14.1 h1:LAAS8OZFseAQSigrU4IAL0JeUj1G80M2WXm6B6+7ojY= -github.com/essentialkaos/ek/v13 v13.14.1/go.mod h1:GAoS44v5gtd3Yc1qqfgXsaJNoC0dMw1ueW5Fc9TTHUg= +github.com/essentialkaos/ek/v13 v13.15.1 h1:11m8g8SaW2B7N6y9q3c/5p9qMi7ElwXUD8HxKc2fE+Q= +github.com/essentialkaos/ek/v13 v13.15.1/go.mod h1:FnKbXv0qaoT7Ocqg0oAhlkgQZKVQFAP32wKEmrf7xNw= github.com/essentialkaos/katana v0.4.1 h1:+yLk5ngPOu5SKQ7LdUQ7Bip0vD9BLU4/CzmL589wD38= github.com/essentialkaos/katana v0.4.1/go.mod h1:r2/CwIhVo9T8bhJd9eQlEqfZNAJJ0191s6h6LTdw2QM= github.com/essentialkaos/sio v1.1.0 h1:XPyScH8G08NIC94373ZHs+afPjZT5OKxQCuudbdFaIc= @@ -70,8 +70,8 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -90,15 +90,15 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=