github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/go/apps/newfileproxy/resourcemanager/resources.proto (about)

     1  // Copyright (c) 2016, Google Inc. All rights reserved.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto2";
    16  package resourcemanager;
    17  
    18  enum ResourceType {
    19    FILE = 1;
    20    DIRECTORY = 2;
    21  }
    22  
    23  message PrincipalInfo {
    24    // Principal name (should match common name in cert, if user, OU if application).
    25    optional string name = 1;
    26    // Signed certificate.
    27    optional bytes cert = 2;
    28  }
    29  
    30  // A combined principal is several principals like application, user, all of
    31  // which have to be authenticated to constitute an authorization.
    32  message CombinedPrincipal {
    33    repeated PrincipalInfo principals = 1;
    34  }
    35  
    36  // Readers and writers can delegate writes.
    37  // Writers to a directory can create and delete files in the directory.
    38  message ResourceInfo {
    39    // Resource name,  e.g. - directory1/directory2/filename.
    40    required string name = 1;
    41    // Always ResourceType.FILE.
    42    optional int32  type = 2;
    43    // Encoded created time.
    44    optional string date_created = 3;
    45    // Encoded modified time.
    46    optional string date_modified = 4;
    47    // Size in bytes.
    48    optional int32 size = 5;
    49    // File encryption and integrity keys.
    50    optional bytes keys = 6;
    51    // List of owners.
    52    repeated CombinedPrincipal owners = 7;
    53    // List of writers.
    54    repeated CombinedPrincipal writers = 8;
    55    // List of readers.
    56    repeated CombinedPrincipal readers = 9;
    57  }
    58  
    59  message ResourceMasterInfo {
    60    // Service name owning resources (files).
    61    optional  string  service_name = 1;
    62    // Directory files are stored.
    63    optional  string  base_directory_name = 2;
    64    // Policy key used to sign user certs, etc.
    65    optional bytes policy_cert = 3;
    66    // Resources.
    67    repeated ResourceInfo resources = 4;
    68  }
    69