/// An authentication key which has an expiration time.
/// After that time is will automatically become invalid.
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
pub struct ExpiringKey {
/// Random 32-char string. For example: `YZSl4lMZupRuOpSRC3krIKR5BPB14nrJ`
pub key: Key,
/// Timestamp, the key will be no longer valid after this timestamp
pub valid_until: DurationSinceUnixEpoch,
}
There are some possible implementations:
Proposal 1: Set valid_until to 0
ExpiringKeys with the UnixEpoch value in the valid_until field don't expire.
Parent issue: https://github.com/torrust/torrust-tracker/issues/773
We can allow single keys to be permanent.
There are some possible implementations:
Proposal 1: Set
valid_until
to 0ExpiringKeys with the UnixEpoch value in the
valid_until
field don't expire.Proposal 2: Make
valid_until
optionalNOTICE: I would rename the struct to
TrackerKey
because it can be permanent. Alternatively, we could renameKey
toToken
andExpiringKey
toKey
.cc @da2ce7