sec: refactor handlers of expired cert - #203
Merged
Merged
Conversation
Collaborator
Author
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
An expired cached CertList certificate can bypass the configured expiry callback and promote a trust anchor.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Replaces certificate-validity flags with a callback-based policy supporting synchronous and asynchronous expiry decisions.
Changes:
- Adds
CertExpiredCallbackand predefined expiry policies. - Propagates expiry callbacks through validation, object consumption, SVS, and repository flows.
- Updates trust validation tests for default, ignored, signature-time, and asynchronous handling.
File summaries
| File | Description |
|---|---|
std/ndn/security.go |
Defines the expiry callback API. |
std/ndn/client.go |
Exposes expiry policies in client arguments. |
std/ndn/engine.go |
Removes obsolete validation flags. |
std/security/certificate.go |
Adds predefined expiry policies. |
std/security/trust_config.go |
Integrates callback-based expiry handling. |
std/security/trust_config_test.go |
Updates expiry validation tests. |
std/object/client_trust.go |
Resumes validation on the engine goroutine. |
std/object/client_consume.go |
Propagates policies during object discovery. |
std/object/client_consume_seg.go |
Propagates policies during segment validation. |
std/sync/svs.go |
Configures SVS expiry handling. |
std/sync/svs_alo.go |
Shares SVS policy with snapshot strategies. |
std/sync/svs_alo_data.go |
Applies policy to ALO object consumption. |
std/sync/snapshot_node_latest.go |
Applies policy to latest snapshots. |
std/sync/snapshot_node_history.go |
Applies policy to historical snapshots. |
repo/config.go |
Maps repository configuration to policies. |
repo/repo_svs.go |
Configures repository SVS validation. |
repo/repo_mgmt.go |
Configures management-object validation. |
Review details
- Files reviewed: 17/17 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Cross-schema validation supplies callback arguments that contradict the new public certificate callback contract.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 17/17 changed files
- Comments generated: 1
- Review effort level: Balanced
a-thieme
approved these changes
Sep 9, 2026
greetingsuniverse
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the
UseSignatureTimeandIgnoreValidityvalidation flags with an application-definedOnCertExpiredcallback, so that we can leave more flexibility on how apps handle expired signing keys.The callback supports synchronous and asynchronous decisions:
The previous three cases (reject/ignore/timestamp-check) now become three predefined callbacks.