2020-04-01 15:40:04 +00:00
|
|
|
syntax = "proto3";
|
2020-08-05 22:10:09 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.acl;
|
2020-08-05 22:10:09 +00:00
|
|
|
|
2020-08-14 18:27:31 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl/grpc;acl";
|
2020-08-12 21:43:51 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.v2.Acl";
|
2020-04-01 15:40:04 +00:00
|
|
|
|
2020-08-05 15:07:56 +00:00
|
|
|
import "refs/types.proto";
|
2020-04-01 15:40:04 +00:00
|
|
|
|
|
|
|
// Target of the access control rule in access control list.
|
|
|
|
enum Target {
|
2020-08-12 21:43:51 +00:00
|
|
|
// Unspecified target, default value.
|
|
|
|
TARGET_UNSPECIFIED= 0;
|
2020-04-01 15:40:04 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// User target rule is applied if sender is the owner of the container.
|
|
|
|
USER = 1;
|
2020-04-01 15:40:04 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// System target rule is applied if sender is the storage node within the
|
|
|
|
// container or inner ring node.
|
|
|
|
SYSTEM = 2;
|
2020-04-01 15:40:04 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// Others target rule is applied if sender is not user or system target.
|
|
|
|
OTHERS = 3;
|
2020-04-01 15:40:04 +00:00
|
|
|
}
|
2020-07-08 07:22:07 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// MatchType is an enumeration of match types.
|
|
|
|
enum MatchType {
|
|
|
|
// Unspecified match type, default value.
|
|
|
|
MATCH_TYPE_UNSPECIFIED = 0;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Return true if strings are equal
|
|
|
|
STRING_EQUAL = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Return true if strings are different
|
|
|
|
STRING_NOT_EQUAL = 2;
|
|
|
|
}
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Operation is an enumeration of operation types.
|
|
|
|
enum Operation {
|
|
|
|
// Unspecified operation, default value.
|
|
|
|
OPERATION_UNSPECIFIED = 0;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Get
|
|
|
|
GET = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Head
|
|
|
|
HEAD = 2;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Put
|
|
|
|
PUT = 3;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Delete
|
|
|
|
DELETE = 4;
|
2020-08-11 09:03:50 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Search
|
|
|
|
SEARCH = 5;
|
2020-08-11 09:03:50 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// GetRange
|
|
|
|
GETRANGE = 6;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// GetRangeHash
|
|
|
|
GETRANGEHASH = 7;
|
|
|
|
}
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Action is an enumeration of EACL actions.
|
|
|
|
enum Action {
|
|
|
|
// Unspecified action, default value.
|
|
|
|
ACTION_UNSPECIFIED = 0;
|
2020-08-11 09:03:50 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Allow action
|
|
|
|
ALLOW = 1;
|
2020-08-11 09:03:50 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Deny action
|
|
|
|
DENY = 2;
|
|
|
|
}
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Header is an enumeration of filtering header types.
|
|
|
|
enum HeaderType {
|
|
|
|
// Unspecified header, default value.
|
|
|
|
HEADER_UNSPECIFIED = 0;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Filter request headers
|
|
|
|
REQUEST = 1;
|
2020-07-08 07:22:07 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Filter object headers
|
|
|
|
OBJECT = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// EACLRecord groups information about extended ACL rule.
|
|
|
|
message EACLRecord {
|
|
|
|
// Operation carries type of operation.
|
|
|
|
Operation operation = 1 [json_name = "Operation"];
|
2020-07-08 07:22:07 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Action carries ACL target action.
|
|
|
|
Action action = 2 [json_name = "Action"];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// FilterInfo groups information about filter.
|
|
|
|
message FilterInfo {
|
|
|
|
// Header carries type of header.
|
|
|
|
HeaderType header = 1 [json_name = "HeaderType"];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// MatchType carries type of match.
|
|
|
|
MatchType match_type = 2 [json_name = "MatchType"];
|
2020-07-08 07:22:07 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// header_name carries name of filtering header.
|
|
|
|
string header_name = 3 [json_name="Name"];
|
2020-07-08 07:22:07 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// header_val carries value of filtering header.
|
|
|
|
string header_val = 4 [json_name="Value"];
|
|
|
|
}
|
2020-07-08 07:22:07 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// filters carries set of filters.
|
|
|
|
repeated FilterInfo filters = 3 [json_name="Filters"];
|
|
|
|
|
|
|
|
// TargetInfo groups information about extended ACL target.
|
|
|
|
message TargetInfo {
|
|
|
|
// target carries target of ACL rule.
|
2020-08-14 19:04:56 +00:00
|
|
|
Target target = 1 [json_name="Role"];
|
2020-08-11 09:03:50 +00:00
|
|
|
|
|
|
|
// key_list carries public keys of ACL target.
|
|
|
|
repeated bytes key_list = 2 [json_name="Keys"];
|
|
|
|
}
|
|
|
|
// targets carries information about extended ACL target list.
|
|
|
|
repeated TargetInfo targets = 4 [json_name="Targets"];
|
2020-07-08 07:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// EACLRecord carries the information about extended ACL rules.
|
|
|
|
message EACLTable {
|
2020-09-02 10:53:44 +00:00
|
|
|
// eACL format version.
|
|
|
|
// Effectively the version of API library used to create eACL Table
|
|
|
|
neo.fs.v2.refs.Version version = 1;
|
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// Carries identifier of the container that should use given
|
|
|
|
// access control rules.
|
2020-09-02 10:53:44 +00:00
|
|
|
neo.fs.v2.refs.ContainerID container_id = 2 [json_name="ContainerID"];
|
2020-08-05 22:10:09 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// Records carries list of extended ACL rule records.
|
2020-09-02 10:53:44 +00:00
|
|
|
repeated EACLRecord records = 3 [json_name="Records"];
|
2020-07-08 07:22:07 +00:00
|
|
|
}
|
2020-08-18 13:41:47 +00:00
|
|
|
|
|
|
|
// BearerToken has information about request ACL rules with limited lifetime
|
|
|
|
message BearerToken {
|
|
|
|
// Bearer Token body
|
|
|
|
message Body {
|
|
|
|
// EACLTable carries table of extended ACL rules
|
|
|
|
EACLTable eacl_table = 1;
|
|
|
|
|
|
|
|
// OwnerID carries identifier of the token owner
|
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 2;
|
|
|
|
|
|
|
|
// Lifetime parameters of the token. Filed names taken from rfc7519.
|
|
|
|
message TokenLifetime {
|
|
|
|
// Expiration Epoch
|
|
|
|
uint64 exp = 1;
|
|
|
|
|
|
|
|
// Not valid before Epoch
|
|
|
|
uint64 nbf = 2;
|
|
|
|
|
|
|
|
// Issued at Epoch
|
|
|
|
uint64 iat = 3;
|
|
|
|
}
|
|
|
|
// Token expiration and valid time period parameters
|
|
|
|
TokenLifetime lifetime = 3;
|
|
|
|
}
|
|
|
|
// Bearer Token body
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Signature of BearerToken body
|
|
|
|
neo.fs.v2.refs.Signature signature = 2;
|
|
|
|
}
|