This commit:
* moves defined errors to a separate file;
* renames ErrEmptyToken to ErrNilToken;
* merges ErrZeroTTL and ErrIncorrectTTL into single ErrInvalidTTL.
All sessions in NeoFS has limited in epochs lifetime. There is a need
to limit the lifetime of private session tokens.
This commmit:
* extends PrivateToken interface with Expired method;
* defines EpochLifetimeStore interface with RemoveExpired method
and embeds it to PrivateTokenStore interface;
* adds epoch value parameter to private token constructor.
In previous implementation PToken contained the full Token structure.
Since private token is used for data signature only, storing unused
fields of a user token is impractical. To emphasize the purpose of
the private part of the session, it makes sense to provide the user
of the session package with its interface. The interface will only provide
the functionality of data signing with private session key.
This commit:
* removes PToken structure from session package;
* defines PrivateToken interface of private session part;
* adds the implementation of PrivateToken on unexported struct;
* provides the constructor that generates session key internally.
This commit adds next changes to VerifyTokenSignature:
* returns ErrEmptyToken on nil token argument;
* returns ErrEmptyPublicKey on nil public key argument.
After recent changes Token field is presented in RequestVerificationHeader.
There is a need to provide an interface of field getter/setter.
This commit:
* defines TokenHeader interface of token value container;
* implements Token field setter on RequestVerificationHeader.
After recent changes Raw field is presented in RequestMetaHeader.
There is a need to provide an interface of field getter/setter.
This commit:
* defines RawHeader interface of raw value container;
* embeds RawHeader into MetaHeader interface;
* implements Raw field setter on RequestMetaHeader.