Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove omitempty from SSLCheckCert field #294

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions fastly/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,20 @@ type CreateBackendInput struct {
HealthCheck string `form:"healthcheck,omitempty"`
Shield string `form:"shield,omitempty"`
UseSSL Compatibool `form:"use_ssl,omitempty"`
SSLCheckCert Compatibool `form:"ssl_check_cert,omitempty"`
SSLCACert string `form:"ssl_ca_cert,omitempty"`
SSLClientCert string `form:"ssl_client_cert,omitempty"`
SSLClientKey string `form:"ssl_client_key,omitempty"`
SSLHostname string `form:"ssl_hostname,omitempty"`
SSLCertHostname string `form:"ssl_cert_hostname,omitempty"`
SSLSNIHostname string `form:"ssl_sni_hostname,omitempty"`
MinTLSVersion string `form:"min_tls_version,omitempty"`
MaxTLSVersion string `form:"max_tls_version,omitempty"`
SSLCiphers []string `form:"ssl_ciphers,omitempty"`
// NOTE: Fastly API sets "ssl_check_cert" to true as its default value
// if this parameter is not present in the request.
// Removing omitempty from this particular field so that we can still
// create a new backend with "ssl_check_cert: false" set.
SSLCheckCert Compatibool `form:"ssl_check_cert"`
SSLCACert string `form:"ssl_ca_cert,omitempty"`
SSLClientCert string `form:"ssl_client_cert,omitempty"`
SSLClientKey string `form:"ssl_client_key,omitempty"`
SSLHostname string `form:"ssl_hostname,omitempty"`
SSLCertHostname string `form:"ssl_cert_hostname,omitempty"`
SSLSNIHostname string `form:"ssl_sni_hostname,omitempty"`
MinTLSVersion string `form:"min_tls_version,omitempty"`
MaxTLSVersion string `form:"max_tls_version,omitempty"`
SSLCiphers []string `form:"ssl_ciphers,omitempty"`
}

// CreateBackend creates a new Fastly backend.
Expand Down
6 changes: 6 additions & 0 deletions fastly/vcl_snippets.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ const (
// SnippetType is the type of VCL Snippet
type SnippetType string

// Helper function to get a pointer to string
func SnippetTypeToString(b string) *SnippetType {
p := SnippetType(b)
return &p
}

// Snippet is the Fastly Snippet object
type Snippet struct {
ServiceID string `mapstructure:"service_id"`
Expand Down