mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03:00
GCS: add user agent
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -88,7 +88,10 @@ func NewGCSFs(connectionID, localTempDir, mountPath string, config GCSFsConfig)
|
|||||||
}
|
}
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
if fs.config.AutomaticCredentials > 0 {
|
if fs.config.AutomaticCredentials > 0 {
|
||||||
fs.svc, err = storage.NewClient(ctx, storage.WithJSONReads())
|
fs.svc, err = storage.NewClient(ctx,
|
||||||
|
storage.WithJSONReads(),
|
||||||
|
option.WithUserAgent(version.GetVersionHash()),
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
err = fs.config.Credentials.TryDecrypt()
|
err = fs.config.Credentials.TryDecrypt()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -96,6 +99,7 @@ func NewGCSFs(connectionID, localTempDir, mountPath string, config GCSFsConfig)
|
|||||||
}
|
}
|
||||||
fs.svc, err = storage.NewClient(ctx,
|
fs.svc, err = storage.NewClient(ctx,
|
||||||
storage.WithJSONReads(),
|
storage.WithJSONReads(),
|
||||||
|
option.WithUserAgent(version.GetVersionHash()),
|
||||||
option.WithCredentialsJSON([]byte(fs.config.Credentials.GetPayload())),
|
option.WithCredentialsJSON([]byte(fs.config.Credentials.GetPayload())),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user