* Move some helpers from `acl/v2` package to `ape`. Also move errors;
* Introduce `Metadata`, `RequestInfo` types;
* Introduce `RequestInfoExtractor` interface and its implementation.
The extractor's purpose is to extract request info based on request
metadata. It also validates session token;
* Refactor ape service - each handler forms request info and pass
necessary fields to checker.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
`include-names` for `list-subjects` returns error `invalid response subject struct`
because `ListSubjects` returns only subject addresses (see frostfs-contract).
Replace `include-names` with `extended` as now all subject info printed.
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
gopatcH:
```
@@
var d, a expression
@@
-if d < a {
- d = a
-}
-return d
+return max(d, a)
@@
var d, a expression
@@
-if d <= a {
- d = a
-}
-return d
+return max(d, a)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
When we do `object patch` with audit enabled we get several
duplicated entries in logs.
`object patch` request is logged in 2 places:
1. `(*auditPatchStream) CloseAndRecv()` - when the client closes
the request stream or when stream gets aborted.
2. `(*auditPatchStream) Send()` - when stream was NOT aborted.
`Send()` doesn't check if `err != nil` before logging.
It led to to logging on every `Send()` call.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
Added `frostfs-cli object locate` subcommand. It lists info
about shards storing an object.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
Added method `ListShardsForObject` to ControlService and to
StorageEngine. It returns information about shards storing
object on the node.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
By default, gRPC fetches TXT report while resolving a domain.
0914bba6c5/internal/resolver/dns/dns_resolver.go (L336)
This leads to a hanging dial if DNS is unavailable, even though the host
may be specified in `/etc/hosts` (hello, localhost!).
SDK client for the main API uses these options by default.
Refs TrueCloudLab/frostfs-sdk-go#342
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
When we do `object put` with audit enabled we get several entries
in logs: with and without object id.
`object put` request is logged in 2 places:
1. `(*auditPutStream) CloseAndRecv()` - when the client closes the
request stream or when stream gets aborted.
2. `(*auditPutStream) Send()` - when stream was NOT aborted.
`Send()` does error check for `ErrAbortStream` because if there
is any other error - CloseAndRecv will not be called and there
won't be any audit log about failed request.
It led to logging on every object chunck put, even if `err == nil`.
Added check for `err != nil` in `Send()` to fix it.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
* A client may open stream to server, not send anything and close
the open stream immediatly. This shouldn't cause a panic;
* Return the error if `s.patcher` is uninitialized. Uninitialized
patcher cannot be closed, this causes a panic.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
`multiaddr` is not something an average user knows. Personally, I have
never used it in CLI. On the other hand, we need to connect with TLS quite often,
so it needs to be mentioned in help.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
`newConfig` is actually target config to set config values from source
(which is called `oldConfig`).
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>