upload all
This commit is contained in:
76
backend/providers/autodns.go
Normal file
76
backend/providers/autodns.go
Normal file
@@ -0,0 +1,76 @@
|
||||
package providers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// AutoDNSProvider ist der Provider für AutoDNS
|
||||
type AutoDNSProvider struct{}
|
||||
|
||||
func NewAutoDNSProvider() *AutoDNSProvider {
|
||||
return &AutoDNSProvider{}
|
||||
}
|
||||
|
||||
func (p *AutoDNSProvider) GetName() string {
|
||||
return "autodns"
|
||||
}
|
||||
|
||||
func (p *AutoDNSProvider) GetDisplayName() string {
|
||||
return "AutoDNS"
|
||||
}
|
||||
|
||||
func (p *AutoDNSProvider) GetDescription() string {
|
||||
return "AutoDNS SSL Certificate Provider"
|
||||
}
|
||||
|
||||
func (p *AutoDNSProvider) ValidateConfig(settings map[string]interface{}) error {
|
||||
username, ok := settings["username"].(string)
|
||||
if !ok || strings.TrimSpace(username) == "" {
|
||||
return fmt.Errorf("username ist erforderlich")
|
||||
}
|
||||
|
||||
password, ok := settings["password"].(string)
|
||||
if !ok || strings.TrimSpace(password) == "" {
|
||||
return fmt.Errorf("password ist erforderlich")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *AutoDNSProvider) TestConnection(settings map[string]interface{}) error {
|
||||
// Hier würde die tatsächliche Verbindung zu AutoDNS getestet werden
|
||||
// Für jetzt nur Validierung
|
||||
return p.ValidateConfig(settings)
|
||||
}
|
||||
|
||||
// GetRequiredSettings gibt die erforderlichen Einstellungen zurück
|
||||
func (p *AutoDNSProvider) GetRequiredSettings() []SettingField {
|
||||
return []SettingField{
|
||||
{
|
||||
Name: "username",
|
||||
Label: "Benutzername",
|
||||
Type: "text",
|
||||
Required: true,
|
||||
Description: "AutoDNS Benutzername",
|
||||
},
|
||||
{
|
||||
Name: "password",
|
||||
Label: "Passwort",
|
||||
Type: "password",
|
||||
Required: true,
|
||||
Description: "AutoDNS Passwort",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// SignCSR signiert einen CSR (noch nicht implementiert)
|
||||
func (p *AutoDNSProvider) SignCSR(csrPEM string, settings map[string]interface{}) (*SignCSRResult, error) {
|
||||
return nil, fmt.Errorf("AutoDNS CSR-Signierung noch nicht implementiert")
|
||||
}
|
||||
|
||||
// GetCertificate ruft ein Zertifikat ab (noch nicht implementiert)
|
||||
func (p *AutoDNSProvider) GetCertificate(certificateID string, settings map[string]interface{}) (string, error) {
|
||||
return "", fmt.Errorf("AutoDNS Zertifikat-Abruf noch nicht implementiert")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user