Skip to content

Commit 343ccbd

Browse files
committed
Use File instead of Path suffix for TLS vars
1 parent 91b29fb commit 343ccbd

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
110110
The first paragraph contains the authentication parameters for
111111
OpenStack's Identity v3 API. Optionally a `region_name` can be specified, but this is only
112-
required if there are multiple regions to choose from. You can also specify the `tls_client_certificate_path` and `tls_client_key_path` for creating a TLS client.
112+
required if there are multiple regions to choose from. You can also specify the `tls_client_certificate_file` and `tls_client_key_file` for creating a TLS client.
113113

114114
You can use the `fromEnv` special syntax for the `to.container`, `to.object_prefix`, and
115115
the Swift fields (options under the `swift` key).

pkg/objects/swift.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ type SwiftLocation struct {
4949
ApplicationCredentialID secrets.FromEnv `yaml:"application_credential_id"`
5050
ApplicationCredentialName secrets.FromEnv `yaml:"application_credential_name"`
5151
ApplicationCredentialSecret secrets.FromEnv `yaml:"application_credential_secret"`
52-
TLSClientCertificatePath secrets.FromEnv `yaml:"tls_client_certificate_path"`
53-
TLSClientKeyPath secrets.FromEnv `yaml:"tls_client_key_path"`
52+
TLSClientCertificateFile secrets.FromEnv `yaml:"tls_client_certificate_file"`
53+
TLSClientKeyFile secrets.FromEnv `yaml:"tls_client_key_file"`
5454
RegionName secrets.FromEnv `yaml:"region_name"`
5555
ContainerName secrets.FromEnv `yaml:"container"`
5656
ObjectNamePrefix secrets.FromEnv `yaml:"object_prefix"`
@@ -91,12 +91,12 @@ func (s *SwiftLocation) Validate(name string) []error {
9191
result = append(result, fmt.Errorf("missing value for %s.auth_url", name))
9292
}
9393

94-
if s.TLSClientCertificatePath != "" || s.TLSClientKeyPath != "" {
95-
if s.TLSClientCertificatePath == "" {
96-
result = append(result, fmt.Errorf("missing value for %s.tls_client_certificate_path", name))
94+
if s.TLSClientCertificateFile != "" || s.TLSClientKeyFile != "" {
95+
if s.TLSClientCertificateFile == "" {
96+
result = append(result, fmt.Errorf("missing value for %s.tls_client_certificate_file", name))
9797
}
98-
if s.TLSClientKeyPath == "" {
99-
result = append(result, fmt.Errorf("missing value for %s.tls_client_key_path", name))
98+
if s.TLSClientKeyFile == "" {
99+
result = append(result, fmt.Errorf("missing value for %s.tls_client_key_file", name))
100100
}
101101
}
102102

@@ -186,8 +186,8 @@ func (s *SwiftLocation) Connect(name string) error {
186186
}
187187

188188
transport := &http.Transport{}
189-
if s.TLSClientCertificatePath != "" && s.TLSClientKeyPath != "" {
190-
cert, err := tls.LoadX509KeyPair(string(s.TLSClientCertificatePath), string(s.TLSClientKeyPath))
189+
if s.TLSClientCertificateFile != "" && s.TLSClientKeyFile != "" {
190+
cert, err := tls.LoadX509KeyPair(string(s.TLSClientCertificateFile), string(s.TLSClientKeyFile))
191191
if err != nil {
192192
return fmt.Errorf("failed to load x509 key pair: %s", err.Error())
193193
}

0 commit comments

Comments
 (0)