| 1 | package internalscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/ |
| 2 | |
| 3 | import ( |
| 4 | "net/httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/" |
| 5 | "net/http/httptestscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/" |
| 6 | "net/urlscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/" |
| 7 | "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/" |
| 8 | |
| 9 | "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`/" |
| 10 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 11 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/" |
| 12 | ) |
| 13 | |
| 14 | func mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/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#[*Clientscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#] { |
| 15 | 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().[*Clientscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#]( |
| 16 | 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#) (*Clientscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#, error) { |
| 17 | client, err := NewClientscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/NewClient().("secret") |
| 18 | if err != nil { |
| 19 | return nil, err |
| 20 | } |
| 21 | |
| 22 | client.BaseURLscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#BaseURL., _ = 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.) |
| 23 | client.HTTPClientscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#HTTPClient. = server.Clientscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#Client().() |
| 24 | |
| 25 | return client, nil |
| 26 | }, |
| 27 | 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().(). |
| 28 | WithAuthorizationscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/HeaderLink#WithAuthorization().("Token secret"), |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | func TestClient_CreateRecordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/TestClient_CreateRecord().(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#) { |
| 33 | client := mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/mockBuilder().(). |
| 34 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("POST /api/clouddns/v1/zone.json/example.com/records", |
| 35 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.ResponseFromFixturescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/ResponseFromFixture().("create_record.json"), |
| 36 | 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().(). |
| 37 | WithContentTypescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/HeaderLink#WithContentType().("application/json; charset=utf-8"), |
| 38 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.CheckRequestJSONBodyFromFixturescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/CheckRequestJSONBodyFromFixture().("create_record-request.json")). |
| 39 | Buildscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Build().(t) |
| 40 | |
| 41 | record := Recordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#{ |
| 42 | Namescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Name.: "_acme-challenge", |
| 43 | RDatascip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#RData.: "ADw2sEd82DUgXcQ9hNBZThJs7zVJkR5v9JeSbAb9mZY", |
| 44 | TTLscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#TTL.: 300, |
| 45 | Typescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Type.: "TXT", |
| 46 | } |
| 47 | |
| 48 | zone, err := client.CreateRecordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#CreateRecord().(t.Contextscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Context().(), "example.com", record) |
| 49 | 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) |
| 50 | |
| 51 | expected := &Zonescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#{ |
| 52 | Namescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#Name.: "example.com", |
| 53 | TTLscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#TTL.: 86400, |
| 54 | ZoneNamescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#ZoneName.: "example.com", |
| 55 | Revisionsscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#Revisions.: []Revisionscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Revision#{{ |
| 56 | Identifierscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Revision#Identifier.: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", |
| 57 | Recordsscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Revision#Records.: []Recordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#{{ |
| 58 | Identifierscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Identifier.: "12345678-1234-1234-1234-123456789abc", |
| 59 | Namescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Name.: "_acme-challenge", |
| 60 | RDatascip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#RData.: "ADw2sEd82DUgXcQ9hNBZThJs7zVJkR5v9JeSbAb9mZY", |
| 61 | TTLscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#TTL.: 300, |
| 62 | Typescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Type.: "TXT", |
| 63 | }}, |
| 64 | Statescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Revision#State.: "deployed", |
| 65 | }}, |
| 66 | } |
| 67 | |
| 68 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected, zone) |
| 69 | } |
| 70 | |
| 71 | func TestClient_DeleteRecordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/TestClient_DeleteRecord().(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#) { |
| 72 | client := mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/mockBuilder().(). |
| 73 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("DELETE /api/clouddns/v1/zone.json/example.com/records/12345678-1234-1234-1234-123456789abc", |
| 74 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.Noopscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Noop().()). |
| 75 | Buildscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Build().(t) |
| 76 | |
| 77 | err := client.DeleteRecordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#DeleteRecord().(t.Contextscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Context().(), "example.com", "12345678-1234-1234-1234-123456789abc") |
| 78 | 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) |
| 79 | } |
| 80 | |
| 81 | func TestClient_DeleteRecord_errorscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/TestClient_DeleteRecord_error().(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#) { |
| 82 | client := mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/mockBuilder().(). |
| 83 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("DELETE /api/clouddns/v1/zone.json/example.com/records/12345678-1234-1234-1234-123456789abc", |
| 84 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.ResponseFromFixturescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/ResponseFromFixture().("error.json"). |
| 85 | WithStatusCodescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/ResponseFromFileHandler#WithStatusCode().(httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.StatusUnauthorizedscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/StatusUnauthorized.)). |
| 86 | Buildscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Build().(t) |
| 87 | |
| 88 | err := client.DeleteRecordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#DeleteRecord().(t.Contextscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Context().(), "example.com", "12345678-1234-1234-1234-123456789abc") |
| 89 | 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, "401: Unauthorized") |
| 90 | } |
| 91 | |
| 92 | func TestClient_GetZonescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/TestClient_GetZone().(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#) { |
| 93 | client := mockBuilderscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/mockBuilder().(). |
| 94 | Routescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Route().("GET /api/clouddns/v1/zone.json/example.com", |
| 95 | servermockscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/.ResponseFromFixturescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/ResponseFromFixture().("get_zone.json")). |
| 96 | Buildscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/platform/tester/servermock`/Builder#Build().(t) |
| 97 | |
| 98 | zone, err := client.GetZonescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Client#GetZone().(t.Contextscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Context().(), "example.com") |
| 99 | 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) |
| 100 | |
| 101 | expected := &Zonescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#{ |
| 102 | Identifierscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#Identifier.: "fdb355ffd07c48aba3d4f6bf6a116296", |
| 103 | Namescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#Name.: "example.com", |
| 104 | TTLscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#TTL.: 3600, |
| 105 | ZoneNamescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#ZoneName.: "", |
| 106 | Revisionsscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Zone#Revisions.: []Revisionscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Revision#{{ |
| 107 | Identifierscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Revision#Identifier.: "eeed7e08-f1ad-442b-9e75-369a0958c7d8", |
| 108 | Recordsscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Revision#Records.: []Recordscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#{ |
| 109 | { |
| 110 | Identifierscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Identifier.: "5ced498b-c89d-4487-824d-c03ded84f849", |
| 111 | Immutablescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Immutable.: true, |
| 112 | Namescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Name.: "@", |
| 113 | RDatascip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#RData.: "acns02.xaas.systems.", |
| 114 | Regionscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Region.: "9a1609af9dae4ce1a4ef63f51d305321", |
| 115 | TTLscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#TTL.: 3600, |
| 116 | Typescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Type.: "NS", |
| 117 | }, |
| 118 | { |
| 119 | Identifierscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Identifier.: "12345678-1234-1234-1234-123456789abc", |
| 120 | Immutablescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Immutable.: false, |
| 121 | Namescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Name.: "_acme-challenge", |
| 122 | RDatascip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#RData.: "ADw2sEd82DUgXcQ9hNBZThJs7zVJkR5v9JeSbAb9mZY", |
| 123 | Regionscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Region.: "", |
| 124 | TTLscip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#TTL.: 300, |
| 125 | Typescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Record#Type.: "TXT", |
| 126 | }, |
| 127 | }, |
| 128 | Statescip-go gomod github.com/go-acme/lego/v4 . `github.com/go-acme/lego/v4/providers/dns/anexia/internal`/Revision#State.: "active", |
| 129 | }}, |
| 130 | } |
| 131 | |
| 132 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected, zone) |
| 133 | } |