feat(api): endpoints to mark and unmark custom records

This commit is contained in:
2026-08-19 18:10:46 +07:00
parent 208e73980d
commit da267b3cef
5 changed files with 211 additions and 2 deletions
+8
View File
@@ -55,6 +55,12 @@ type TenantStore interface {
// "unknown" until the scheduler's next tick. Scoped by projectID so a
// foreign domain ID can never have its status overwritten (IDOR-on-write).
SetDomainStatus(ctx context.Context, domainID, projectID uuid.UUID, status string) error
// AddCustomRecord/DeleteCustomRecord manage the per-domain marks that keep
// a record out of the diff. Scoped by projectID: marking a domain outside
// the caller's project must fail (IDOR-on-write).
AddCustomRecord(ctx context.Context, domainID, projectID uuid.UUID, key string) error
DeleteCustomRecord(ctx context.Context, domainID, projectID uuid.UUID, key string) error
}
// Cipher encrypts/decrypts provider account secrets. *crypto.Cipher satisfies it.
@@ -132,6 +138,8 @@ func NewRouter(a *API) http.Handler {
r.Get("/history", a.handleDomainHistory)
r.Get("/records", a.handleZoneRecords)
r.Post("/template-from-zone", a.handleTemplateFromZone)
r.Post("/customs", a.handleAddCustom)
r.Delete("/customs", a.handleDeleteCustom)
})
})