Skip to content

Commit ff27abb

Browse files
committed
session: change nonce field to appdata in v2 token
The `nonce` field was useless and had no practical application. But there was a need for an `appdata` field that would store application-specific data, which could be used as additional context. For example for security in the REST service. Closes #377. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
1 parent 426115f commit ff27abb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

session/types.proto

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,10 @@ message SessionTokenV2 {
345345
// Token version.
346346
uint32 version = 1 [json_name = "version"];
347347

348-
// Random nonce to prevent collisions.
349-
uint32 nonce = 2 [json_name = "nonce"];
348+
// Application-specific data that can be used to store additional context.
349+
// This field is optional and can contain any application-defined data.
350+
// Maximum size: 1024 bytes.
351+
bytes appdata = 2 [json_name = "appdata"];
350352

351353
// Account that issued this token (who signed it).
352354
neo.fs.v2.refs.OwnerID issuer = 3 [json_name = "issuer"];

0 commit comments

Comments
 (0)