| 118 | } |
| 119 | |
| 120 | func (storageConfig *ObjectStorageConfig) buildConfigForS3() (cfg aws.Config, err error) { |
| 121 | return awsconfig.LoadDefaultConfig(context.TODO(), |
| 122 | awsconfig.WithCredentialsProvider( |
| 123 | credentials.NewStaticCredentialsProvider(storageConfig.AccessKeyId, storageConfig.SecretAccessKey, "")), |
| 124 | awsconfig.WithRegion(storageConfig.Region), |
| 125 | ) |
| 126 | } |
| 127 | |
| 128 | func ConstructStorageConfig(remoteUri, endpoint, accessKeyId, secretAccessKey string) (*ObjectStorageConfig, string, error) { |
| 129 | provider, remotePath, err := parseProviderAndPath(remoteUri) |