Skip to content

Commit 718dc40

Browse files
committed
feat: enrich domain registration status
1 parent bb29ed3 commit 718dc40

2 files changed

Lines changed: 257 additions & 57 deletions

File tree

api/v1alpha/domain_types.go

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type DomainSpec struct {
4242
// DomainStatus defines the observed state of Domain
4343
type DomainStatus struct {
4444
Verification *DomainVerificationStatus `json:"verification,omitempty"`
45-
Registrar *DomainRegistrarStatus `json:"registrar,omitempty"`
45+
Registration *Registration `json:"registration,omitempty"`
4646
Conditions []metav1.Condition `json:"conditions,omitempty"`
4747
}
4848

@@ -91,24 +91,6 @@ type DomainVerificationStatus struct {
9191
NextVerificationAttempt metav1.Time `json:"nextVerificationAttempt,omitempty"`
9292
}
9393

94-
// DomainRegistrarStatus represents the registrar information for a domain
95-
type DomainRegistrarStatus struct {
96-
IANAID string `json:"ianaID,omitempty"`
97-
IANAName string `json:"ianaName,omitempty"`
98-
CreatedDate string `json:"createdDate,omitempty"`
99-
ModifiedDate string `json:"modifiedDate,omitempty"`
100-
ExpirationDate string `json:"expirationDate,omitempty"`
101-
Nameservers []string `json:"nameservers,omitempty"`
102-
DNSSEC DNSSECStatus `json:"dnssec,omitempty"`
103-
ClientStatusCodes []string `json:"clientStatusCodes,omitempty"`
104-
ServerStatusCodes []string `json:"serverStatusCodes,omitempty"`
105-
}
106-
107-
// DNSSECStatus represents the DNSSEC status of a domain
108-
type DNSSECStatus struct {
109-
Signed bool `json:"signed"`
110-
}
111-
11294
// DNSVerificationRecord represents a DNS record required for verification
11395
type DNSVerificationRecord struct {
11496
Name string `json:"name"`
@@ -121,6 +103,78 @@ type HTTPVerificationToken struct {
121103
Body string `json:"body"`
122104
}
123105

106+
// Registration represents the registration information for a domain
107+
type Registration struct {
108+
// Identity & provenance
109+
Domain string `json:"domain,omitempty"` // FQDN as observed (punycode)
110+
RegistryDomainID string `json:"registryDomainID,omitempty"` // e.g., "12345-EXAMPLE"
111+
Handle string `json:"handle,omitempty"` // RDAP handle if present
112+
Source string `json:"source,omitempty"` // "rdap" | "whois"
113+
114+
Registrar *RegistrarInfo `json:"registrar,omitempty"`
115+
Registry *RegistryInfo `json:"registry,omitempty"` // optional (operator of the TLD)
116+
117+
// Lifecycle
118+
CreatedAt *metav1.Time `json:"createdAt,omitempty"`
119+
UpdatedAt *metav1.Time `json:"updatedAt,omitempty"`
120+
ExpiresAt *metav1.Time `json:"expiresAt,omitempty"`
121+
122+
// Raw statuses that will either be rdap rfc8056 or whois EPP status strings
123+
Statuses []string `json:"statuses,omitempty"` // e.g., clientTransferProhibited (EPP) or client transfer prohibited (RDAP)
124+
125+
// Delegation (what the parent currently delegates to)
126+
Nameservers []string `json:"nameservers,omitempty"` // normalized: lowercase, no trailing dot
127+
128+
// DNSSEC (from RDAP secureDNS, with WHOIS fallback when parsable)
129+
DNSSEC *DNSSECInfo `json:"dnssec,omitempty"`
130+
131+
// Contacts (minimal, non-PII summary if available)
132+
Contacts *ContactSet `json:"contacts,omitempty"`
133+
134+
// Abuse / support contacts (registrar/registry)
135+
Abuse *AbuseContact `json:"abuse,omitempty"`
136+
}
137+
138+
type RegistrarInfo struct {
139+
IANAID string `json:"ianaID,omitempty"` // registrar IANA ID if known
140+
Name string `json:"name,omitempty"`
141+
URL string `json:"url,omitempty"`
142+
}
143+
144+
type RegistryInfo struct {
145+
Name string `json:"name,omitempty"` // e.g., Verisign, PIR
146+
URL string `json:"url,omitempty"`
147+
}
148+
149+
type DNSSECInfo struct {
150+
Enabled *bool `json:"enabled,omitempty"` // true if RDAP secureDNS/WHOIS indicates DNSSEC
151+
DS []DSRecord `json:"ds,omitempty"` // optional if RDAP provides dsData; WHOIS rarely reliable
152+
}
153+
154+
type DSRecord struct {
155+
KeyTag uint16 `json:"keyTag"`
156+
Algorithm uint8 `json:"algorithm"`
157+
DigestType uint8 `json:"digestType"`
158+
Digest string `json:"digest"`
159+
}
160+
161+
type ContactSet struct {
162+
Registrant *Contact `json:"registrant,omitempty"`
163+
Admin *Contact `json:"admin,omitempty"`
164+
Tech *Contact `json:"tech,omitempty"`
165+
}
166+
167+
type Contact struct {
168+
Organization string `json:"organization,omitempty"`
169+
Email string `json:"email,omitempty"` // may be redacted
170+
Phone string `json:"phone,omitempty"` // may be redacted
171+
}
172+
173+
type AbuseContact struct {
174+
Email string `json:"email,omitempty"`
175+
Phone string `json:"phone,omitempty"`
176+
}
177+
124178
// +kubebuilder:object:root=true
125179

126180
// DomainList contains a list of Domain

api/v1alpha/zz_generated.deepcopy.go

Lines changed: 184 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)