feat(client): Add RDAP support for domain expiration (#1181)

Fixes #1083

Fixes #1254

Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
ju-ef
2025-09-11 23:32:19 +03:00
committed by GitHub
parent 39bfc51ce4
commit af4fbac84d
4 changed files with 48 additions and 1 deletions

View File

@@ -39,6 +39,20 @@ func TestGetHTTPClient(t *testing.T) {
}
}
func TestRdapQuery(t *testing.T) {
if _, err := rdapQuery("1.1.1.1"); err == nil {
t.Error("expected an error due to the invalid domain type")
}
if _, err := rdapQuery("eurid.eu"); err == nil {
t.Error("expected an error as there is no RDAP support currently in .eu")
}
if response, err := rdapQuery("example.com"); err != nil {
t.Fatal("expected no error, got", err.Error())
} else if response.ExpirationDate.Unix() <= 0 {
t.Error("expected to have a valid expiry date, got", response.ExpirationDate.Unix())
}
}
func TestGetDomainExpiration(t *testing.T) {
t.Parallel()
if domainExpiration, err := GetDomainExpiration("gatus.io"); err != nil {