github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/protos/common/msp_principal.proto (about)

     1  /*
     2  Copyright IBM Corp. 2016 All Rights Reserved.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8                   http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  
    18  syntax = "proto3";
    19  
    20  option go_package = "github.com/hyperledger/fabric/protos/common";
    21  
    22  package common;
    23  
    24  
    25  // msp_principal.proto contains proto messages defining the generalized
    26  // MSP notion of identity called an MSPPrincipal.  It is used as part of
    27  // the chain configuration, in particular as the identity parameters to
    28  // the configuration.proto file.  This does not represent the MSP
    29  // configuration for a chain, but is understood by MSPs
    30  
    31  // MSPPrincipal aims to represent an MSP-centric set of identities.
    32  // In particular, this structure allows for definition of
    33  //  - a group of identities that are member of the same MSP
    34  //  - a group of identities that are member of the same organization unit
    35  //    in the same MSP
    36  //  - a group of identities that are administering a specific MSP
    37  //  - a specific identity
    38  // Expressing these groups is done given two fields of the fields below
    39  //  - Classification, that defines the type of classification of identities
    40  //    in an MSP this principal would be defined on; Classification can take
    41  //    three values:
    42  //     (i)  ByMSPRole: that represents a classification of identities within
    43  //          MSP based on one of the two pre-defined MSP rules, "member" and "admin"
    44  //     (ii) ByOrganizationUnit: that represents a classification of identities
    45  //          within MSP based on the organization unit an identity belongs to
    46  //     (iii)ByIdentity that denotes that MSPPrincipal is mapped to a single
    47  //          identity/certificate; this would mean that the Principal bytes
    48  //          message
    49  message MSPPrincipal {
    50  
    51      enum Classification {
    52          ROLE = 0;  // Represents the one of the dedicated MSP roles, the
    53          // one of a member of MSP network, and the one of an
    54          // administrator of an MSP network
    55          ORGANIZATION_UNIT = 1; // Denotes a finer grained (affiliation-based)
    56          // groupping of entities, per MSP affiliation
    57          // E.g., this can well be represented by an MSP's
    58          // Organization unit
    59          IDENTITY  = 2;    // Denotes a principal that consists of a single
    60          // identity
    61      }
    62  
    63      // Classification describes the way that one should process
    64      // Principal. An Classification value of "ByOrganizationUnit" reflects
    65      // that "Principal" contains the name of an organization this MSP
    66      // handles. A Classification value "ByIdentity" means that
    67      // "Principal" contains a specific identity. Default value
    68      // denotes that Principal contains one of the groups by
    69      // default supported by all MSPs ("admin" or "member").
    70      Classification principal_classification = 1;
    71  
    72      // Principal completes the policy principal definition. For the default
    73      // principal types, Principal can be either "Admin" or "Member".
    74      // For the ByOrganizationUnit/ByIdentity values of Classification,
    75      // PolicyPrincipal acquires its value from an organization unit or
    76      // identity, respectively.
    77      bytes principal = 2;
    78  }
    79  
    80  
    81  // OrganizationUnit governs the organization of the Principal
    82  // field of a policy principal when a specific organization unity members
    83  // are to be defined within a policy principal.
    84  message OrganizationUnit {
    85  
    86      // MSPIdentifier represents the identifier of the MSP this organization unit
    87      // refers to
    88      string msp_identifier = 1;
    89  
    90      // OrganizationUnitIdentifier defines the organizational unit under the
    91      // MSP identified with MSPIdentifier
    92      string organizational_unit_identifier = 2;
    93  
    94      // CertifiersIdentifier is the hash of certificates chain of trust
    95      // related to this organizational unit
    96      bytes certifiers_identifier = 3;
    97  }
    98  
    99  // MSPRole governs the organization of the Principal
   100  // field of an MSPPrincipal when it aims to define one of the
   101  // two dedicated roles within an MSP: Admin and Members.
   102  message MSPRole {
   103  
   104      // MSPIdentifier represents the identifier of the MSP this principal
   105      // refers to
   106      string msp_identifier = 1;
   107  
   108      enum MSPRoleType {
   109          MEMBER = 0; // Represents an MSP Member
   110          ADMIN  = 1; // Represents an MSP Admin
   111      }
   112  
   113      // MSPRoleType defines which of the available, pre-defined MSP-roles
   114      // an identiy should posess inside the MSP with identifier MSPidentifier
   115      MSPRoleType Role = 2;
   116  
   117  }
   118  
   119  
   120  // TODO: Bring msp.SerializedIdentity from fabric/msp/identities.proto here. Reason below.
   121  // SerializedIdentity represents an serialized version of an identity;
   122  // this consists of an MSP-identifier this identity would correspond to
   123  // and the bytes of the actual identity. A serialized form of
   124  // SerializedIdentity would govern "Principal" field of a PolicyPrincipal
   125  // of classification "ByIdentity".