From 48c55886509ced36c53916ebf29eb32c47b07ea6 Mon Sep 17 00:00:00 2001 From: alexvanin Date: Thu, 2 Apr 2020 15:15:59 +0300 Subject: [PATCH 1/3] proto: Update proto library to v0.6.0 --- Makefile | 2 +- acl/types.pb.go | Bin 0 -> 3241 bytes acl/types.proto | 27 +++++++++++++++++++++++++++ container/service.pb.go | Bin 61145 -> 60767 bytes container/service.proto | 4 ++-- container/types.pb.go | Bin 23558 -> 13077 bytes container/types.proto | 17 +++-------------- 7 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 acl/types.pb.go create mode 100644 acl/types.proto diff --git a/Makefile b/Makefile index 84583ff9..9b02a6ec 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PROTO_VERSION=v0.5.0 +PROTO_VERSION=v0.6.0 PROTO_URL=https://github.com/nspcc-dev/neofs-api/archive/$(PROTO_VERSION).tar.gz B=\033[0;1m diff --git a/acl/types.pb.go b/acl/types.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..bcbd1998e272c6b48d814cc10e11139b235079c4 GIT binary patch literal 3241 zcma)7O>f&s3_VA`g7C=(Qd=LkV+ZJ=XuCkMyKT{C_fiDGNE+EfWJwr}TDwL6`;w3H zM_cS>bC_s2B;VsBXFQwH%OS;)cAiGOjDo8N8f{9y?bB)2 z>}HaFhS;<(u)~J^@c$>@%G8^)_tA4_{FX+tj)F-b^gh_aI$LL!ltM?op{{RRXS8zt%Ee4yOQPar5(d*Z zbpZ-@+mazVGQ?%JWo4iFa>u%Kopru!YGGvSu4iz+HJ%rCJ~yG@2&sgP5^sE&R+hf7 za6(!+(NXNui(hKXdUHg}$!ttncOLC}F_<|GBcpygVpe5ssVX0Bb)cO!bw>woE(f#+ zY9NvD&~6+7Yio08nzC4JE@LwdvWDR<6nig2^j_!TP4~BT9fKz%$tr6^=62%@kKQi@ zses09EO!MIc%Cw89bxW{cjW?7;1isu+ehLkYs2 zTVmY>h9o-yL;(1B=)B$iZ-~w}PA*(6mssY5R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0U_ZoJeRs{9(>Xltes-!3=VMCC1wxs$slbKUGsKb8QZybSP{2tU6m`F>i=t z!OV+t=4b+$QLW(-Ue(XdG)>LmtT_}?tnSf)aeHr_GmB;@bOhn!9^km&ur!r=wPPH{ zC0caggI$|4Y=;5U2wYp_E&SYgmP3|K>4=s{D55Xh!RYm9-uhmopaC6NT3K`wZPsC| z*nb&dh^rqU0YAU5CQWU&hKdxJ(0zNJXclZqc*CMrQ3RH~=qrC^iG+)9%1v>!3{WK$ z7}F3R!?)^dvAWFG%6m&@CHjU=V}28aexSNhA^#>5|2=7PGNw~ld3Z^`dMsTbpr6C_ zmA}M~jxLLz>ZD&FJ(8vp Date: Thu, 2 Apr 2020 15:16:52 +0300 Subject: [PATCH 2/3] docs: Update docs for neofs-api v0.6.0 --- docs/acl.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++ docs/container.md | 29 ++-------------------- 2 files changed, 64 insertions(+), 27 deletions(-) create mode 100644 docs/acl.md diff --git a/docs/acl.md b/docs/acl.md new file mode 100644 index 00000000..38f328be --- /dev/null +++ b/docs/acl.md @@ -0,0 +1,62 @@ +# Protocol Documentation + + +## Table of Contents + +- [acl/types.proto](#acl/types.proto) + + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## acl/types.proto + + + + + + + + + +### Target +Target of the access control rule in access control list. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | Unknown target, default value. | +| User | 1 | User target rule is applied if sender is the owner of the container. | +| System | 2 | System target rule is applied if sender is the storage node within the container or inner ring node. | +| Others | 3 | Others target rule is applied if sender is not user or system target. | +| PubKey | 4 | PubKey target rule is applied if sender has public key provided in extended ACL. | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/docs/container.md b/docs/container.md index 6693980d..f0188ca7 100644 --- a/docs/container.md +++ b/docs/container.md @@ -21,8 +21,6 @@ - [container/types.proto](#container/types.proto) - Messages - - [AccessControlList](#container.AccessControlList) - - [AccessGroup](#container.AccessGroup) - [Container](#container.Container) @@ -166,7 +164,7 @@ via consensus in inner ring nodes | Capacity | [uint64](#uint64) | | Capacity defines amount of data that can be stored in the container (doesn't used for now). | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | | rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | -| Group | [AccessGroup](#container.AccessGroup) | | Container ACL. | +| BasicACL | [uint32](#uint32) | | BasicACL of the container. | | 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) | @@ -196,29 +194,6 @@ via consensus in inner ring nodes - - -### Message AccessControlList - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| List | [AccessGroup](#container.AccessGroup) | repeated | List of access groups. | - - - - -### Message AccessGroup - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| AccessMode | [uint32](#uint32) | | Group access mode. | -| UserGroup | [bytes](#bytes) | repeated | Group members. | - - ### Message Container @@ -231,7 +206,7 @@ The Container service definition. | Salt | [bytes](#bytes) | | Salt is a nonce for unique container id calculation. | | Capacity | [uint64](#uint64) | | Capacity defines amount of data that can be stored in the container (doesn't used for now). | | Rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | -| List | [AccessControlList](#container.AccessControlList) | | Container ACL. | +| BasicACL | [uint32](#uint32) | | BasicACL with access control rules for owner, system, others and permission bits for bearer token and extended ACL. | From 2fb36f85887cd8e2b9036c150813c43a913fc18f Mon Sep 17 00:00:00 2001 From: alexvanin Date: Thu, 2 Apr 2020 15:44:18 +0300 Subject: [PATCH 3/3] container: Support new `BasicACL` field --- container/service.go | 4 ++++ container/types.go | 20 ++++---------------- container/types_test.go | 22 +--------------------- 3 files changed, 9 insertions(+), 37 deletions(-) diff --git a/container/service.go b/container/service.go index 8eb9ba6e..2f36dc1d 100644 --- a/container/service.go +++ b/container/service.go @@ -31,9 +31,11 @@ func (m *PutRequest) PrepareData() ([]byte, error) { err error buf = new(bytes.Buffer) capBytes = make([]byte, 8) + aclBytes = make([]byte, 4) ) binary.BigEndian.PutUint64(capBytes, m.Capacity) + binary.BigEndian.PutUint32(capBytes, m.BasicACL) if _, err = buf.Write(m.MessageID.Bytes()); err != nil { return nil, errors.Wrap(err, "could not write message id") @@ -45,6 +47,8 @@ func (m *PutRequest) PrepareData() ([]byte, error) { return nil, errors.Wrap(err, "could not marshal placement") } else if _, err = buf.Write(data); err != nil { return nil, errors.Wrap(err, "could not write placement") + } else if _, err = buf.Write(aclBytes); err != nil { + return nil, errors.Wrap(err, "could not write basic acl") } return buf.Bytes(), nil diff --git a/container/types.go b/container/types.go index 21fc0d1e..e358e6d6 100644 --- a/container/types.go +++ b/container/types.go @@ -11,19 +11,6 @@ import ( "github.com/pkg/errors" ) -// AccessMode is a container access mode type. -type AccessMode uint32 - -const ( - // AccessModeRead is a read access mode. - AccessModeRead AccessMode = 1 << iota - // AccessModeWrite is a write access mode. - AccessModeWrite -) - -// AccessModeReadWrite is a read/write container access mode. -const AccessModeReadWrite = AccessModeRead | AccessModeWrite - var ( _ internal.Custom = (*Container)(nil) @@ -31,8 +18,8 @@ var ( emptyOwner = (OwnerID{}).Bytes() ) -// New creates new user container based on capacity, OwnerID and PlacementRules. -func New(cap uint64, owner OwnerID, rules netmap.PlacementRule) (*Container, error) { +// New creates new user container based on capacity, OwnerID, ACL and PlacementRules. +func New(cap uint64, owner OwnerID, acl uint32, rules netmap.PlacementRule) (*Container, error) { if bytes.Equal(owner[:], emptyOwner) { return nil, refs.ErrEmptyOwner } else if cap == 0 { @@ -49,6 +36,7 @@ func New(cap uint64, owner OwnerID, rules netmap.PlacementRule) (*Container, err Salt: UUID(salt), Capacity: cap, Rules: rules, + BasicACL: acl, }, nil } @@ -90,7 +78,7 @@ func NewTestContainer() (*Container, error) { if err != nil { return nil, err } - return New(100, owner, netmap.PlacementRule{ + return New(100, owner, 0xFFFFFFFF, netmap.PlacementRule{ ReplFactor: 2, SFGroups: []netmap.SFGroup{ { diff --git a/container/types_test.go b/container/types_test.go index 1ccc00bb..fddccb36 100644 --- a/container/types_test.go +++ b/container/types_test.go @@ -36,7 +36,7 @@ func TestCID(t *testing.T) { owner, err := refs.NewOwnerID(&key.PublicKey) require.NoError(t, err) - c1, err := New(10, owner, rules) + c1, err := New(10, owner, 0xDEADBEEF, rules) require.NoError(t, err) data, err := proto.Marshal(c1) @@ -55,23 +55,3 @@ func TestCID(t *testing.T) { require.Equal(t, cid1, cid2) }) } - -func TestAccessMode(t *testing.T) { - t.Run("read access to read/write mode", func(t *testing.T) { - require.Equal(t, AccessModeRead, AccessModeReadWrite&AccessModeRead) - }) - - t.Run("write access to read/write mode", func(t *testing.T) { - require.Equal(t, AccessModeWrite, AccessModeReadWrite&AccessModeWrite) - }) - - t.Run("read(write) access to write(read) mode", func(t *testing.T) { - require.Zero(t, AccessModeRead&AccessModeWrite) - }) - - t.Run("access to same mode", func(t *testing.T) { - require.Equal(t, AccessModeWrite, AccessModeWrite&AccessModeWrite) - require.Equal(t, AccessModeRead, AccessModeRead&AccessModeRead) - require.Equal(t, AccessModeReadWrite, AccessModeReadWrite&AccessModeReadWrite) - }) -}