[#73] Change JSON field names in acl package

Changing naming style to meet Protobuf and Goggle JSON style guides.

https://google.github.io/styleguide/jsoncstyleguide.xml
https://developers.google.com/protocol-buffers/docs/proto3#json

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-10-19 10:52:02 +03:00 committed by Stanislav Bogatyrev
parent 44d7f7a622
commit 98dab3f354

View file

@ -91,40 +91,40 @@ enum HeaderType {
// Describes a single eACL rule. // Describes a single eACL rule.
message EACLRecord { message EACLRecord {
// NeoFS request Verb to match // NeoFS request Verb to match
Operation operation = 1 [json_name = "Operation"]; Operation operation = 1 [json_name = "operation"];
// Rule execution result. Either allows or denies access if filters match. // Rule execution result. Either allows or denies access if filters match.
Action action = 2 [json_name = "Action"]; Action action = 2 [json_name = "action"];
// Filter to check particular properties of the request or object. // Filter to check particular properties of the request or object.
message Filter { message Filter {
// Define if Object or Request header will be used // Define if Object or Request header will be used
HeaderType header_type = 1 [json_name = "HeaderType"]; HeaderType header_type = 1 [json_name = "headerType"];
// Match operation type // Match operation type
MatchType match_type = 2 [json_name = "MatchType"]; MatchType match_type = 2 [json_name = "matchType"];
// Name of the Header to use // Name of the Header to use
string header_name = 3 [json_name="Name"]; string header_name = 3 [json_name="headerName"];
// Expected Header Value or pattern to match // Expected Header Value or pattern to match
string header_val = 4 [json_name="Value"]; string header_val = 4 [json_name="value"];
} }
// List of filters to match and see if rule is applicable // 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 // Target to apply ACL rule. Can be a subject's role class or a list of public
// keys to match. // keys to match.
message Target { message Target {
// Target subject's role class // Target subject's role class
Role role = 1 [json_name="Role"]; Role role = 1 [json_name="role"];
// List of public keys to identify target subject // List of public keys to identify target subject
repeated bytes key_list = 2 [json_name="Keys"]; repeated bytes keys = 2 [json_name="keys"];
} }
// List of target subjects to apply ACL rule to // 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. Defined a list of ACL rules additionally to Basic // Extended ACL rules table. Defined a list of ACL rules additionally to Basic
@ -137,10 +137,10 @@ message EACLTable {
neo.fs.v2.refs.Version version = 1; neo.fs.v2.refs.Version version = 1;
// Identifier of the container that should use given access control rules // 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 // 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 // BearerToken allows to attach signed Extended ACL rules to the request in
@ -155,30 +155,30 @@ message BearerToken {
message Body { message Body {
// Table of Extended ACL rules to use instead of the ones attached to the // Table of Extended ACL rules to use instead of the ones attached to the
// container // container
EACLTable eacl_table = 1; EACLTable eacl_table = 1 [json_name="eaclTable"];
// `OwnerID` to whom the token was issued. MUST match with the request // `OwnerID` to whom the token was issued. MUST match with the request
// originator's `OwnerID` // originator's `OwnerID`
neo.fs.v2.refs.OwnerID owner_id = 2; neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"];
// Lifetime parameters of the token. Filed names taken from // Lifetime parameters of the token. Filed names taken from
// [rfc7519](https://tools.ietf.org/html/rfc7519). // [rfc7519](https://tools.ietf.org/html/rfc7519).
message TokenLifetime { message TokenLifetime {
// Expiration Epoch // Expiration Epoch
uint64 exp = 1; uint64 exp = 1 [json_name="exp"];
// Not valid before Epoch // Not valid before Epoch
uint64 nbf = 2; uint64 nbf = 2 [json_name="nbf"];
// Issued at Epoch // Issued at Epoch
uint64 iat = 3; uint64 iat = 3 [json_name="iat"];
} }
// Token expiration and valid time period parameters // Token expiration and valid time period parameters
TokenLifetime lifetime = 3; TokenLifetime lifetime = 3 [json_name="lifetime"];
} }
// Bearer Token body // Bearer Token body
Body body = 1; Body body = 1 [json_name="body"];
// Signature of BearerToken body // Signature of BearerToken body
neo.fs.v2.refs.Signature signature = 2; neo.fs.v2.refs.Signature signature = 2 [json_name="signature"];
} }