Skip to content

feat: read registry records through a Redis cache of active records - #132

Open
tdprajwal wants to merge 2 commits into
developmentfrom
feat/109-registry-active-cache
Open

tdprajwal wants to merge 2 commits into
developmentfrom
feat/109-registry-active-cache

Conversation

@tdprajwal

Copy link
Copy Markdown

What

Adds a registrycache plugin that keeps every active registry record in Redis for 24h, reloaded daily, and makes signature lookup, the agreement check and provider routing read through it. Supersedes #123.

Changes to existing records (a withdrawn key, an inactive participant, a changed baseUrl) can take up to the TTL to apply. New records apply immediately, and a refusal is rechecked with the registry.

Why

Most requests no longer need a registry call: two loads per day instead of one call per request.

Testing

Unit tests. On quick-start, an AgricultureFacility select was served end to end with the registry stopped.

Closes #109

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

📊 Test Coverage: ✅ Passed — 86% of changed lines covered, min 80%

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🛡️ Trivy security scan (CRITICAL,HIGH,MEDIUM,LOW)

View full run

Go dependencies

No findings at CRITICAL,HIGH,MEDIUM,LOW.

Container image

No findings at CRITICAL,HIGH,MEDIUM,LOW.

@tdprajwal

Copy link
Copy Markdown
Author

Self-review:

  • A refusal from a cached copy is rechecked with the registry (signature lookup, routing, agreements); a refusal the registry gave is not asked again.
  • A record not in the cache (inactive, new, unknown) or unreadable there is asked of the registry, so an inactive partner network is still refused.
  • Only the background load reads the whole entity or writes the list. A record found missing or out of date asks for a refresh, within a minute.
  • The list key includes the registry URL, so registries sharing a Redis keep apart. The reload runs a check before the list expires.
  • ttl and preload are required. Removed the unused Get.
  • Known, not changed: each lookup reads the entity list from Redis; the full-entity load is not paged (large registries fall back to per-record searches); the plugin repeats the registry url and has its own search code (follow-up); each module loads its own lists.

Retested on quick-start: a select served end to end, also with the registry stopped; lists deleted from Redis were reloaded within a minute.

@tdprajwal
tdprajwal force-pushed the feat/109-registry-active-cache branch from 85c9159 to 4a288d0 Compare November 11, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant