Skip to content

Commit

Permalink
*: apply buf format
Browse files Browse the repository at this point in the history
No functional changes.

Signed-off-by: Roman Khimov <[email protected]>
  • Loading branch information
roman-khimov committed Dec 23, 2024
1 parent 826a848 commit 1c33ecf
Show file tree
Hide file tree
Showing 23 changed files with 384 additions and 376 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ doc:
--proto_path=.:/usr/local/include \
--doc_out=proto-docs/ $${f}/*.proto; \
done

.PHONY: format
format:
buf format -w
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ This repository contains:
- protocol buffers packages
- [auto-generated docs](proto-docs) for protocol buffers

To perform linting and formatting buf is required, see https://buf.build/.

## Contributing

Feel free to contribute to this project after reading the [contributing
Expand Down
8 changes: 4 additions & 4 deletions accounting/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ syntax = "proto3";

package neo.fs.v2.accounting;

option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting";
option csharp_namespace = "Neo.FileStorage.API.Accounting";

import "accounting/types.proto";
import "refs/types.proto";
import "session/types.proto";

option csharp_namespace = "Neo.FileStorage.API.Accounting";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting";

// Accounting service provides methods for interaction with FS chain via
// other NeoFS nodes to get information about the account balance. Deposit and
// Withdraw operations can't be implemented here, as they require Mainnet NeoFS
Expand All @@ -21,7 +21,7 @@ service AccountingService {
// - **OK** (0, SECTION_SUCCESS):
// balance has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
rpc Balance (BalanceRequest) returns (BalanceResponse);
rpc Balance(BalanceRequest) returns (BalanceResponse);
}

// BalanceRequest message
Expand Down
2 changes: 1 addition & 1 deletion accounting/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package neo.fs.v2.accounting;

option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting";
option csharp_namespace = "Neo.FileStorage.API.Accounting";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting";

// Standard floating point data type can't be used in NeoFS due to inexactness
// of the result when doing lots of small number operations. To solve the lost
Expand Down
40 changes: 20 additions & 20 deletions acl/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ syntax = "proto3";

package neo.fs.v2.acl;

option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl/grpc;acl";
option csharp_namespace = "Neo.FileStorage.API.Acl";

import "refs/types.proto";

option csharp_namespace = "Neo.FileStorage.API.Acl";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl/grpc;acl";

// Target role of the access control rule in access control list.
enum Role {
// Unspecified role, default value
Expand Down Expand Up @@ -161,27 +161,27 @@ message EACLRecord {
MatchType match_type = 2 [json_name = "matchType"];

// Name of the Header to use
string key = 3 [json_name="key"];
string key = 3 [json_name = "key"];

// Expected Header Value or pattern to match
string value = 4 [json_name="value"];
string value = 4 [json_name = "value"];
}

// List of filters to match and see if rule is applicable
repeated Filter filters = 3 [json_name="filters"];
repeated Filter filters = 3 [json_name = "filters"];

// Target to apply ACL rule. Can be a subject's role class or a list of public
// keys to match.
message Target {
// Target subject's role class
Role role = 1 [json_name="role"];
Role role = 1 [json_name = "role"];

// List of 25-byte accounts to identify target subjects.
// 33-byte public keys are also supported, however, they are deprecated and script hashes should be derived from them.
repeated bytes keys = 2 [json_name="keys"];
repeated bytes keys = 2 [json_name = "keys"];
}
// List of target subjects to apply ACL rule to
repeated Target targets = 4 [json_name="targets"];
repeated Target targets = 4 [json_name = "targets"];
}

// Extended ACL rules table. A list of ACL rules defined additionally to Basic
Expand All @@ -194,10 +194,10 @@ message EACLTable {
neo.fs.v2.refs.Version version = 1 [json_name = "version"];

// Identifier of the container that should use given access control rules
neo.fs.v2.refs.ContainerID container_id = 2 [json_name="containerID"];
neo.fs.v2.refs.ContainerID container_id = 2 [json_name = "containerID"];

// List of Extended ACL rules
repeated EACLRecord records = 3 [json_name="records"];
repeated EACLRecord records = 3 [json_name = "records"];
}

// BearerToken allows to attach signed Extended ACL rules to the request in
Expand All @@ -217,34 +217,34 @@ message BearerToken {
// container. If it contains `container_id` field, bearer token is only
// valid for this specific container. Otherwise, any container of the same owner
// is allowed.
EACLTable eacl_table = 1 [json_name="eaclTable"];
EACLTable eacl_table = 1 [json_name = "eaclTable"];

// `OwnerID` defines to whom the token was issued. It must match the request
// originator's `OwnerID`. If empty, any token bearer will be accepted.
neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"];
neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"];

// Lifetime parameters of the token. Field names taken from
// [rfc7519](https://tools.ietf.org/html/rfc7519).
message TokenLifetime {
// Expiration Epoch
uint64 exp = 1 [json_name="exp"];
uint64 exp = 1 [json_name = "exp"];

// Not valid before Epoch
uint64 nbf = 2 [json_name="nbf"];
uint64 nbf = 2 [json_name = "nbf"];

// Issued at Epoch
uint64 iat = 3 [json_name="iat"];
uint64 iat = 3 [json_name = "iat"];
}
// Token expiration and valid time period parameters
TokenLifetime lifetime = 3 [json_name="lifetime"];
TokenLifetime lifetime = 3 [json_name = "lifetime"];

// Token issuer's user ID in NeoFS. It must equal to the related
// container's owner.
neo.fs.v2.refs.OwnerID issuer = 4 [json_name="issuer"];
neo.fs.v2.refs.OwnerID issuer = 4 [json_name = "issuer"];
}
// Bearer Token body
Body body = 1 [json_name="body"];
Body body = 1 [json_name = "body"];

// Signature of BearerToken body
neo.fs.v2.refs.Signature signature = 2 [json_name="signature"];
neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"];
}
6 changes: 3 additions & 3 deletions audit/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ syntax = "proto3";

package neo.fs.v2.audit;

option go_package = "github.com/nspcc-dev/neofs-api-go/v2/audit/grpc;audit";
option csharp_namespace = "Neo.FileStorage.API.Audit";

import "refs/types.proto";

option csharp_namespace = "Neo.FileStorage.API.Audit";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/audit/grpc;audit";

// DataAuditResult keeps record of conducted Data Audits. The detailed report is
// generated separately.
message DataAuditResult {
Expand Down
10 changes: 5 additions & 5 deletions container/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ syntax = "proto3";

package neo.fs.v2.container;

option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container";
option csharp_namespace = "Neo.FileStorage.API.Container";

import "acl/types.proto";
import "container/types.proto";
import "refs/types.proto";
import "session/types.proto";

option csharp_namespace = "Neo.FileStorage.API.Container";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container";

// `ContainerService` provides API to interact with `Container` smart contract
// in FS chain via other NeoFS nodes. All of those actions can be done
// equivalently by directly issuing transactions and RPC calls to FS chain
Expand Down Expand Up @@ -301,7 +301,7 @@ message SetExtendedACLResponse {
// `SetExtendedACLResponse` has an empty body because the operation is
// asynchronous and the update should be reflected in `Container` smart contract's
// storage after next block is issued in FS chain.
message Body { }
message Body {}

// Body of set extended acl response message.
Body body = 1;
Expand Down Expand Up @@ -404,7 +404,7 @@ message AnnounceUsedSpaceRequest {
message AnnounceUsedSpaceResponse {
// `AnnounceUsedSpaceResponse` has an empty body because announcements are
// one way communication.
message Body { }
message Body {}

// Body of announce used space response message.
Body body = 1;
Expand Down
6 changes: 3 additions & 3 deletions container/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ syntax = "proto3";

package neo.fs.v2.container;

option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container";
option csharp_namespace = "Neo.FileStorage.API.Container";

import "netmap/types.proto";
import "refs/types.proto";

option csharp_namespace = "Neo.FileStorage.API.Container";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container";

// Container is a structure that defines object placement behaviour. Objects can
// be stored only within containers. They define placement rule, attributes and
// access control information. An ID of a container is a 32 byte long SHA256 hash
Expand Down
6 changes: 3 additions & 3 deletions link/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ syntax = "proto3";

package neo.fs.v2.link;

option go_package = "github.com/nspcc-dev/neofs-api-go/v2/link/grpc;link";
option csharp_namespace = "Neo.FileStorage.API.Link";

import "refs/types.proto";

option csharp_namespace = "Neo.FileStorage.API.Link";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/link/grpc;link";

// Link is a payload of helper objects that contain the full list of the split
// chain objects' IDs. It is created only after the whole split chain is known
// and signed. This object is the only object that refers to every "child object"
Expand Down
6 changes: 3 additions & 3 deletions lock/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ syntax = "proto3";

package neo.fs.v2.lock;

option go_package = "github.com/nspcc-dev/neofs-api-go/v2/lock/grpc;lock";
option csharp_namespace = "Neo.FileStorage.API.Lock";

import "refs/types.proto";

option csharp_namespace = "Neo.FileStorage.API.Lock";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/lock/grpc;lock";

// Lock objects protects a list of objects from being deleted. The lifetime of a
// lock object is limited similar to regular objects in
// `__NEOFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch.
Expand Down
Loading

0 comments on commit 1c33ecf

Please sign in to comment.