| 1 | package easydnsscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/" |
| 5 | "net/httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/" |
| 6 | "net/http/httptestscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/" |
| 7 | "net/urlscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/" |
| 8 | "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/" |
| 9 | "timescip-go gomod github.com/golang/go/src go1.25.0 time/" |
| 10 | |
| 11 | "github.com/go-acme/lego/v4/platform/testerscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/" |
| 12 | "github.com/go-acme/lego/v4/platform/tester/servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/" |
| 13 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/" |
| 14 | ) |
| 15 | |
| 16 | const envDomainscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envDomain. = envNamespacescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envNamespace. + "DOMAIN" |
| 17 | |
| 18 | var envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest. = testerscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/.NewEnvTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/NewEnvTest().( |
| 19 | EnvEndpointscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/EnvEndpoint., |
| 20 | EnvTokenscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/EnvToken., |
| 21 | EnvKeyscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/EnvKey.). |
| 22 | WithDomainscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#WithDomain().(envDomainscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envDomain.) |
| 23 | |
| 24 | func mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/mockBuilder().() *servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.Builderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#[*DNSProviderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#] { |
| 25 | return servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.NewBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/NewBuilder().( |
| 26 | func(server *httptestscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/.Serverscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#) (*DNSProviderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#, error) { |
| 27 | endpoint, err := urlscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/.Parsescip-go gomod github.com/golang/go/src go1.25.0 `net/url`/Parse().(server.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#URL.) |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | |
| 32 | config := NewDefaultConfigscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/NewDefaultConfig().() |
| 33 | config.Tokenscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#Token. = "TOKEN" |
| 34 | config.Keyscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#Key. = "SECRET" |
| 35 | config.Endpointscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#Endpoint. = endpoint |
| 36 | config.HTTPClientscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#HTTPClient. = server.Clientscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#Client().() |
| 37 | |
| 38 | return NewDNSProviderConfigscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/NewDNSProviderConfig().(config) |
| 39 | }, |
| 40 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.CheckHeaderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/CheckHeader().(). |
| 41 | WithJSONHeadersscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/HeaderLink#WithJSONHeaders().(). |
| 42 | WithAuthorizationscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/HeaderLink#WithAuthorization().("Basic VE9LRU46U0VDUkVU"), |
| 43 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.CheckQueryParameterscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/CheckQueryParameter().().Strictscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/QueryParameterLink#Strict().(). |
| 44 | Withscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/QueryParameterLink#With().("format", "json")) |
| 45 | } |
| 46 | |
| 47 | func TestNewDNSProviderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/TestNewDNSProvider().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 48 | testCases := []struct { |
| 49 | desc string |
| 50 | envVars map[string]string |
| 51 | expected string |
| 52 | }{ |
| 53 | { |
| 54 | desc: "success", |
| 55 | envVars: map[string]string{ |
| 56 | EnvTokenscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/EnvToken.: "TOKEN", |
| 57 | EnvKeyscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/EnvKey.: "SECRET", |
| 58 | }, |
| 59 | }, |
| 60 | { |
| 61 | desc: "missing token", |
| 62 | envVars: map[string]string{ |
| 63 | EnvKeyscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/EnvKey.: "SECRET", |
| 64 | }, |
| 65 | expected: "easydns: some credentials information are missing: EASYDNS_TOKEN", |
| 66 | }, |
| 67 | { |
| 68 | desc: "missing key", |
| 69 | envVars: map[string]string{ |
| 70 | EnvTokenscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/EnvToken.: "TOKEN", |
| 71 | }, |
| 72 | expected: "easydns: some credentials information are missing: EASYDNS_KEY", |
| 73 | }, |
| 74 | } |
| 75 | |
| 76 | for _, test := range testCases { |
| 77 | t.Runscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Run().(test.desc, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 78 | defer envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..RestoreEnvscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#RestoreEnv().() |
| 79 | |
| 80 | envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..ClearEnvscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#ClearEnv().() |
| 81 | |
| 82 | envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..Applyscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#Apply().(test.envVars) |
| 83 | |
| 84 | p, err := NewDNSProviderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/NewDNSProvider().() |
| 85 | |
| 86 | if test.expected == "" { |
| 87 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 88 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, p) |
| 89 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, p.configscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#config.) |
| 90 | } else { |
| 91 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.EqualErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/EqualError().(t, err, test.expected) |
| 92 | } |
| 93 | }) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func TestNewDNSProviderConfigscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/TestNewDNSProviderConfig().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 98 | testCases := []struct { |
| 99 | desc string |
| 100 | config *Configscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config# |
| 101 | expected string |
| 102 | }{ |
| 103 | { |
| 104 | desc: "success", |
| 105 | config: &Configscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#{ |
| 106 | Tokenscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#Token.: "TOKEN", |
| 107 | Keyscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#Key.: "KEY", |
| 108 | }, |
| 109 | }, |
| 110 | { |
| 111 | desc: "nil config", |
| 112 | config: nil, |
| 113 | expected: "easydns: the configuration of the DNS provider is nil", |
| 114 | }, |
| 115 | { |
| 116 | desc: "missing token", |
| 117 | config: &Configscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#{ |
| 118 | Keyscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#Key.: "KEY", |
| 119 | }, |
| 120 | expected: "easydns: the API token is missing", |
| 121 | }, |
| 122 | { |
| 123 | desc: "missing key", |
| 124 | config: &Configscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#{ |
| 125 | Tokenscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/Config#Token.: "TOKEN", |
| 126 | }, |
| 127 | expected: "easydns: the API key is missing", |
| 128 | }, |
| 129 | } |
| 130 | |
| 131 | for _, test := range testCases { |
| 132 | t.Runscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Run().(test.desc, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 133 | p, err := NewDNSProviderConfigscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/NewDNSProviderConfig().(test.config) |
| 134 | |
| 135 | if test.expected == "" { |
| 136 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 137 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, p) |
| 138 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, p.configscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#config.) |
| 139 | } else { |
| 140 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.EqualErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/EqualError().(t, err, test.expected) |
| 141 | } |
| 142 | }) |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | func TestDNSProvider_Presentscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/TestDNSProvider_Present().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 147 | provider := mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/mockBuilder().(). |
| 148 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("GET /zones/records/all/example.com", |
| 149 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.RawStringResponsescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/RawStringResponse().(`{ |
| 150 | "msg": "string", |
| 151 | "status": 200, |
| 152 | "tm": 0, |
| 153 | "data": [{ |
| 154 | "id": "60898922", |
| 155 | "domain": "example.com", |
| 156 | "host": "hosta", |
| 157 | "ttl": "300", |
| 158 | "prio": "0", |
| 159 | "geozone_id": "0", |
| 160 | "type": "A", |
| 161 | "rdata": "1.2.3.4", |
| 162 | "last_mod": "2019-08-28 19:09:50" |
| 163 | }], |
| 164 | "count": 0, |
| 165 | "total": 0, |
| 166 | "start": 0, |
| 167 | "max": 0 |
| 168 | } |
| 169 | `), |
| 170 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.CheckQueryParameterscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/CheckQueryParameter().().Strictscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/QueryParameterLink#Strict().(). |
| 171 | Withscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/QueryParameterLink#With().("format", "json")). |
| 172 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("PUT /zones/records/add/example.com/TXT", |
| 173 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.RawStringResponsescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/RawStringResponse().(`{ |
| 174 | "msg": "OK", |
| 175 | "tm": 1554681934, |
| 176 | "data": { |
| 177 | "host": "_acme-challenge", |
| 178 | "geozone_id": 0, |
| 179 | "ttl": "120", |
| 180 | "prio": "0", |
| 181 | "rdata": "pW9ZKG0xz_PCriK-nCMOjADy9eJcgGWIzkkj2fN4uZM", |
| 182 | "revoked": 0, |
| 183 | "id": "123456789", |
| 184 | "new_host": "_acme-challenge.example.com" |
| 185 | }, |
| 186 | "status": 201 |
| 187 | }`), |
| 188 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.CheckRequestJSONBodyscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/CheckRequestJSONBody().(`{"domain":"example.com","host":"_acme-challenge","ttl":"120","prio":"0","type":"TXT","rdata":"pW9ZKG0xz_PCriK-nCMOjADy9eJcgGWIzkkj2fN4uZM"} |
| 189 | `)). |
| 190 | Buildscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Build().(t) |
| 191 | |
| 192 | err := provider.Presentscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#Present().("example.com", "token", "keyAuth") |
| 193 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 194 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Containsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Contains().(t, provider.recordIDsscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#recordIDs., "_acme-challenge.example.com.|pW9ZKG0xz_PCriK-nCMOjADy9eJcgGWIzkkj2fN4uZM") |
| 195 | } |
| 196 | |
| 197 | func TestDNSProvider_Cleanup_WhenRecordIdNotSet_NoOpscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/TestDNSProvider_Cleanup_WhenRecordIdNotSet_NoOp().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 198 | provider := mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/mockBuilder().(). |
| 199 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("GET /zones/records/all/_acme-challenge.example.com", |
| 200 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.RawStringResponsescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/RawStringResponse().(`{ |
| 201 | "msg": "string", |
| 202 | "status": 200, |
| 203 | "tm": 0, |
| 204 | "data": [{ |
| 205 | "id": "60898922", |
| 206 | "domain": "example.com", |
| 207 | "host": "hosta", |
| 208 | "ttl": "300", |
| 209 | "prio": "0", |
| 210 | "geozone_id": "0", |
| 211 | "type": "A", |
| 212 | "rdata": "1.2.3.4", |
| 213 | "last_mod": "2019-08-28 19:09:50" |
| 214 | }], |
| 215 | "count": 0, |
| 216 | "total": 0, |
| 217 | "start": 0, |
| 218 | "max": 0 |
| 219 | } |
| 220 | `)). |
| 221 | Buildscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Build().(t) |
| 222 | |
| 223 | err := provider.CleanUpscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#CleanUp().("example.com", "token", "keyAuth") |
| 224 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 225 | } |
| 226 | |
| 227 | func TestDNSProvider_Cleanup_WhenRecordIdSet_DeletesTxtRecordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/TestDNSProvider_Cleanup_WhenRecordIdSet_DeletesTxtRecord().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 228 | provider := mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/mockBuilder().(). |
| 229 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("GET /zones/records/all/_acme-challenge.example.com", |
| 230 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.RawStringResponsescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/RawStringResponse().(`{ |
| 231 | "msg": "string", |
| 232 | "status": 200, |
| 233 | "tm": 0, |
| 234 | "data": [{ |
| 235 | "id": "60898922", |
| 236 | "domain": "example.com", |
| 237 | "host": "hosta", |
| 238 | "ttl": "300", |
| 239 | "prio": "0", |
| 240 | "geozone_id": "0", |
| 241 | "type": "A", |
| 242 | "rdata": "1.2.3.4", |
| 243 | "last_mod": "2019-08-28 19:09:50" |
| 244 | }], |
| 245 | "count": 0, |
| 246 | "total": 0, |
| 247 | "start": 0, |
| 248 | "max": 0 |
| 249 | } |
| 250 | `)). |
| 251 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("DELETE /zones/records/_acme-challenge.example.com/123456", |
| 252 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.RawStringResponsescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/RawStringResponse().(`{ |
| 253 | "msg": "OK", |
| 254 | "data": { |
| 255 | "domain": "example.com", |
| 256 | "id": "123456" |
| 257 | }, |
| 258 | "status": 200 |
| 259 | }`)). |
| 260 | Buildscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Build().(t) |
| 261 | |
| 262 | provider.recordIDsscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#recordIDs.["_acme-challenge.example.com.|pW9ZKG0xz_PCriK-nCMOjADy9eJcgGWIzkkj2fN4uZM"] = "123456" |
| 263 | |
| 264 | err := provider.CleanUpscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#CleanUp().("example.com", "token", "keyAuth") |
| 265 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 266 | } |
| 267 | |
| 268 | func TestDNSProvider_Cleanup_WhenHttpError_ReturnsErrorscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/TestDNSProvider_Cleanup_WhenHttpError_ReturnsError().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 269 | errorMessage := `{ |
| 270 | "error": { |
| 271 | "code": 406, |
| 272 | "message": "Provided id is invalid or you do not have permission to access it." |
| 273 | } |
| 274 | }` |
| 275 | |
| 276 | provider := mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/mockBuilder().(). |
| 277 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("GET /zones/records/all/example.com", |
| 278 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.RawStringResponsescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/RawStringResponse().(`{ |
| 279 | "msg": "string", |
| 280 | "status": 200, |
| 281 | "tm": 0, |
| 282 | "data": [{ |
| 283 | "id": "60898922", |
| 284 | "domain": "example.com", |
| 285 | "host": "hosta", |
| 286 | "ttl": "300", |
| 287 | "prio": "0", |
| 288 | "geozone_id": "0", |
| 289 | "type": "A", |
| 290 | "rdata": "1.2.3.4", |
| 291 | "last_mod": "2019-08-28 19:09:50" |
| 292 | }], |
| 293 | "count": 0, |
| 294 | "total": 0, |
| 295 | "start": 0, |
| 296 | "max": 0 |
| 297 | } |
| 298 | `)). |
| 299 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("DELETE /zones/records/example.com/123456", |
| 300 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.RawStringResponsescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/RawStringResponse().(errorMessage). |
| 301 | WithStatusCodescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/RawResponseHandler#WithStatusCode().(httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.StatusNotAcceptablescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/StatusNotAcceptable.)). |
| 302 | Buildscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Build().(t) |
| 303 | |
| 304 | provider.recordIDsscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#recordIDs.["_acme-challenge.example.com.|pW9ZKG0xz_PCriK-nCMOjADy9eJcgGWIzkkj2fN4uZM"] = "123456" |
| 305 | |
| 306 | err := provider.CleanUpscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#CleanUp().("example.com", "token", "keyAuth") |
| 307 | |
| 308 | expectedError := fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25.0 fmt/Sprintf().("easydns: unexpected status code: [status code: 406] body: %v", errorMessage) |
| 309 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.EqualErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/EqualError().(t, err, expectedError) |
| 310 | } |
| 311 | |
| 312 | func TestLivePresentscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/TestLivePresent().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 313 | if !envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..IsLiveTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#IsLiveTest().() { |
| 314 | t.Skipscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Skip().("skipping live test") |
| 315 | } |
| 316 | |
| 317 | envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..RestoreEnvscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#RestoreEnv().() |
| 318 | |
| 319 | provider, err := NewDNSProviderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/NewDNSProvider().() |
| 320 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 321 | |
| 322 | err = provider.Presentscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#Present().(envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..GetDomainscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#GetDomain().(), "", "123d==") |
| 323 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 324 | } |
| 325 | |
| 326 | func TestLiveCleanUpscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/TestLiveCleanUp().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 327 | if !envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..IsLiveTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#IsLiveTest().() { |
| 328 | t.Skipscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Skip().("skipping live test") |
| 329 | } |
| 330 | |
| 331 | envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..RestoreEnvscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#RestoreEnv().() |
| 332 | |
| 333 | provider, err := NewDNSProviderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/NewDNSProvider().() |
| 334 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 335 | |
| 336 | timescip-go gomod github.com/golang/go/src go1.25.0 time/.Sleepscip-go gomod github.com/golang/go/src go1.25.0 time/Sleep().(2 * timescip-go gomod github.com/golang/go/src go1.25.0 time/.Secondscip-go gomod github.com/golang/go/src go1.25.0 time/Second.) |
| 337 | |
| 338 | err = provider.CleanUpscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/DNSProvider#CleanUp().(envTestscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/easydns`/envTest..GetDomainscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester`/EnvTest#GetDomain().(), "", "123d==") |
| 339 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 340 | } |