From e63d112cb235daacce4fdc9432ad219eaaa10872 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 28 Apr 2020 12:50:52 +0300 Subject: [PATCH 1/3] Update to neofs-api v0.7.2 --- Makefile | 2 +- object/service.pb.go | Bin 132963 -> 128417 bytes object/service.proto | 11 +------ object/types.pb.go | Bin 85366 -> 85297 bytes object/types.proto | 6 ++-- service/meta.pb.go | Bin 15017 -> 15863 bytes service/meta.proto | 2 ++ service/verify.pb.go | Bin 22022 -> 35203 bytes service/verify.proto | 73 ++++++++++++++++++++++++++++++++++++------ session/service.pb.go | Bin 27408 -> 27455 bytes session/service.proto | 9 +++--- session/types.pb.go | Bin 22959 -> 0 bytes session/types.proto | 35 -------------------- 13 files changed, 74 insertions(+), 64 deletions(-) delete mode 100644 session/types.pb.go delete mode 100644 session/types.proto diff --git a/Makefile b/Makefile index 29f41bc..9773c9b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PROTO_VERSION=v0.7.1 +PROTO_VERSION=v0.7.2 PROTO_URL=https://github.com/nspcc-dev/neofs-api/archive/$(PROTO_VERSION).tar.gz B=\033[0;1m diff --git a/object/service.pb.go b/object/service.pb.go index 4ac61bc6736e4c9516d7e350928d031a2f340765..f882f5e1cb399150b11220b6daf2ed9852ce990e 100644 GIT binary patch delta 5594 zcmYkAO{gSS8HTC3Gr4zufaOal3X-33Wgw#qK}3agRaX-cai#XI z1a)IzNNA*@SxmAB2ucuo(YpxQib;q+hzq^MKo$ccBuF+gp7T5hayLcwsdK*H_j|wZ z^uKN%y?p!dch|GskFxAw_tPg=XSToj!=>Gi4_`gl{p{k6E8Fh)*7hG~FYYegfA!q% zxd)y)-2LRq;mr26@?*P`{4WQ)d#g9^+Fd>u&b@m5?(LVqb9Hy&u@?_^|GWNnbrbz8}!f`mn%-4nad5KdjM{^SR?dO~86Y2a}@f ztc(>uYBqIzHim=x6;Yu<84EU`6%0c$^vt6&MQoH3n^cLmFE4&e>~9)>z-Osnb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d+fW((f%MZ;@qz9`k1Pdf#&hbLojt9avo=V~c`gkK_w@BC!{8}8x-u^r z{iXCfUW2+-N_c3%U^OruwS)%B(M|n0Dh(J$`-LVzEO%Lg4q%#u%1AT%O~=3D0|ZI{ z+=MBA2r-F<>T(eWJ~Qml1G%5k3C*?2q{{ROs{kCp)2@`5|A48ZmnoPq?$W3jYA7G{ z*y%M`1BM1}Rs;1$Tjpv;u|g1L7BL45yO<|!(b%H-OAsfjR6YDjEt_%M957$424?@J zf)3um2Zak0yBn<>Av_3TvVv%UgrP~RpG%D4X{!P36AU^LHvs4r@*@B+H)P=|UGQKJ z1g zS`8FGji1tFcycQsMo@zHnNeu@R0$BLVwp?b?*t62+#7;QVP)n5rlEj?RBR>0(~zL! zKuVlt+T+G%qF`O1o5HKyfdLv548@&QLN_uPRRC))BBD1iFi}waP~?7)acC5O^}rql zukbL)5de4JfHO70;7(jg4|hD~PwsV&SY01ebEK2!k;V z-^9fRsmkD5s#OTYD~5IYfqp4*6by4v6F_WQ0^>0?ZkWMpfRu82fC2zFGuc!m7tS#K z%FqF6HFq=f&aDr6<>xGF1uipJMyr9$Ob=2F7|;>-ekOeS6i6m86&Dola*X?hh@D}> zjr9x<1*4||#?LJH)>ZJ_Y)3dDSv?Ww+US&M29=qhTlb&dmnz)gqzL4QfEF8POyms(zb{)^trGZON-`^LdOuQz_~fcJ;` z=YQU6Rou5e-t8UsHhmPab))~m?c+V?yhmit3%Pg0`cKYz+dTW{`Y(Rq{dTT?{tH{y z-|2e&o5vq~!#hk6*3HhjnLC_8{-G;&HX0u<`nUeq|D2qCYW%CAw+jK|Z~o9bKECjK iZ`b+*-}M$2?CT>}QFgL^{7J9BF#i6FpXu8BC;tPl{X^^k diff --git a/object/service.proto b/object/service.proto index b5042e2..91d0b99 100644 --- a/object/service.proto +++ b/object/service.proto @@ -5,7 +5,6 @@ option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; import "object/types.proto"; -import "session/types.proto"; import "service/meta.proto"; import "service/verify.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -58,8 +57,6 @@ service Service { message GetRequest { // Address of object (container id + object id) refs.Address Address = 1 [(gogoproto.nullable) = false]; - // Raw is the request flag of a physically stored representation of an object - bool Raw = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) @@ -82,10 +79,8 @@ message PutRequest { message PutHeader { // Object with at least container id and owner id fields Object Object = 1; - // Token with session public key and user's signature - session.Token Token = 2; // Number of the object copies to store within the RPC call (zero is processed according to the placement rules) - uint32 CopiesNumber = 3; + uint32 CopiesNumber = 2; } oneof R { @@ -112,8 +107,6 @@ message DeleteRequest { refs.Address Address = 1 [(gogoproto.nullable) = false]; // OwnerID is a wallet address bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; - // Token with session public key and user's signature - session.Token Token = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) @@ -132,8 +125,6 @@ message HeadRequest { refs.Address Address = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"]; // FullHeaders can be set true for extended headers in the object bool FullHeaders = 2; - // Raw is the request flag of a physically stored representation of an object - bool Raw = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/object/types.pb.go b/object/types.pb.go index fe474596824b7610a1a35de1aec97117967d1a3a..a24a2f1a798a88c173bc4125b21db0228126a486 100644 GIT binary patch delta 5783 zcmZ9Q&C4WL6^EH5gU*19(Zq#uum^_0gi)%hyQ`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_Vu?V`ix4XB8y_KX-xp!_FYhfYaeZ>BNU}YyP*5Xe@ z5NyO>P+K!^1e>|pH*emXnfqBh+&sQ_;^*c`{O*|a+?{sQ^~RvrRzVNX72@vb8y2*_l5Dg?e zejJOgBUKDzO1JWWSq)lc_&*^0C6z4Uf= Gxb+Jo@we0f diff --git a/service/meta.proto b/service/meta.proto index 99b37d3..093f118 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -17,6 +17,8 @@ message RequestMetaHeader { // Version defines protocol version // TODO: not used for now, should be implemented in future uint32 Version = 3; + // Raw determines whether the request is raw or not + bool Raw = 4; } // ResponseMetaHeader contains meta information based on request processing by server diff --git a/service/verify.pb.go b/service/verify.pb.go index 9dca855603caf3abe20ccf15390182e233b18232..023e6392bb2ee316a7b3ddcc8c6726604981a694 100644 GIT binary patch literal 35203 zcmeHQZF3sOvi=OeVy>!^f<(d~A@mYERk?9;j_aN{sn|}X%H`{`u!FS6u*+pZmh<+MCu%#q+luBWko$2oB?&;oXTHv2Yc6bRr_s#DrvJuFrr9hT97x;2 zMRt+3%){@^&bYMO=qT2uMNjDvnL;W_1a6bcah94=l#|o8{bnr_b|RcAL18&NI(3$)OQr67iDkX za}i>iPX>d7*k0XBZ8ppgqDdmNxi_`LT%abI*-J9{GLB}KW=}uekC**qmb2xae%-4# z>pJHj?a)qbI=9kf^Xcfk^zEMEKqDcvBJxYfl;pt@}C~^}SVc8@Z*@Ia!wkFC& z4znanl_Hzwb3s14jArs7olD6MWrWT|8g+a$OZp>gUW*WvXwqc7@RFJK>)Rx~@YrG# zT|`Nm&!7Wexn=<)m@$9jagLJIno;t~j^3EDjndq_5si@nlQ$*!*2|y|U>`kwNy7)U2pESbFp_jbuqbFym=Bht>{)bX04Zl~@auto{o*0tx z0yGIRpyb@}zqWt`J-(r%4WP=k9BP9j4NXVd;HX1GR~twm#~c?8AoASwK<99t4ou^E znQu+=1bk{V4JkE3PGz9**9(Z|93?yhU7<@ zA2A8ZFd4u)DHrXOWeXov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eSneRdVK}XaFlM^)yzEW$kD~&)N;YuW zrwJVKHC!br2F(Yh)-@c~=8`qXX>By64wS8Y%H6QDHi<;Cs$qes1{I=U+bOD~p;%88 z1vp4+8gn&(xE$(gZontk(DAL&8}v<7t<%tHCPe|Y2MSC4eu~{_)D4XR(Vl=5%=I*2 zO&N(Af1U1ldT2EHJZlDmoH_zBNhL7=Ps#6tFui(x=rdQB`$)jtp(Nq;s zNJ&>gq*Z^C$@0Z((PWU^=p%-@(mHaql852y@Jv{BeI>fN3!EI(J&8(oI>K~kN=TiO zkb<95Oo?s-S=Z~D6yg?rtPPSx*N!d)q3Ick17$>1BeIEO$5B;i zxI0vp3ZAo^AYmqvR*IAtx1uBsq*G3Y?zn-T`w5lw2KHoHUo#MDs*pUoIpRBE90GG4 z2v+y>6lSCdU}`_U=@EZmsuKaQqgOEqzeTZ%k}_R;I^K#47~->JOb}^+kJ__NJy~;b zG<32mLqUdKs{nMmAEiLA?bgWZbb%&J7sZ(OC-)zSfa=WYT%35*qYBI0lgInz@^o`; ezC0b5JFgFR@#EccarXJZKIV(F8_U<`%guijkzAJm diff --git a/session/service.proto b/session/service.proto index 524213a..5c22fc3 100644 --- a/session/service.proto +++ b/session/service.proto @@ -3,7 +3,6 @@ package session; option go_package = "github.com/nspcc-dev/neofs-api-go/session"; option csharp_namespace = "NeoFS.API.Session"; -import "session/types.proto"; import "service/meta.proto"; import "service/verify.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -33,9 +32,9 @@ message CreateRequest { // owner of manipulation object; // ID of manipulation object; // token lifetime bounds. - session.Token Init = 1; + service.Token Init = 1; // Signed Init message response (Unsigned) from server with user private key - session.Token Signed = 2; + service.Token Signed = 2; } // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; @@ -46,8 +45,8 @@ message CreateRequest { message CreateResponse { oneof Message { // Unsigned token with token ID and session public key generated on server side - session.Token Unsigned = 1; + service.Token Unsigned = 1; // Result is a resulting token which can be used for object placing through an trusted intermediary - session.Token Result = 2; + service.Token Result = 2; } } diff --git a/session/types.pb.go b/session/types.pb.go deleted file mode 100644 index 01458ddcbeeb3b8b0e1309cf040c52def5afa7b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22959 zcmeHPeQ(=F(*Ilf6#E$HLAuC_-Ym;*QlNK9?~JEyifeKx5ad#dT*AVZDW^)yUZ-TkD51Y++xk|G_ zwVI9DvQS6#a@1_RR!8%=xLi-WVY+uFr%GV+k$9yQxd7ULg!rZb&{S_zA}DpHlNSF4QVQaa1hELZVN6_@%( z1({Y!TBwvhWpCqLt97oUZu2V0)NA!vl-B(&$nwizQI3+Z-KUIbRt_;^-HT)f7M@?m zL?Ty#A~meyg+4CgrB*?n>#QKvGDkYe*F?Oy3<`Ro$A!25nW?YXVeug0Ai|0rDIq&p4>8j`?!BRgiCwDMuc%=TFr^)$|8&8*Up_i-T=ICc|K(v31 z=Sfho8Fw(Dayz4|c(SZSk|XCuna7cCHY#|O`7<1=ZJq~?XCHEd?aHGH=Rf`Q)9dfk z7s(raqoZ$0q%2q%)xLYLeio^ZSw^0@PBI;)^CbR-_~k#x*v8D9ri4LA{%QW=q!lg~fAyU6`56c8RiiyCr(-kp4(7 zZFXYA4li~$^>x^b&Z4t$IypHBqad0Xho4mWMQxhZY*1+CN&oj)CGmn4Wi>?~0pD!AFSSS5lUE&{d5|DFBirR!Xq>=U z6TDtuU%y_8bt#OeueW`!`yIfS9Yq)pQXGp$#wUw=248k%_z;Gl#CaHG5v|rFeVY&} zQpW*|Zh$SBS!AjY!y3(8BxK+uSQrhlMn14~|E7yFRuZEoP7uFj&t;7@m)&x@Z&0!1 z{-sT%{P=blH6NmeAf=QSl$|LvztM@J+>{g?HL`eqNma%y%~U%5x2E*743c=YULY|^ zs(KEPN_H|Ci)@$0I#*X-GE15U0sWlJl4y7W?ynPW(ILP}`qk`wo1^Tg&)`%!Y{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KQPDDOR=vl08QcB^=5sAXVdFcjJq`ZPq1==f$Igtq%;$^WO{r;w`81WLL3Yb%S{75-QAs3I zg39CrH{+J5e|w!tker2R3s|y*9o9mXl2|88vKB>Hrw zIjJ+v$M(?dxkRmH?ptWmx&A}6(Ad~l%K8IGNbl6j>#5lpbZ+c#%uy2AXD_J|ruLit z*go#R@_rPewhi~Ob<+4QR!4crcE3FC`)s8%_)VE|@X!uh39#8-^Bx@5TSLA+y$iRe zZ4`FltVA- zzN8s0D(<_l6X_NGHY1hTwRd;!=AI5+wB6CMvj=T*T(*5xhah)!>;PHUud6vEX_?DX z)3(Ajn%m#lv3El1ujH7!D&-{J>Y=3SAs2m`p66~Q9?23eDZBrOv@B4Phe^wPyI<9sMX^t%n`h zHsfgq;np#Pm2>B98d*YgLMs@o_N7OPRS)x4TXPZ(=o;BZ*Hox^SLBlD+3at8HLQAt z2k`i29PpaHl68R*G2v$<(?uraHCfFFNDyq3D**|KZo_WPRN9A!WHoq{gACJg;~0$8+g$gKl{11 zzlce{=EpbiYGS5EuBh;+(;@v>&zygF&0L8zSa#a69?QDC8HxLW^phs`QeeCJA86l+ AApigX diff --git a/session/types.proto b/session/types.proto deleted file mode 100644 index 3ae49a3..0000000 --- a/session/types.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; -package session; -option go_package = "github.com/nspcc-dev/neofs-api-go/session"; -option csharp_namespace = "NeoFS.API.Session"; - -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -message VerificationHeader { - // PublicKey is a session public key - bytes PublicKey = 1; - // KeySignature is a session public key signature. Signed by trusted side - bytes KeySignature = 2; -} - -// User token granting rights for object manipulation -message Token { - // Header carries verification data of session key - VerificationHeader Header = 1 [(gogoproto.nullable) = false]; - // OwnerID is an owner of manipulation object - bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // FirstEpoch is an initial epoch of token lifetime - uint64 FirstEpoch = 3; - // LastEpoch is a last epoch of token lifetime - uint64 LastEpoch = 4; - // ObjectID is an object identifier of manipulation object - repeated bytes ObjectID = 5 [(gogoproto.customtype) = "ObjectID", (gogoproto.nullable) = false]; - // Signature is a token signature, signed by owner of manipulation object - bytes Signature = 6; - // ID is a token identifier. valid UUIDv4 represented in bytes - bytes ID = 7 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; - // PublicKeys associated with owner - repeated bytes PublicKeys = 8; -} From 24108f42c3afe8b70358cb420ed88d6b74533314 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 28 Apr 2020 12:51:27 +0300 Subject: [PATCH 2/3] Regenerate docs --- docs/object.md | 6 +---- docs/service.md | 67 ++++++++++++++++++++++++++++++++++++++----------- docs/session.md | 59 +++---------------------------------------- 3 files changed, 57 insertions(+), 75 deletions(-) diff --git a/docs/object.md b/docs/object.md index 4ec32fc..27e4bcf 100644 --- a/docs/object.md +++ b/docs/object.md @@ -149,7 +149,6 @@ calculated for XORed data. | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Token | [session.Token](#session.Token) | | Token with session public key and user's signature | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -228,7 +227,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| Raw | [bool](#bool) | | Raw is the request flag of a physically stored representation of an object | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -256,7 +254,6 @@ in distributed system. | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | FullHeaders | [bool](#bool) | | FullHeaders can be set true for extended headers in the object | -| Raw | [bool](#bool) | | Raw is the request flag of a physically stored representation of an object | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -296,7 +293,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Object | [Object](#object.Object) | | Object with at least container id and owner id fields | -| Token | [session.Token](#session.Token) | | Token with session public key and user's signature | | CopiesNumber | [uint32](#uint32) | | Number of the object copies to store within the RPC call (zero is processed according to the placement rules) | @@ -378,7 +374,7 @@ in distributed system. | UserHeader | [UserHeader](#object.UserHeader) | | UserHeader is a set of KV headers defined by user | | Transform | [Transform](#object.Transform) | | Transform defines transform operation (e.g. payload split) | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | -| Verify | [session.VerificationHeader](#session.VerificationHeader) | | Verify header that contains session public key and user's signature | +| Token | [service.Token](#service.Token) | | Token header contains token of the session within which the object was created | | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | | PayloadChecksum | [bytes](#bytes) | | PayloadChecksum of actual object's payload | | Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | diff --git a/docs/service.md b/docs/service.md index 90e1bd2..eef1e49 100644 --- a/docs/service.md +++ b/docs/service.md @@ -14,8 +14,9 @@ - Messages - [RequestVerificationHeader](#service.RequestVerificationHeader) - - [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) + - [Token](#service.Token) + - [Token.Info](#service.Token.Info) - [service/verify_test.proto](#service/verify_test.proto) @@ -49,6 +50,7 @@ RequestMetaHeader contains information about request meta headers | TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every NeoFS Node | | Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | | Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | +| Raw | [bool](#bool) | | Raw determines whether the request is raw or not | @@ -88,18 +90,7 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | - - - - -### Message RequestVerificationHeader.Sign - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | -| Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. | +| Token | [Token](#service.Token) | | Token is a token of the session within which the request is sent | @@ -110,11 +101,57 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Sign | [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) | | Sign is a signature and public key of the request. | -| Origin | [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) | | Origin used for requests, when trusted node changes it and re-sign with session key. If session key used for signature request, then Origin should contain public key of user and signed session key. | +| Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | +| Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. | + + + + +### Message Token +User token granting rights for object manipulation + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| TokenInfo | [Token.Info](#service.Token.Info) | | TokenInfo is a grouped information about token | +| Signature | [bytes](#bytes) | | Signature is a signature of session token information | + + + + +### Message Token.Info + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | +| OwnerID | [bytes](#bytes) | | OwnerID is an owner of manipulation object | +| 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 | +| Created | [uint64](#uint64) | | Created is an initial epoch of token lifetime | +| ValidUntil | [uint64](#uint64) | | ValidUntil is a last epoch of token lifetime | +| SessionKey | [bytes](#bytes) | | SessionKey is a public key of session key | + + + +### Token.Info.Verb +Verb is an enumeration of session request types + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Put | 0 | Put refers to object.Put RPC call | +| Get | 1 | Get refers to object.Get RPC call | +| Head | 2 | Head refers to object.Head RPC call | +| Search | 3 | Search refers to object.Search RPC call | +| Delete | 4 | Delete refers to object.Delete RPC call | +| Range | 5 | Range refers to object.GetRange RPC call | +| RangeHash | 6 | RangeHash refers to object.GetRangeHash RPC call | + + diff --git a/docs/session.md b/docs/session.md index ba615c3..4a537e6 100644 --- a/docs/session.md +++ b/docs/session.md @@ -12,13 +12,6 @@ - [CreateResponse](#session.CreateResponse) -- [session/types.proto](#session/types.proto) - - - Messages - - [Token](#session.Token) - - [VerificationHeader](#session.VerificationHeader) - - - [Scalar Value Types](#scalar-value-types) @@ -68,8 +61,8 @@ session key. Session is established during 4-step handshake in one gRPC stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Init | [Token](#session.Token) | | Init is a message to initialize session opening. Carry: owner of manipulation object; ID of manipulation object; token lifetime bounds. | -| Signed | [Token](#session.Token) | | Signed Init message response (Unsigned) from server with user private key | +| Init | [service.Token](#service.Token) | | Init is a message to initialize session opening. Carry: owner of manipulation object; ID of manipulation object; token lifetime bounds. | +| Signed | [service.Token](#service.Token) | | Signed Init message response (Unsigned) from server with user private key | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -82,52 +75,8 @@ session key. Session is established during 4-step handshake in one gRPC stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Unsigned | [Token](#session.Token) | | Unsigned token with token ID and session public key generated on server side | -| Result | [Token](#session.Token) | | Result is a resulting token which can be used for object placing through an trusted intermediary | - - - - - - - - -

Top

- -## session/types.proto - - - - - - - -### Message Token -User token granting rights for object manipulation - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Header | [VerificationHeader](#session.VerificationHeader) | | Header carries verification data of session key | -| OwnerID | [bytes](#bytes) | | OwnerID is an owner of manipulation object | -| FirstEpoch | [uint64](#uint64) | | FirstEpoch is an initial epoch of token lifetime | -| LastEpoch | [uint64](#uint64) | | LastEpoch is a last epoch of token lifetime | -| ObjectID | [bytes](#bytes) | repeated | ObjectID is an object identifier of manipulation object | -| Signature | [bytes](#bytes) | | Signature is a token signature, signed by owner of manipulation object | -| ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| PublicKeys | [bytes](#bytes) | repeated | PublicKeys associated with owner | - - - - -### Message VerificationHeader - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| PublicKey | [bytes](#bytes) | | PublicKey is a session public key | -| KeySignature | [bytes](#bytes) | | KeySignature is a session public key signature. Signed by trusted side | +| Unsigned | [service.Token](#service.Token) | | Unsigned token with token ID and session public key generated on server side | +| Result | [service.Token](#service.Token) | | Result is a resulting token which can be used for object placing through an trusted intermediary | From 4ac17201b7c72e6621cad6c0955b738c28dba21b Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 28 Apr 2020 13:09:18 +0300 Subject: [PATCH 3/3] Resolve update conflicts --- object/extensions.go | 15 ----- object/service_test.go | 4 +- object/types.go | 16 ++--- object/utils.go | 4 +- object/verification.go | 4 +- object/verification_test.go | 18 ++--- service/alias.go | 14 ++++ service/verify.go | 30 +-------- service/verify_test.go | 19 ++---- session/service.go | 15 +---- session/store.go | 17 +++-- session/store_test.go | 95 +------------------------- session/types.go | 130 ++---------------------------------- 13 files changed, 61 insertions(+), 320 deletions(-) create mode 100644 service/alias.go diff --git a/object/extensions.go b/object/extensions.go index 6e577bd..be755c6 100644 --- a/object/extensions.go +++ b/object/extensions.go @@ -19,21 +19,6 @@ func (m Object) IsLinking() bool { return false } -// VerificationHeader returns verification header if it is presented in extended headers. -func (m Object) VerificationHeader() (*VerificationHeader, error) { - _, vh := m.LastHeader(HeaderType(VerifyHdr)) - if vh == nil { - return nil, ErrHeaderNotFound - } - return vh.Value.(*Header_Verify).Verify, nil -} - -// SetVerificationHeader sets verification header in the object. -// It will replace existing verification header or add a new one. -func (m *Object) SetVerificationHeader(header *VerificationHeader) { - m.SetHeader(&Header{Value: &Header_Verify{Verify: header}}) -} - // Links returns slice of ids of specified link type func (m *Object) Links(t Link_Type) []ID { var res []ID diff --git a/object/service_test.go b/object/service_test.go index 4b02b37..5b7a358 100644 --- a/object/service_test.go +++ b/object/service_test.go @@ -16,8 +16,8 @@ func TestRequest(t *testing.T) { &DeleteRequest{}, &GetRangeRequest{}, &GetRangeHashRequest{}, - MakePutRequestHeader(nil, nil), - MakePutRequestHeader(&Object{}, nil), + MakePutRequestHeader(nil), + MakePutRequestHeader(&Object{}), } types := []RequestType{ diff --git a/object/types.go b/object/types.go index aebb2fc..83b03c7 100644 --- a/object/types.go +++ b/object/types.go @@ -7,7 +7,6 @@ import ( "github.com/gogo/protobuf/proto" "github.com/nspcc-dev/neofs-api-go/internal" "github.com/nspcc-dev/neofs-api-go/refs" - "github.com/nspcc-dev/neofs-api-go/session" ) type ( @@ -19,9 +18,6 @@ type ( // Address is a type alias of object Address. Address = refs.Address - // VerificationHeader is a type alias of session's verification header. - VerificationHeader = session.VerificationHeader - // PositionReader defines object reader that returns slice of bytes // for specified object and data range. PositionReader interface { @@ -60,8 +56,8 @@ const ( TransformHdr // TombstoneHdr is a tombstone header type. TombstoneHdr - // VerifyHdr is a verification header type. - VerifyHdr + // TokenHdr is a token header type. + TokenHdr // HomoHashHdr is a homomorphic hash header type. HomoHashHdr // PayloadChecksumHdr is a payload checksum header type. @@ -175,8 +171,8 @@ func (m Header) typeOf(t isHeader_Value) (ok bool) { _, ok = m.Value.(*Header_Transform) case *Header_Tombstone: _, ok = m.Value.(*Header_Tombstone) - case *Header_Verify: - _, ok = m.Value.(*Header_Verify) + case *Header_Token: + _, ok = m.Value.(*Header_Token) case *Header_HomoHash: _, ok = m.Value.(*Header_HomoHash) case *Header_PayloadChecksum: @@ -205,8 +201,8 @@ func HeaderType(t headerType) Pred { return func(h *Header) bool { _, ok := h.Value.(*Header_Transform); return ok } case TombstoneHdr: return func(h *Header) bool { _, ok := h.Value.(*Header_Tombstone); return ok } - case VerifyHdr: - return func(h *Header) bool { _, ok := h.Value.(*Header_Verify); return ok } + case TokenHdr: + return func(h *Header) bool { _, ok := h.Value.(*Header_Token); return ok } case HomoHashHdr: return func(h *Header) bool { _, ok := h.Value.(*Header_HomoHash); return ok } case PayloadChecksumHdr: diff --git a/object/utils.go b/object/utils.go index 07f0984..33423aa 100644 --- a/object/utils.go +++ b/object/utils.go @@ -4,7 +4,6 @@ import ( "io" "strconv" - "github.com/nspcc-dev/neofs-api-go/session" "github.com/pkg/errors" ) @@ -46,11 +45,10 @@ func (b ByteSize) String() string { // MakePutRequestHeader combines object and session token value // into header of object put request. -func MakePutRequestHeader(obj *Object, token *session.Token) *PutRequest { +func MakePutRequestHeader(obj *Object) *PutRequest { return &PutRequest{ R: &PutRequest_Header{Header: &PutRequest_PutHeader{ Object: obj, - Token: token, }}, } } diff --git a/object/verification.go b/object/verification.go index a00b30a..5694316 100644 --- a/object/verification.go +++ b/object/verification.go @@ -77,7 +77,7 @@ func (m Object) Verify() error { integrity := ih.Value.(*Header_Integrity).Integrity // Prepare structures - _, vh := m.LastHeader(HeaderType(VerifyHdr)) + _, vh := m.LastHeader(HeaderType(TokenHdr)) if vh == nil { _, pkh := m.LastHeader(HeaderType(PublicKeyHdr)) if pkh == nil { @@ -85,7 +85,7 @@ func (m Object) Verify() error { } pubkey = pkh.Value.(*Header_PublicKey).PublicKey.Value } else { - pubkey = vh.Value.(*Header_Verify).Verify.PublicKey + pubkey = vh.Value.(*Header_Token).Token.SessionKey } // Verify signature diff --git a/object/verification_test.go b/object/verification_test.go index b37ec70..004f969 100644 --- a/object/verification_test.go +++ b/object/verification_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/uuid" "github.com/nspcc-dev/neofs-api-go/container" "github.com/nspcc-dev/neofs-api-go/refs" - "github.com/nspcc-dev/neofs-api-go/session" + "github.com/nspcc-dev/neofs-api-go/service" crypto "github.com/nspcc-dev/neofs-crypto" "github.com/nspcc-dev/neofs-crypto/test" "github.com/stretchr/testify/require" @@ -77,11 +77,13 @@ func TestObject_Verify(t *testing.T) { dataPK := crypto.MarshalPublicKey(&sessionkey.PublicKey) signature, err = crypto.Sign(key, dataPK) - vh := &session.VerificationHeader{ - PublicKey: dataPK, - KeySignature: signature, + tok := &service.Token{ + Token_Info: service.Token_Info{ + SessionKey: dataPK, + }, + Signature: signature, } - obj.SetVerificationHeader(vh) + obj.AddHeader(&Header{Value: &Header_Token{Token: tok}}) // validation header is not last t.Run("error validation header is not last", func(t *testing.T) { @@ -90,7 +92,7 @@ func TestObject_Verify(t *testing.T) { }) obj.Headers = obj.Headers[:len(obj.Headers)-2] - obj.SetVerificationHeader(vh) + obj.AddHeader(&Header{Value: &Header_Token{Token: tok}}) obj.SetHeader(&Header{Value: &Header_Integrity{ih}}) t.Run("error invalid header checksum", func(t *testing.T) { @@ -115,7 +117,7 @@ func TestObject_Verify(t *testing.T) { require.NoError(t, err) obj.SetHeader(genIH) - t.Run("correct with vh", func(t *testing.T) { + t.Run("correct with tok", func(t *testing.T) { err = obj.Verify() require.NoError(t, err) }) @@ -123,7 +125,7 @@ func TestObject_Verify(t *testing.T) { pkh := Header{Value: &Header_PublicKey{&PublicKey{ Value: crypto.MarshalPublicKey(&key.PublicKey), }}} - // replace vh with pkh + // replace tok with pkh obj.Headers[len(obj.Headers)-2] = pkh // re-sign object obj.Sign(sessionkey) diff --git a/service/alias.go b/service/alias.go new file mode 100644 index 0000000..6c22ece --- /dev/null +++ b/service/alias.go @@ -0,0 +1,14 @@ +package service + +import ( + "github.com/nspcc-dev/neofs-api-go/refs" +) + +// TokenID is type alias of UUID ref. +type TokenID = refs.UUID + +// OwnerID is type alias of OwnerID ref. +type OwnerID = refs.OwnerID + +// Address is type alias of Address ref. +type Address = refs.Address diff --git a/service/verify.go b/service/verify.go index 9687032..ade13ef 100644 --- a/service/verify.go +++ b/service/verify.go @@ -53,18 +53,6 @@ func (m *RequestVerificationHeader) AddSignature(sig *RequestVerificationHeader_ m.Signatures = append(m.Signatures, sig) } -// SetOwner adds origin (sign and public key) of owner (client) into first signature. -func (m *RequestVerificationHeader) SetOwner(pub *ecdsa.PublicKey, sign []byte) { - if len(m.Signatures) == 0 || pub == nil { - return - } - - m.Signatures[0].Origin = &RequestVerificationHeader_Sign{ - Sign: sign, - Peer: crypto.MarshalPublicKey(pub), - } -} - // CheckOwner validates, that passed OwnerID is equal to present PublicKey of owner. func (m *RequestVerificationHeader) CheckOwner(owner refs.OwnerID) error { if key, err := m.GetOwner(); err != nil { @@ -83,18 +71,6 @@ func (m *RequestVerificationHeader) CheckOwner(owner refs.OwnerID) error { func (m *RequestVerificationHeader) GetOwner() (*ecdsa.PublicKey, error) { if len(m.Signatures) == 0 { return nil, ErrCannotFindOwner - } - - // if first signature contains origin, we should try to validate session key - if m.Signatures[0].Origin != nil { - owner := crypto.UnmarshalPublicKey(m.Signatures[0].Origin.Peer) - if owner == nil { - return nil, ErrCannotLoadPublicKey - } else if err := crypto.Verify(owner, m.Signatures[0].Peer, m.Signatures[0].Origin.Sign); err != nil { - return nil, errors.Wrap(err, "could not verify session token") - } - - return owner, nil } else if key := crypto.UnmarshalPublicKey(m.Signatures[0].Peer); key != nil { return key, nil } @@ -128,10 +104,8 @@ func newSignature(key *ecdsa.PrivateKey, data []byte) (*RequestVerificationHeade } return &RequestVerificationHeader_Signature{ - RequestVerificationHeader_Sign: RequestVerificationHeader_Sign{ - Sign: sign, - Peer: crypto.MarshalPublicKey(&key.PublicKey), - }, + Sign: sign, + Peer: crypto.MarshalPublicKey(&key.PublicKey), }, nil } diff --git a/service/verify_test.go b/service/verify_test.go index 27491da..ce333aa 100644 --- a/service/verify_test.go +++ b/service/verify_test.go @@ -119,15 +119,13 @@ func TestMaintainableRequest(t *testing.T) { req.TTL-- key := test.DecodeKey(i) - require.NoError(t, SignRequestHeader(key, req)) // sign first key (session key) by owner key if i == 0 { - sign, err := crypto.Sign(owner, crypto.MarshalPublicKey(&key.PublicKey)) - require.NoError(t, err) - - req.SetOwner(&owner.PublicKey, sign) + key = owner } + + require.NoError(t, SignRequestHeader(key, req)) } { // Validate owner @@ -150,17 +148,8 @@ func TestMaintainableRequest(t *testing.T) { require.Equal(t, &owner.PublicKey, pub) } - { // wrong owner: - req.Signatures[0].Origin = nil - - pub, err := req.GetOwner() - require.NoError(t, err) - - require.NotEqual(t, &owner.PublicKey, pub) - } - { // Wrong signatures: - copy(req.Signatures[count-1].Sign, req.Signatures[count-1].Peer) + copy(req.Signatures[count-1].Sign, req.Signatures[count-2].Sign) err := VerifyRequestHeader(req) require.EqualError(t, errors.Cause(err), crypto.ErrInvalidSignature.Error()) } diff --git a/session/service.go b/session/service.go index 182ff7d..367aeb1 100644 --- a/session/service.go +++ b/session/service.go @@ -5,7 +5,6 @@ import ( "crypto/ecdsa" "github.com/nspcc-dev/neofs-api-go/refs" - crypto "github.com/nspcc-dev/neofs-crypto" ) type ( @@ -31,9 +30,9 @@ type ( TokenParams struct { FirstEpoch uint64 LastEpoch uint64 - ObjectID []ObjectID + Address Address OwnerID OwnerID - PublicKeys [][]byte + Verb Verb } ) @@ -46,13 +45,3 @@ func NewInitRequest(t *Token) *CreateRequest { func NewSignedRequest(t *Token) *CreateRequest { return &CreateRequest{Message: &CreateRequest_Signed{Signed: t}} } - -// Sign signs contents of the header with the private key. -func (m *VerificationHeader) Sign(key *ecdsa.PrivateKey) error { - s, err := crypto.Sign(key, m.PublicKey) - if err != nil { - return err - } - m.KeySignature = s - return nil -} diff --git a/session/store.go b/session/store.go index f6a6655..e46afde 100644 --- a/session/store.go +++ b/session/store.go @@ -7,6 +7,7 @@ import ( "sync" "github.com/nspcc-dev/neofs-api-go/refs" + "github.com/nspcc-dev/neofs-api-go/service" crypto "github.com/nspcc-dev/neofs-crypto" ) @@ -48,13 +49,15 @@ func (s *simpleStore) New(p TokenParams) *PToken { t := &PToken{ mtx: new(sync.Mutex), Token: Token{ - ID: tid, - Header: VerificationHeader{PublicKey: crypto.MarshalPublicKey(&key.PublicKey)}, - FirstEpoch: p.FirstEpoch, - LastEpoch: p.LastEpoch, - ObjectID: p.ObjectID, - OwnerID: p.OwnerID, - PublicKeys: p.PublicKeys, + Token_Info: service.Token_Info{ + ID: tid, + OwnerID: p.OwnerID, + Verb: p.Verb, + Address: p.Address, + Created: p.FirstEpoch, + ValidUntil: p.LastEpoch, + SessionKey: crypto.MarshalPublicKey(&key.PublicKey), + }, }, PrivateKey: key, } diff --git a/session/store_test.go b/session/store_test.go index 9ad0e1d..f51fb18 100644 --- a/session/store_test.go +++ b/session/store_test.go @@ -1,96 +1,3 @@ package session -import ( - "crypto/ecdsa" - "crypto/rand" - "testing" - - "github.com/nspcc-dev/neofs-api-go/refs" - crypto "github.com/nspcc-dev/neofs-crypto" - "github.com/stretchr/testify/require" -) - -type testClient struct { - *ecdsa.PrivateKey - OwnerID OwnerID -} - -func (c *testClient) Sign(data []byte) ([]byte, error) { - return crypto.Sign(c.PrivateKey, data) -} - -func newTestClient(t *testing.T) *testClient { - key, err := ecdsa.GenerateKey(defaultCurve(), rand.Reader) - require.NoError(t, err) - - owner, err := refs.NewOwnerID(&key.PublicKey) - require.NoError(t, err) - - return &testClient{PrivateKey: key, OwnerID: owner} -} - -func signToken(t *testing.T, token *PToken, c *testClient) { - require.NotNil(t, token) - token.SetPublicKeys(&c.PublicKey) - - signH, err := c.Sign(token.Header.PublicKey) - require.NoError(t, err) - require.NotNil(t, signH) - - // data is not yet signed - keys := UnmarshalPublicKeys(&token.Token) - require.False(t, token.Verify(keys...)) - - signT, err := c.Sign(token.verificationData()) - require.NoError(t, err) - require.NotNil(t, signT) - - token.AddSignatures(signH, signT) - require.True(t, token.Verify(keys...)) -} - -func TestTokenStore(t *testing.T) { - s := NewSimpleStore() - - oid, err := refs.NewObjectID() - require.NoError(t, err) - - c := newTestClient(t) - require.NotNil(t, c) - pk := [][]byte{crypto.MarshalPublicKey(&c.PublicKey)} - - // create new token - token := s.New(TokenParams{ - ObjectID: []ObjectID{oid}, - OwnerID: c.OwnerID, - PublicKeys: pk, - }) - signToken(t, token, c) - - // check that it can be fetched - t1 := s.Fetch(token.ID) - require.NotNil(t, t1) - require.Equal(t, token, t1) - - // create and sign another token by the same client - t1 = s.New(TokenParams{ - ObjectID: []ObjectID{oid}, - OwnerID: c.OwnerID, - PublicKeys: pk, - }) - - signToken(t, t1, c) - - data := []byte{1, 2, 3} - sign, err := t1.SignData(data) - require.NoError(t, err) - require.Error(t, token.Header.VerifyData(data, sign)) - - sign, err = token.SignData(data) - require.NoError(t, err) - require.NoError(t, token.Header.VerifyData(data, sign)) - - s.Remove(token.ID) - require.Nil(t, s.Fetch(token.ID)) - require.NotNil(t, s.Fetch(t1.ID)) -} +// TODO: write unit tests diff --git a/session/types.go b/session/types.go index 4165291..e56373c 100644 --- a/session/types.go +++ b/session/types.go @@ -2,14 +2,12 @@ package session import ( "crypto/ecdsa" - "encoding/binary" "sync" - "github.com/nspcc-dev/neofs-api-go/chain" "github.com/nspcc-dev/neofs-api-go/internal" "github.com/nspcc-dev/neofs-api-go/refs" + "github.com/nspcc-dev/neofs-api-go/service" crypto "github.com/nspcc-dev/neofs-crypto" - "github.com/pkg/errors" ) type ( @@ -19,6 +17,12 @@ type ( OwnerID = refs.OwnerID // TokenID type alias. TokenID = refs.UUID + // Token type alias + Token = service.Token + // Address type alias + Address = refs.Address + // Verb is Token_Info_Verb type alias + Verb = service.Token_Info_Verb // PToken is a wrapper around Token that allows to sign data // and to do thread-safe manipulations. @@ -55,127 +59,7 @@ const ( ErrInvalidSignature = internal.Error("invalid signature") ) -// verificationData returns byte array to sign. -// Note: protobuf serialization is inconsistent as -// wire order is unspecified. -func (m *Token) verificationData() (data []byte) { - var size int - if l := len(m.ObjectID); l > 0 { - size = m.ObjectID[0].Size() - data = make([]byte, 16+l*size) - } else { - data = make([]byte, 16) - } - binary.BigEndian.PutUint64(data, m.FirstEpoch) - binary.BigEndian.PutUint64(data[8:], m.LastEpoch) - for i := range m.ObjectID { - copy(data[16+i*size:], m.ObjectID[i].Bytes()) - } - return -} - -// IsSame checks if the passed token is valid and equal to current token -func (m *Token) IsSame(t *Token) error { - switch { - case m.FirstEpoch != t.FirstEpoch: - return ErrWrongFirstEpoch - case m.LastEpoch != t.LastEpoch: - return ErrWrongLastEpoch - case !m.OwnerID.Equal(t.OwnerID): - return ErrWrongOwner - case m.Header.PublicKey == nil: - return ErrEmptyPublicKey - case len(m.ObjectID) != len(t.ObjectID): - return ErrWrongObjectsCount - default: - for i := range m.ObjectID { - if !m.ObjectID[i].Equal(t.ObjectID[i]) { - return errors.Wrapf(ErrWrongObjects, "expect %s, actual: %s", m.ObjectID[i], t.ObjectID[i]) - } - } - } - return nil -} - -// Sign tries to sign current Token data and stores signature inside it. -func (m *Token) Sign(key *ecdsa.PrivateKey) error { - if err := m.Header.Sign(key); err != nil { - return err - } - - s, err := crypto.Sign(key, m.verificationData()) - if err != nil { - return err - } - - m.Signature = s - return nil -} - -// SetPublicKeys sets owner's public keys to the token -func (m *Token) SetPublicKeys(keys ...*ecdsa.PublicKey) { - m.PublicKeys = m.PublicKeys[:0] - for i := range keys { - m.PublicKeys = append(m.PublicKeys, crypto.MarshalPublicKey(keys[i])) - } -} - -// Verify checks if token is correct and signed. -func (m *Token) Verify(keys ...*ecdsa.PublicKey) bool { - if m.FirstEpoch > m.LastEpoch { - return false - } - ownerFromKeys := chain.KeysToAddress(keys...) - if m.OwnerID.String() != ownerFromKeys { - return false - } - - for i := range keys { - if m.Header.Verify(keys[i]) && crypto.Verify(keys[i], m.verificationData(), m.Signature) == nil { - return true - } - } - return false -} - -// AddSignatures adds token signatures. -func (t *PToken) AddSignatures(signH, signT []byte) { - t.mtx.Lock() - - t.Header.KeySignature = signH - t.Signature = signT - - t.mtx.Unlock() -} - // SignData signs data with session private key. func (t *PToken) SignData(data []byte) ([]byte, error) { return crypto.Sign(t.PrivateKey, data) } - -// VerifyData checks if signature of data by token is equal to sign. -func (m *VerificationHeader) VerifyData(data, sign []byte) error { - if crypto.Verify(crypto.UnmarshalPublicKey(m.PublicKey), data, sign) != nil { - return ErrInvalidSignature - } - return nil -} - -// Verify checks if verification header was issued by id. -func (m *VerificationHeader) Verify(keys ...*ecdsa.PublicKey) bool { - for i := range keys { - if crypto.Verify(keys[i], m.PublicKey, m.KeySignature) == nil { - return true - } - } - return false -} - -// UnmarshalPublicKeys returns unmarshal public keys from the token -func UnmarshalPublicKeys(t *Token) []*ecdsa.PublicKey { - r := make([]*ecdsa.PublicKey, 0, len(t.PublicKeys)) - for i := range t.PublicKeys { - r = append(r, crypto.UnmarshalPublicKey(t.PublicKeys[i])) - } - return r -}