Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonard Lyubich committed Jul 8, 2020
2 parents 2456521 + 2bf5a0c commit 3cc34a8
Show file tree
Hide file tree
Showing 14 changed files with 2,516 additions and 34 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# Changelog
This is the changelog for NeoFS-API-Go

## [1.2.0] - 2020-07-08

### Added

- Extended ACL types.
- Getters and setters of ```EACLTable``` and its internal messages.
- Wrappers over ```EACLTable``` and its internal messages.
- Getters, setters and marshaling methods of wrappers.

### Changed

- Mechanism for signing requests on the principle of Matryoshka.

### Updated

- NeoFS API v1.1.0 => 1.2.0

## [1.1.0] - 2020-06-18

### Added
Expand Down Expand Up @@ -357,3 +374,4 @@ Initial public release
[0.7.6]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.7.5...v0.7.6
[1.0.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.7.6...v1.0.0
[1.1.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.0.0...v1.1.0
[1.2.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.1.0...v1.2.0
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROTO_VERSION=v1.1.0
PROTO_VERSION=v1.2.0
PROTO_URL=https://github.com/nspcc-dev/neofs-api/archive/$(PROTO_VERSION).tar.gz

B=\033[0;1m
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ can be used for integration with NeoFS.

[neofs-api v1.1.0]: https://github.com/nspcc-dev/neofs-api/releases/tag/v1.1.0
[neofs-api-go v1.1.0]: https://github.com/nspcc-dev/neofs-api-go/releases/tag/v1.1.0
[neofs-api-go v1.1.0] supports [neofs-api v1.1.0]
* [neofs-api-go v1.1.0] supports [neofs-api v1.1.0]

[neofs-api v1.2.0]: https://github.com/nspcc-dev/neofs-api/releases/tag/v1.2.0
[neofs-api-go v1.2.0]: https://github.com/nspcc-dev/neofs-api-go/releases/tag/v1.2.0
* [neofs-api-go v1.2.0] supports [neofs-api v1.2.0]

## Description

Expand Down
93 changes: 93 additions & 0 deletions acl/extended.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package acl

// OperationType is an enumeration of operation types for extended ACL.
type OperationType uint32

// HeaderType is an enumeration of header types for extended ACL.
type HeaderType uint32

// MatchType is an enumeration of match types for extended ACL.
type MatchType uint32

// ExtendedACLAction is an enumeration of extended ACL actions.
type ExtendedACLAction uint32

// Header is an interface of string key-value pair,
type Header interface {
// Must return string identifier of header.
Name() string

// Must return string value of header.
Value() string
}

// TypedHeader is an interface of Header and HeaderType pair.
type TypedHeader interface {
Header

// Must return type of filtered header.
HeaderType() HeaderType
}

// HeaderFilter is an interface of grouped information about filtered header.
type HeaderFilter interface {
// Must return match type of filter.
MatchType() MatchType

TypedHeader
}

// ExtendedACLTarget is an interface of grouped information about extended ACL rule target.
type ExtendedACLTarget interface {
// Must return ACL target type.
Target() Target

// Must return public key list of ACL targets.
KeyList() [][]byte
}

// ExtendedACLRecord is an interface of record of extended ACL rule table.
type ExtendedACLRecord interface {
// Must return operation type of extended ACL rule.
OperationType() OperationType

// Must return list of header filters of extended ACL rule.
HeaderFilters() []HeaderFilter

// Must return target list of extended ACL rule.
TargetList() []ExtendedACLTarget

// Must return action of extended ACL rule.
Action() ExtendedACLAction
}

// ExtendedACLTable is an interface of extended ACL table.
type ExtendedACLTable interface {
// Must return list of extended ACL rules.
Records() []ExtendedACLRecord
}

const (
_ OperationType = iota

// OpTypeGet is an OperationType for object.Get RPC
OpTypeGet

// OpTypePut is an OperationType for object.Put RPC
OpTypePut

// OpTypeHead is an OperationType for object.Head RPC
OpTypeHead

// OpTypeSearch is an OperationType for object.Search RPC
OpTypeSearch

// OpTypeDelete is an OperationType for object.Delete RPC
OpTypeDelete

// OpTypeRange is an OperationType for object.GetRange RPC
OpTypeRange

// OpTypeRangeHash is an OperationType for object.GetRangeHash RPC
OpTypeRangeHash
)
130 changes: 130 additions & 0 deletions acl/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
package acl

const (
_ MatchType = iota

// StringEqual is a MatchType of string equality.
StringEqual

// StringNotEqual is a MatchType of string inequality.
StringNotEqual
)

const (
// ActionUndefined is ExtendedACLAction used to mark value as undefined.
// Most of the tools consider ActionUndefined as incalculable.
// Using ActionUndefined in ExtendedACLRecord is unsafe.
ActionUndefined ExtendedACLAction = iota

// ActionAllow is ExtendedACLAction used to mark an applicability of ACL rule.
ActionAllow

// ActionDeny is ExtendedACLAction used to mark an inapplicability of ACL rule.
ActionDeny
)

const (
_ HeaderType = iota

// HdrTypeRequest is a HeaderType for request header.
HdrTypeRequest

// HdrTypeObjSys is a HeaderType for system headers of object.
HdrTypeObjSys

// HdrTypeObjUsr is a HeaderType for user headers of object.
HdrTypeObjUsr
)

const (
// HdrObjSysNameID is a name of ID field in system header of object.
HdrObjSysNameID = "ID"

// HdrObjSysNameCID is a name of CID field in system header of object.
HdrObjSysNameCID = "CID"

// HdrObjSysNameOwnerID is a name of OwnerID field in system header of object.
HdrObjSysNameOwnerID = "OWNER_ID"

// HdrObjSysNameVersion is a name of Version field in system header of object.
HdrObjSysNameVersion = "VERSION"

// HdrObjSysNamePayloadLength is a name of PayloadLength field in system header of object.
HdrObjSysNamePayloadLength = "PAYLOAD_LENGTH"

// HdrObjSysNameCreatedUnix is a name of CreatedAt.UnitTime field in system header of object.
HdrObjSysNameCreatedUnix = "CREATED_UNIX"

// HdrObjSysNameCreatedEpoch is a name of CreatedAt.Epoch field in system header of object.
HdrObjSysNameCreatedEpoch = "CREATED_EPOCH"

// HdrObjSysLinkPrev is a name of previous link header in extended headers of object.
HdrObjSysLinkPrev = "LINK_PREV"

// HdrObjSysLinkNext is a name of next link header in extended headers of object.
HdrObjSysLinkNext = "LINK_NEXT"

// HdrObjSysLinkChild is a name of child link header in extended headers of object.
HdrObjSysLinkChild = "LINK_CHILD"

// HdrObjSysLinkPar is a name of parent link header in extended headers of object.
HdrObjSysLinkPar = "LINK_PAR"

// HdrObjSysLinkSG is a name of storage group link header in extended headers of object.
HdrObjSysLinkSG = "LINK_SG"
)

// SetMatchType is MatchType field setter.
func (m *EACLRecord_FilterInfo) SetMatchType(v EACLRecord_FilterInfo_MatchType) {
m.MatchType = v
}

// SetHeader is a Header field setter.
func (m *EACLRecord_FilterInfo) SetHeader(v EACLRecord_FilterInfo_Header) {
m.Header = v
}

// SetHeaderName is a HeaderName field setter.
func (m *EACLRecord_FilterInfo) SetHeaderName(v string) {
m.HeaderName = v
}

// SetHeaderVal is a HeaderVal field setter.
func (m *EACLRecord_FilterInfo) SetHeaderVal(v string) {
m.HeaderVal = v
}

// SetTarget is a Target field setter.
func (m *EACLRecord_TargetInfo) SetTarget(v Target) {
m.Target = v
}

// SetKeyList is a KeyList field setter.
func (m *EACLRecord_TargetInfo) SetKeyList(v [][]byte) {
m.KeyList = v
}

// SetOperation is an Operation field setter.
func (m *EACLRecord) SetOperation(v EACLRecord_Operation) {
m.Operation = v
}

// SetAction is an Action field setter.
func (m *EACLRecord) SetAction(v EACLRecord_Action) {
m.Action = v
}

// SetFilters is a Filters field setter.
func (m *EACLRecord) SetFilters(v []*EACLRecord_FilterInfo) {
m.Filters = v
}

// SetTargets is a Targets field setter.
func (m *EACLRecord) SetTargets(v []*EACLRecord_TargetInfo) {
m.Targets = v
}

// SetRecords is a Records field setter.
func (m *EACLTable) SetRecords(v []*EACLRecord) {
m.Records = v
}
Loading

0 comments on commit 3cc34a8

Please sign in to comment.