up
This commit is contained in:
@@ -180,14 +180,21 @@ type CFDNSRecord struct {
|
||||
TagsModifiedOn string `json:"tags_modified_on,omitempty"`
|
||||
}
|
||||
|
||||
// CFSSLStatus representa el estado SSL de una zona.
|
||||
// CFSSLStatus representa un certificate pack de una zona.
|
||||
type CFSSLStatus struct {
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Status string `json:"status"`
|
||||
Hosts []string `json:"hosts"`
|
||||
PrimaryCert string `json:"primary_certificate"`
|
||||
ExpiresOn string `json:"expires_on"`
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"` // universal, advanced, custom, sni_custom
|
||||
Hosts []string `json:"hosts"`
|
||||
Status string `json:"status"` // active, pending_validation, deleted
|
||||
ValidationMethod string `json:"validation_method,omitempty"`
|
||||
ValidityDays int `json:"validity_days,omitempty"`
|
||||
CertificateAuthority string `json:"certificate_authority,omitempty"`
|
||||
Wildcard bool `json:"wildcard,omitempty"`
|
||||
}
|
||||
|
||||
// CFUniversalSSL representa la configuración de Universal SSL de una zona.
|
||||
type CFUniversalSSL struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
// CFFirewallRule representa una regla de firewall (Access Rules).
|
||||
@@ -375,15 +382,27 @@ func (c *CloudflareClient) GetDNSRecords(zoneID string) ([]CFDNSRecord, error) {
|
||||
}
|
||||
|
||||
// GetSSLCertificates devuelve los certificate packs de una zona.
|
||||
// Incluye ?status=all para ver packs en cualquier estado (requerido en planes Free).
|
||||
func (c *CloudflareClient) GetSSLCertificates(zoneID string) ([]CFSSLStatus, error) {
|
||||
var certs []CFSSLStatus
|
||||
path := fmt.Sprintf("/zones/%s/ssl/certificate_packs", zoneID)
|
||||
path := fmt.Sprintf("/zones/%s/ssl/certificate_packs?status=all", zoneID)
|
||||
if err := c.get(path, &certs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return certs, nil
|
||||
}
|
||||
|
||||
// GetUniversalSSLSettings devuelve si el Universal SSL está activo en la zona.
|
||||
// Funciona en todos los planes. Útil como fallback cuando certificate_packs no está disponible.
|
||||
func (c *CloudflareClient) GetUniversalSSLSettings(zoneID string) (*CFUniversalSSL, error) {
|
||||
var result CFUniversalSSL
|
||||
path := fmt.Sprintf("/zones/%s/ssl/universal/settings", zoneID)
|
||||
if err := c.get(path, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// GetFirewallRules devuelve las reglas de acceso IP de una zona.
|
||||
func (c *CloudflareClient) GetFirewallRules(zoneID string) ([]CFFirewallRule, error) {
|
||||
var rules []CFFirewallRule
|
||||
|
||||
Reference in New Issue
Block a user