Cybersecurity-Projects/PROJECTS/beginner/canary-token-generator/backend
CarterPerez-dev b3fd75b680 feat(canary): Event.AttachGeoIP + event.Service geo enrichment
- entity: (*Event).AttachGeoIP(geoip.Lookup) sets Geo* nullable
  pointer fields with overwrite semantics (empty/zero collapses to
  nil so DB column stays NULL). Single-arg signature matches the
  call shape in design spec §9 (line 1437) and keeps the helper
  symmetric with the geoip.Lookup value type.
- service: ServiceConfig.GeoIP geoip.Lookuper plumbed through to
  the Service.geo field. Record now calls enrichGeo(evt) BEFORE
  s.repo.Insert so geo_country/region/city/asn/asn_org persist in
  the same row. enrichGeo is nil-safe on three axes (geo, evt,
  evt.SourceIP) — geo enrichment is best-effort, never an error
  path.
- service_test: fakeLookuper + newSvcWithGeo helper; five new
  tests (enriches-before-insert, no-geo-leaves-nil, empty-IP-
  skips-lookup, NopService-leaves-nil, best-effort-when-insert-
  fails). All pre-existing tests pass unchanged because GeoIP
  defaults to nil.
- entity_test: seven AttachGeoIP unit tests covering populate-all,
  empty Lookup, partial fields, zero/negative ASN guards, overwrite
  semantics, and ASN-pointer independence from the input value.
- integration_test: two real-Postgres tests (stub Lookuper writes
  populated geo_* columns; NopService leaves them NULL) verify
  the wiring round-trips through the Insert SQL.
2026-05-17 05:24:17 -04:00
..
cmd fix(canary-phase12): address audit findings before phase rollup 2026-05-14 07:02:39 -04:00
internal feat(canary): Event.AttachGeoIP + event.Service geo enrichment 2026-05-17 05:24:17 -04:00
.air.toml fix(canary-phase1): clear all post-phase-1 audit observations + header normalization 2026-05-10 06:15:26 -04:00
.gitignore fix(canary-phase0): address audit findings before phase rollup 2026-05-10 05:37:32 -04:00
.golangci.yml chore(canary): scope gosec G101/G107/G704 to outbound HTTP packages 2026-05-14 00:32:07 -04:00
config.yaml fix(canary-phase1): clear all post-phase-1 audit observations + header normalization 2026-05-10 06:15:26 -04:00
go.mod feat(canary): geoip wrapper package + config wiring 2026-05-17 05:23:53 -04:00
go.sum feat(canary): geoip wrapper package + config wiring 2026-05-17 05:23:53 -04:00