feat: human-readable scan_id from UTC time + request CIDRs + short random suffix

Made-with: Cursor
This commit is contained in:
PTah
2026-04-13 14:55:40 +10:00
parent 635876bbe3
commit 5b3eeaed45
3 changed files with 68 additions and 6 deletions
+2 -1
View File
@@ -24,12 +24,13 @@ func NewPostgresStore(db *sql.DB) *PostgresStore {
}
func (s *PostgresStore) CreateScan(req CreateScanRequest) (ScanJob, error) {
cidrSnapshot := append([]string(nil), req.CIDRs...)
if err := validateCreateScanRequest(&req); err != nil {
return ScanJob{}, err
}
applyDefaultOptions(&req.Options)
id, err := newID()
id, err := newScanID(cidrSnapshot)
if err != nil {
return ScanJob{}, err
}