* Introduce new operation with suffix "IfExists" for all
string and numeric condition operations;
* An operation with "IfExists" suffix specifies the following: if the condition key
is present in the context of the request, process the key as specified in the policy.
If the key is not present, evaluate the condition element as true;
* Change the signature for interface method `Property()`: since it returns two
values - the second indicates whether the property exists;
* This also means that original condition operations for string and number comparison
is slightly changed: if property doesn't exist, then the condition is not evaluated.
Signed-off-by: Airat Arifullin <aarifullin@yadro.com>
It can be false if the first targets allows operation and the last one
returns NoRuleFound.
Found by @mbiryukova.
Introduced in #86.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
So, it's sunday evening and I am sitting on-call trying to debug strange
node behaviour. It took me 3 whole minutes to understand the code being
changed: it accumulates bools in slices, even though no slice is needed;
it uses subtle condition from the first loop to make decision in the
second one, and finally it uses named return values.
In this commit we remove the slice and the second loop, because why not.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
Make it possible to execute fuzz tests with different backend, such as
go-fuzz which supports coverage collection.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
* Make `ListMorphRuleChains` methods use `commonclient.ReadIteratorItems`.
* Introduce `ContractStorageActor` interface.
* Iterators are used because listing by `ListChainsByPrefix` may cause
stack overflow from neo-go side (len(items) > 1024).
Signed-off-by: Airat Arifullin <aarifullin@yadro.com>
We must be able to read s3 multipart object from storage
(to find out the parts it consists of)
to fully delete such multipart object
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
We have to add native:PutObject when want to delete object
because of tombstone must be created (it's a put operation)
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
* Update frostfs-contract package version in go.mod.
* Extend MorphRuleChainStorage interface with ListTargetsIterator and
introduce its implementation.
* Check targets in inmemory implementation unit-tests.
Signed-off-by: Airat Arifullin <aarifullin@yadro.com>
* Implement MorphRuleChainStorageReader interface to make
possible to read from Policy contract without wallets.
Signed-off-by: Airat Arifullin <aarifullin@yadro.com>
* Split MorphRuleChainStorage interface by moving read-only
methods to a separate interface MorphRuleChainStorageReader.
Signed-off-by: Airat Arifullin <aarifullin@yadro.com>