[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ideas about the decision interface



Hi, all

I've put together IDL code (attached) for the decision interface according to
what I understood about the consensus at the conference call we had. 
Resource space is defined as a flat one due to the lack of knowledge on it.

The code looks kind of too long for such simple data structures and the
computational model. It's mostly because of the way exceptions are structured
for inquiries on multiple <resource, operation> pairs.

Let's discuss it over e-mail and during the upcoming conference call hosted by
IBM next Tuesday.

Konstantin
-----------------------------------
Distributed Computing Architect
Baptist Health Systems of South Florida
voice: 305.596.1960 x6469
//File: DfAccessDecision.idl
//
// **********************************************************************
// This file format is supposed to be according to the 
//"OMG IDL Style Guide" doc #ab/98-06-03
// **********************************************************************
// 
#ifndef _DF_ACCESS_DECISION_IDL_
#define _DF_ACCESS_DECISION_IDL_

#include <SecurityLevel2.idl>

#pragma prefix "omg.org"

module DfAccessDecision
{
   // Define Operation
   typedef short Operation;
   const Operation CREATE	= 0;
   const Operation READ		= 1;
   const Operation WRITE	= 2;
   const Operation USE		= 3;
   const Operation DELETE  = 4;
   
   typedef short OperationErrorCode;
   
   // The operation is none of the defined above
   const OperationErrorCode BAD_OPERATION                = 0;
   
   // The operation is valid but is not supported by the facility
   const OperationErrorCode UNSUPPORTED_OPERATION        = 1;
   
   exception OperationError { OperationErrorCode reason;};
   
   // Define Resource
   typedef SecurityLevel2::Opaque Resource;

   typedef short ResourceErrorCode;
   
   // The facility does not have any decision rule about this resource
   const ResourceErrorCode UNSUPPORTED_RESOURCE          = 0;
   
   exception ResourceError { ResourceErrorCode reason; };
   
   // Auxilary structures for obtained authorization decisions on
   // multiple actions
   struct ResourceOperationPair {
      Resource resource,
      Operation operation
   };
   
   typedef sequence<ResourceOperationPair> ResourceOperationList;
   
   enum ActionErrorSource {
      Resource,
      Operation,
      ResourceAndOperation
   };
   
   struct ResourceOperationExceptionInformation {
      ResourceOperationPair action_info,
      // shows what error code below to check
      ActionErrorSource error_source, 
      short resource_error_code,
      short operation_error_code
   };
   
   typedef sequence<ResourceOperationExceptionInformation> ErrorList;
   
   exception MultipleActionsError { ErrorList reasons; };
   
   struct ResourceOperationDecision {
      ResourceOperationPair action_info,
      boolean action_decision
   };
   
   typedef sequence<ResourceOperationDecision> ActionDecisionList;
   
         
   interface Decision
   {
		boolean access_allowed(
		   in SecurityLevel2::CredentialsList cred_list,
         in Resource resource, 
		   in Operation operation, 
		)
		raises (ResourceError, OperationError); //CredentialsError ?
      
      ActionDecisionList multiple_actions_access_allowed(
         in SecurityLevel2::CredentialsList cred_list,
         in ResourceOperationList
      )raises (MultipleActionsError);
      
   };
};
#endif //_DF_ACCESS_DECISION_IDL_