TT-17238: recover cache for secret stores - #171
Conversation
…f ssh://github.com/TykTechnologies/storage into feat/TT-17702/add-lister-and-setter-logic
…brary doesn't handle connection
TT-17626: Add azure implementation
…s but later should be tested and finished
…to avoid 60s retry on tests
…ovider TT-17624: Add GCP provider
This reverts commit c3b4074.
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
|
This PR introduces a configurable, in-memory caching layer for secret stores to improve performance and reduce the load on backend providers like Vault or Consul. Files Changed AnalysisThe change is substantial, with 13 files modified, adding over 2000 lines and removing ~120. The bulk of the additions are in new files that implement the caching logic and its comprehensive test suite:
The caching logic is integrated into the existing architecture by modifying key files:
Architecture & Impact Assessment
sequenceDiagram
participant C as Caller
participant S as SecretStore
participant Cache as cache.Cache
participant P as Provider
C->>S: Get(ctx, path)
S->>Cache: Get(path)
alt Cache Hit (and not near expiry)
Cache-->>S: value, found=true, needsRefresh=false
S-->>C: value
else Cache Hit (near expiry)
Cache-->>S: value, found=true, needsRefresh=true
S-->>C: value (stale value returned immediately)
S->>S: triggerBackgroundRefreshOnce(path)
Note right of S: singleflight deduplicates background fetches
else Cache Miss or Bypass
Cache-->>S: "", found=false
S->>P: Get(ctx, path)
Note right of S: singleflight deduplicates concurrent requests
P-->>S: newValue, err
S->>Cache: Set(path, newValue, err)
S-->>C: newValue, err
end
Scope Discovery & Context ExpansionThis is a foundational change to a core infrastructure component. The impact extends beyond the
Metadata
Powered by Visor from Probelabs Last updated: 2026-08-14T06:44:15.680Z | Triggered by: pr_updated | Commit: 3daf5f6 💡 TIP: You can chat with Visor using |
Security Issues (1)
Security Issues (1)
Performance Issues (1)
Powered by Visor from Probelabs Last updated: 2026-08-14T06:42:22.886Z | Triggered by: pr_updated | Commit: 3daf5f6 💡 TIP: You can chat with Visor using |
🚨 Jira Linter FailedCommit: The Jira linter failed to validate your PR. Please check the error details below: 🔍 Click to view error detailsNext Steps
This comment will be automatically deleted once the linter passes. |
|



Description
Related Issue
Motivation and Context
Test Coverage For This Change
Screenshots (if appropriate)
Types of changes
Checklist
master!masterbranch (left side). Also, it would be best if you started your change off our latestmaster.go mod tidy && go mod vendorgofmt -s -w .go vet ./...Ticket Details
TT-17238
Generated at: 2026-08-14 06:41:10