fix: separate public object store TLS
This commit is contained in:
@@ -26,16 +26,17 @@ type Store struct {
|
||||
bucket string
|
||||
}
|
||||
|
||||
func New(endpoint, publicEndpoint, accessKey, secretKey, bucket, region string, secure bool) (*Store, error) {
|
||||
func New(endpoint, publicEndpoint, accessKey, secretKey, bucket, region string, secure, publicSecure bool) (*Store, error) {
|
||||
if endpoint == "" || publicEndpoint == "" || accessKey == "" || secretKey == "" || bucket == "" || region == "" {
|
||||
return nil, errors.New("object store endpoints, credentials, bucket and region are required")
|
||||
}
|
||||
options := &minio.Options{Creds: credentials.NewStaticV4(accessKey, secretKey, ""), Secure: secure, Region: region}
|
||||
internalClient, err := minio.New(endpoint, options)
|
||||
internalOptions := &minio.Options{Creds: credentials.NewStaticV4(accessKey, secretKey, ""), Secure: secure, Region: region}
|
||||
internalClient, err := minio.New(endpoint, internalOptions)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create internal object store client: %w", err)
|
||||
}
|
||||
publicClient, err := minio.New(publicEndpoint, options)
|
||||
publicOptions := &minio.Options{Creds: credentials.NewStaticV4(accessKey, secretKey, ""), Secure: publicSecure, Region: region}
|
||||
publicClient, err := minio.New(publicEndpoint, publicOptions)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create public object store signer: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user