Documentation
¶
Overview ¶
Basic custom nodes for test and demo use. Not secure for production.
Basic policies for test and demo use. Not secure for production. The TODO points listed here are all design questions we need to decide before production-ready code.
Generated by the generator, DO NOT modify manually
Index ¶
- func NewFixedKeyIntSigner(key []byte) schema.NTPolicy
- func NewFixedKeySigner(key []byte) schema.NTPolicy
- func NewLocalOnlyPolicy() schema.NTPolicy
- func NewMemStoragePolicy() schema.NTPolicy
- func NewRegisterPolicy() schema.NTPolicy
- func NewRegisterPolicy2(matching enc.Matching) schema.NTPolicy
- type CacheEntry
- type ContentKeyNode
- func (n *ContentKeyNode) Decrypt(matching enc.Matching, content enc.Wire) (enc.Wire, error)
- func (n *ContentKeyNode) Encrypt(matching enc.Matching, ckid []byte, content enc.Wire) (enc.Wire, error)
- func (n *ContentKeyNode) GenKey(matching enc.Matching) []byte
- func (n *ContentKeyNode) Init(parent schema.NTNode, edge enc.ComponentPattern)
- type FixedKeyIntSigner
- func (p *FixedKeyIntSigner) Apply(node schema.NTNode) error
- func (p *FixedKeyIntSigner) ComputeSigValue(covered enc.Wire) ([]byte, error)
- func (*FixedKeyIntSigner) EstimateSize() uint
- func (p *FixedKeyIntSigner) PolicyTrait() schema.NTPolicy
- func (p *FixedKeyIntSigner) SigInfo() (*ndn.SigConfig, error)
- type FixedKeySigner
- type GroupSigNode
- func (n *GroupSigNode) Get(propName schema.PropKey) any
- func (n *GroupSigNode) Init(parent schema.NTNode, edge enc.ComponentPattern)
- func (n *GroupSigNode) Need(matching enc.Matching, context schema.Context) chan schema.NeedResult
- func (n *GroupSigNode) OnAttach(path enc.NamePattern, engine ndn.Engine) error
- func (n *GroupSigNode) Provide(matching enc.Matching, content enc.Wire, context schema.Context)
- func (n *GroupSigNode) Set(propName schema.PropKey, value any) error
- type LocalOnlyPolicy
- type MemStoragePolicy
- type MissingData
- type RegisterPolicy
- type RegisterPolicy2
- type StateVec
- type StateVecEncoder
- type StateVecEntry
- type StateVecEntryEncoder
- type StateVecEntryParsingContext
- type StateVecParsingContext
- type SvsNode
- func (n *SvsNode) Get(propName schema.PropKey) any
- func (n *SvsNode) Init(parent schema.NTNode, edge enc.ComponentPattern)
- func (n *SvsNode) MissingDataChannel() chan MissingData
- func (n *SvsNode) MySequence() uint64
- func (n *SvsNode) Need(nodeId []byte, seq uint64, matching enc.Matching, context schema.Context) chan schema.NeedResult
- func (n *SvsNode) NewData(content enc.Wire, context schema.Context) enc.Wire
- func (n *SvsNode) Set(propName schema.PropKey, value any) error
- type SvsOnMissingEvent
- type SyncState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFixedKeyIntSigner ¶
func NewFixedKeySigner ¶
func NewLocalOnlyPolicy ¶
func NewMemStoragePolicy ¶
func NewRegisterPolicy ¶
Types ¶
type ContentKeyNode ¶
ContentKeyNode is a proof-of-concept demo to show how NTSchema can support NAC For simplicity we don't use KEK and KDK here.
func (*ContentKeyNode) Init ¶
func (n *ContentKeyNode) Init(parent schema.NTNode, edge enc.ComponentPattern)
type FixedKeyIntSigner ¶
type FixedKeyIntSigner struct {
// contains filtered or unexported fields
}
FixedKeyIntSigner is a demo policy that signs Interests using provided HMAC key.
func (*FixedKeyIntSigner) ComputeSigValue ¶
func (p *FixedKeyIntSigner) ComputeSigValue(covered enc.Wire) ([]byte, error)
func (*FixedKeyIntSigner) EstimateSize ¶
func (*FixedKeyIntSigner) EstimateSize() uint
func (*FixedKeyIntSigner) PolicyTrait ¶
func (p *FixedKeyIntSigner) PolicyTrait() schema.NTPolicy
type FixedKeySigner ¶
type FixedKeySigner struct {
// contains filtered or unexported fields
}
FixedKeySigner is a demo policy that signs data using provided HMAC key. TODO: This has a problem with group signature node: The group signature node (subtree) has two leaves: the segmented data, and meta data. The segmented data has its own validation (SHA256 sig), but how to validate the meta data is specified by the trust schema (i.e. user). Then, is it still a good idea to make group sig node a blackbox? If yes, what is the best way to let the user specify how the packet is signed/validated? (#BLACKBOX)
func (*FixedKeySigner) ComputeSigValue ¶
func (p *FixedKeySigner) ComputeSigValue(covered enc.Wire) ([]byte, error)
func (*FixedKeySigner) EstimateSize ¶
func (*FixedKeySigner) EstimateSize() uint
func (*FixedKeySigner) PolicyTrait ¶
func (p *FixedKeySigner) PolicyTrait() schema.NTPolicy
type GroupSigNode ¶
GroupSigNode represents a subtree that supports group signature on a segmented node. TODO: Is it a better idea to let the user specify what `seg` is, instead of using fixed LeafNode? That may be way more complicated, and I'm not sure about the use case. (#BLACKBOX)
func (*GroupSigNode) Get ¶
func (n *GroupSigNode) Get(propName schema.PropKey) any
Get a property or callback event
func (*GroupSigNode) Init ¶
func (n *GroupSigNode) Init(parent schema.NTNode, edge enc.ComponentPattern)
func (*GroupSigNode) Need ¶
func (n *GroupSigNode) Need(matching enc.Matching, context schema.Context) chan schema.NeedResult
func (*GroupSigNode) OnAttach ¶
func (n *GroupSigNode) OnAttach(path enc.NamePattern, engine ndn.Engine) error
type LocalOnlyPolicy ¶
type LocalOnlyPolicy struct{}
LocalOnlyPolicy surpress Interest expression. TODO: Is this secure? Do we need to consider the case where PropSuppressInt is overwritten by another policy?
func (*LocalOnlyPolicy) PolicyTrait ¶
func (p *LocalOnlyPolicy) PolicyTrait() schema.NTPolicy
type MemStoragePolicy ¶
type MemStoragePolicy struct {
// contains filtered or unexported fields
}
MemStoragePolicy is a policy that stored data in a memory storage. TODO: If we use on-disk storage, how to specify the path (#ENV)
func (*MemStoragePolicy) PolicyTrait ¶
func (p *MemStoragePolicy) PolicyTrait() schema.NTPolicy
type MissingData ¶
type RegisterPolicy ¶
type RegisterPolicy struct{}
RegisterPolicy marks the current node as the prefix to be registered. The current one can only handle fixed prefix. TODO: Handle the path "/prefix/<node-id>" with a given <node-id>. (#ENV)
func (*RegisterPolicy) PolicyTrait ¶
func (p *RegisterPolicy) PolicyTrait() schema.NTPolicy
type RegisterPolicy2 ¶
type RegisterPolicy2 struct {
// contains filtered or unexported fields
}
RegisterPolicy2 is a quick patch to RegisterPolicy so that it can be applied to a path with nodeID.
func (*RegisterPolicy2) PolicyTrait ¶
func (p *RegisterPolicy2) PolicyTrait() schema.NTPolicy
type StateVec ¶
type StateVec struct { //+field:sequence:*StateVecEntry:struct:StateVecEntry Entries []*StateVecEntry `tlv:"0xca"` }
func ParseStateVec ¶
func ParseStateVec(reader enc.ParseReader, ignoreCritical bool) (*StateVec, error)
type StateVecEncoder ¶
type StateVecEncoder struct { Entries_subencoder []struct { Entries_encoder StateVecEntryEncoder } // contains filtered or unexported fields }
func (*StateVecEncoder) EncodeInto ¶
func (encoder *StateVecEncoder) EncodeInto(value *StateVec, buf []byte)
func (*StateVecEncoder) Init ¶
func (encoder *StateVecEncoder) Init(value *StateVec)
type StateVecEntry ¶
type StateVecEntry struct { //+field:binary NodeId []byte `tlv:"0x07"` //+field:natural SeqNo uint64 `tlv:"0xcc"` }
func ParseStateVecEntry ¶
func ParseStateVecEntry(reader enc.ParseReader, ignoreCritical bool) (*StateVecEntry, error)
func (*StateVecEntry) Bytes ¶
func (value *StateVecEntry) Bytes() []byte
func (*StateVecEntry) Encode ¶
func (value *StateVecEntry) Encode() enc.Wire
type StateVecEntryEncoder ¶
type StateVecEntryEncoder struct {
// contains filtered or unexported fields
}
func (*StateVecEntryEncoder) Encode ¶
func (encoder *StateVecEntryEncoder) Encode(value *StateVecEntry) enc.Wire
func (*StateVecEntryEncoder) EncodeInto ¶
func (encoder *StateVecEntryEncoder) EncodeInto(value *StateVecEntry, buf []byte)
func (*StateVecEntryEncoder) Init ¶
func (encoder *StateVecEntryEncoder) Init(value *StateVecEntry)
type StateVecEntryParsingContext ¶
type StateVecEntryParsingContext struct { }
func (*StateVecEntryParsingContext) Init ¶
func (context *StateVecEntryParsingContext) Init()
func (*StateVecEntryParsingContext) Parse ¶
func (context *StateVecEntryParsingContext) Parse(reader enc.ParseReader, ignoreCritical bool) (*StateVecEntry, error)
type StateVecParsingContext ¶
type StateVecParsingContext struct {
Entries_context StateVecEntryParsingContext
}
func (*StateVecParsingContext) Init ¶
func (context *StateVecParsingContext) Init()
func (*StateVecParsingContext) Parse ¶
func (context *StateVecParsingContext) Parse(reader enc.ParseReader, ignoreCritical bool) (*StateVec, error)
type SvsNode ¶
SvsNode represents a subtree supports a simplified state-vector-sync protocol. TODO: How to return the missing data to the user? Channel or callback? TODO: How can the user express the trust schema here? The `notif` node mat have different requirements as the `leaf` node. (#BLACKBOX)
func (*SvsNode) MissingDataChannel ¶
func (n *SvsNode) MissingDataChannel() chan MissingData