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-efandTwiN authored and GitHub committed 2025-09-11 16:32:19 -04:00
1 parent 39bfc51ce4
commit af4fbac84d
4 files changed
+48 -1

No files matched your search

+14
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 {