Skip to content

Commit 37b0997

Browse files
committed
Add field to UpdateCustomTLSCertificateInput struct
1 parent dc0e882 commit 37b0997

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

fastly/tls_custom_certificate.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ type UpdateCustomTLSCertificateInput struct {
182182
ID string `jsonapi:"primary,tls_certificate"`
183183
// Name is a customizable name for your certificate.
184184
Name string `jsonapi:"attr,name,omitempty"`
185+
// AllowUntrustedRoot enables the upload of a certificate signed by a self-signing CA as the root.
186+
// The main use case for enabling this setting is to enable a fully localized development setup where you are generating your own certificates.
187+
// In most cases, this setting should never be turned on since it makes it possible for the uploading of conflicting certificates that may interfere with production traffic.
188+
// If you are going to enable this feature make sure to take proper precaution and only upload self-signed certificates that certify "dummy" domains that do not overlap with the actual domains you own.
189+
AllowUntrustedRoot bool `jsonapi:"attr,allow_untrusted_root,omitempty"`
185190
}
186191

187192
// UpdateCustomTLSCertificate updates the specified resource.

fastly/tls_custom_certificate_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,21 @@ func TestClient_UpdateCustomTLSCertificate_validation(t *testing.T) {
201201
t.Errorf("bad error: %s", err)
202202
}
203203
}
204+
205+
func TestClient_CreateCustomTLSCertificateInput_default_values(t *testing.T) {
206+
t.Parallel()
207+
208+
certificateInput := CreateCustomTLSCertificateInput{}
209+
if certificateInput.AllowUntrustedRoot {
210+
t.Errorf("allow untrusted root attribute cannot be enabled by default")
211+
}
212+
}
213+
214+
func TestClient_UpdateCustomTLSCertificateInput_default_values(t *testing.T) {
215+
t.Parallel()
216+
217+
certificateInput := UpdateCustomTLSCertificateInput{}
218+
if certificateInput.AllowUntrustedRoot {
219+
t.Errorf("allow untrusted root attribute cannot be enabled by default")
220+
}
221+
}

fastly/tls_custom_configuration_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,3 @@ func TestClient_UpdateCustomTLSConfiguration_validation(t *testing.T) {
118118
t.Errorf("bad error: %s", err)
119119
}
120120
}
121-
122-
func TestClient_CreateCustomTLSCertificateInput_default_values(t *testing.T) {
123-
t.Parallel()
124-
125-
certificateInput := CreateCustomTLSCertificateInput{}
126-
if certificateInput.AllowUntrustedRoot {
127-
t.Errorf("allow untrusted root attribute cannot be enabled by default")
128-
}
129-
}

0 commit comments

Comments
 (0)