github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/protos/authorization.proto (about)

     1  // Copyright 2017 Intel Corporation
     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  
    16  syntax = "proto3";
    17  option java_multiple_files = true;
    18  option java_package = "sawtooth.sdk.protobuf";
    19  option go_package = "authorization_pb2";
    20  
    21  message ConnectionRequest {
    22    // This is the first message that must be sent to start off authorization.
    23    // The endpoint of the connection.
    24    string endpoint = 1;
    25  }
    26  
    27  enum RoleType {
    28    ROLE_TYPE_UNSET = 0;
    29  
    30    // A shorthand request for asking for all allowed roles.
    31    ALL = 1;
    32  
    33    // Role defining validator to validator communication
    34    NETWORK = 2;
    35  }
    36  
    37  message ConnectionResponse {
    38    // Whether the connection can participate in authorization
    39    enum Status {
    40      STATUS_UNSET = 0;
    41      OK = 1;
    42      ERROR = 2;
    43    }
    44  
    45    //Authorization Type required for the authorization procedure
    46    enum AuthorizationType {
    47      AUTHORIZATION_TYPE_UNSET = 0;
    48      TRUST = 1;
    49      CHALLENGE = 2;
    50    }
    51  
    52    message RoleEntry {
    53      // The role type for this role entry
    54      RoleType role = 1;
    55  
    56      // The Authorization Type required for the above role
    57      AuthorizationType auth_type = 2;
    58    }
    59  
    60    repeated RoleEntry roles = 1;
    61    Status status = 2;
    62  }
    63  
    64  message AuthorizationTrustRequest {
    65    // A set of requested RoleTypes
    66    repeated RoleType roles = 1;
    67    string public_key = 2;
    68  }
    69  
    70  message AuthorizationTrustResponse {
    71    // The actual set the requester has access to
    72    repeated RoleType roles = 1;
    73  }
    74  
    75  message AuthorizationViolation {
    76    // The Role the requester did not have access to
    77    RoleType violation = 1;
    78  }
    79  
    80  message AuthorizationChallengeRequest {
    81    // Empty message sent to request a payload to sign
    82  }
    83  
    84  message AuthorizationChallengeResponse {
    85    // Random payload that the connecting node must sign
    86    bytes payload = 1;
    87  }
    88  
    89  message AuthorizationChallengeSubmit {
    90    // public key of node
    91    string public_key = 1;
    92  
    93    // signature derived from signing the challenge payload
    94    string signature = 3;
    95  
    96    // A set of requested Roles
    97    repeated RoleType roles = 4;
    98  }
    99  
   100  message AuthorizationChallengeResult {
   101    // The approved roles for that connection
   102    repeated RoleType roles = 1;
   103  }