Skip to content

Commit ab7c637

Browse files
committed
make ignore_validity an option for repo
1 parent 45fea08 commit ab7c637

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

repo/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ type Config struct {
1717
KeyChainUri string `json:"keychain"`
1818
// List of trust anchor full names.
1919
TrustAnchors []string `json:"trust_anchors"`
20+
// IgnoreValidity skips validity period checks when fetching remote data (e.g. SVS snapshots).
21+
IgnoreValidity bool `json:"ignore_validity"`
2022

2123
// NameN is the parsed name of the repo service.
2224
NameN enc.Name

repo/repo.sample.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ repo:
99
# [required] List of full names of all trust anchors
1010
trust_anchors:
1111
- "/ndn/KEY/%27%C4%B2%2A%9F%7B%81%27/ndn/v=1651246789556"
12+
# [optional] If true, skip certificate validity checks when consuming data (e.g. SVS snapshots)
13+
ignore_validity: false

repo/repo_svs.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
spec "github.com/named-data/ndnd/std/ndn/spec_2022"
1212
"github.com/named-data/ndnd/std/ndn/svs_ps"
1313
ndn_sync "github.com/named-data/ndnd/std/sync"
14+
"github.com/named-data/ndnd/std/types/optional"
1415
)
1516

1617
type RepoSvs struct {
@@ -49,9 +50,10 @@ func (r *RepoSvs) Start() (err error) {
4950
}
5051

5152
snapshot = &ndn_sync.SnapshotNodeHistory{
52-
Client: r.client,
53-
Threshold: r.cmd.HistorySnapshot.Threshold,
54-
IsRepo: true,
53+
Client: r.client,
54+
Threshold: r.cmd.HistorySnapshot.Threshold,
55+
IsRepo: true,
56+
IgnoreValidity: optional.Some(r.config.IgnoreValidity),
5557
}
5658
}
5759

@@ -72,6 +74,7 @@ func (r *RepoSvs) Start() (err error) {
7274
SuppressionPeriod: 500 * time.Millisecond,
7375
PeriodicTimeout: 365 * 24 * time.Hour, // basically never
7476
Passive: true,
77+
IgnoreValidity: optional.Some(r.config.IgnoreValidity),
7578
},
7679
Snapshot: snapshot,
7780
MulticastPrefix: multicastPrefix,

0 commit comments

Comments
 (0)