From 5809f0bfbfd6f0eea46171cb4217d67ceef113bc Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 11 Aug 2020 11:11:23 +0300 Subject: [PATCH] [#40] service: Add session token context Replace object address field with the oneof-list of session contexts. Break the connection of the session with the object. Extend the ability to open sessions for other needs without losing backward compatibility. Signed-off-by: Leonard Lyubich --- proto-docs/service.md | 2 +- service/verify.proto | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index 0a515e9..45af335 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -147,10 +147,10 @@ User token granting rights for object manipulation | id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | | owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the manipulation object owner. | | verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued | -| address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | | lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | | session_key | [bytes](#bytes) | | SessionKey is a public key of session key | | owner_key | [bytes](#bytes) | | OwnerKey is a public key of the token owner | +| object_address | [refs.Address](#refs.Address) | | object_address represents the object session context. | diff --git a/service/verify.proto b/service/verify.proto index 86262ec..a40d1d0 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -58,17 +58,20 @@ message Token { // Verb is a type of request for which the token is issued Verb verb = 3; - // Address is an object address for which token is issued - refs.Address address = 4; - // Lifetime is a lifetime of the session - TokenLifetime lifetime = 5; + TokenLifetime lifetime = 4; // SessionKey is a public key of session key - bytes session_key = 6; + bytes session_key = 5; // OwnerKey is a public key of the token owner - bytes owner_key = 7; + bytes owner_key = 6; + + // Carries context of the session. + oneof context { + // object_address represents the object session context. + refs.Address object_address = 7; + } } // token_info is a grouped information about token