Get rid of expiration in Capability and Tag and move this to NetworkConfig so it can be set network-wide and reset if needed. Also add NetworkConfig field for this and centralize checking of credential time validity.
This commit is contained in:
parent
6db47de25e
commit
9a3c652a51
9 changed files with 51 additions and 70 deletions
|
@ -62,15 +62,13 @@ public:
|
|||
/**
|
||||
* @param nwid Network ID
|
||||
* @param ts Timestamp
|
||||
* @param expiration Tag expiration relative to network config timestamp
|
||||
* @param issuedTo Address to which this tag was issued
|
||||
* @param id Tag ID
|
||||
* @param value Tag value
|
||||
*/
|
||||
Tag(const uint64_t nwid,const uint64_t ts,const uint64_t expiration,const Address &issuedTo,const uint32_t id,const uint32_t value) :
|
||||
Tag(const uint64_t nwid,const uint64_t ts,const Address &issuedTo,const uint32_t id,const uint32_t value) :
|
||||
_nwid(nwid),
|
||||
_ts(ts),
|
||||
_expiration(expiration),
|
||||
_id(id),
|
||||
_value(value),
|
||||
_issuedTo(issuedTo),
|
||||
|
@ -79,7 +77,6 @@ public:
|
|||
}
|
||||
|
||||
inline uint64_t networkId() const { return _nwid; }
|
||||
inline uint64_t expiration() const { return _expiration; }
|
||||
inline uint64_t timestamp() const { return _ts; }
|
||||
inline uint32_t id() const { return _id; }
|
||||
inline const uint32_t &value() const { return _value; }
|
||||
|
@ -120,7 +117,6 @@ public:
|
|||
// These are the same between Tag and Capability
|
||||
b.append(_nwid);
|
||||
b.append(_ts);
|
||||
b.append(_expiration);
|
||||
b.append(_id);
|
||||
|
||||
b.append(_value);
|
||||
|
@ -146,7 +142,6 @@ public:
|
|||
// These are the same between Tag and Capability
|
||||
_nwid = b.template at<uint64_t>(p); p += 8;
|
||||
_ts = b.template at<uint64_t>(p); p += 8;
|
||||
_expiration = b.template at<uint64_t>(p); p += 8;
|
||||
_id = b.template at<uint32_t>(p); p += 4;
|
||||
|
||||
_value = b.template at<uint32_t>(p); p += 4;
|
||||
|
@ -176,7 +171,6 @@ public:
|
|||
private:
|
||||
uint64_t _nwid;
|
||||
uint64_t _ts;
|
||||
uint64_t _expiration;
|
||||
uint32_t _id;
|
||||
uint32_t _value;
|
||||
Address _issuedTo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue