2017-05-01 5 views
0

私は、複数の決定プロファイル(MDP)要素を持つXML XACMLリクエストを持っています。同じタイプの複数のカテゴリと、オプションでMultipleRequest要素です。 この要求はWso2 IS 5.3.0で正しく機能します。Wso2 Identity ServerはJSON経由でMDPをサポートしていますか?

しかし、私はJSON形式でこの要求を書き換えるしようとした場合、予想通り、XACML JSONプロファイルに対応し、それを処理しませWso2IS:

  • 私はMultiRequestオブジェクトを使用する場合、サーバーがエラー(40020)「リクエスト解析を返します。私はちょうど配列として、いくつかのカテゴリオブジェクトを列挙すると、例外」
  • 、明示的なMultiRequestせずに、サーバーはJSONでシングル決定要求がwso2is 5.3.0で正しく処理これらのカテゴリのいずれかの属性値

を発見していません。

wso2isのこの動作は現在の設計上の制限のために予期されていますか、間違ったJSON MDP要求を書きましたか?

マイXMLのXACML要求(明示的MultiRequestの場合):

<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" 
    CombinedDecision="false" 
    ReturnPolicyIdList="true"> 

    <Attributes id="res-01" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"> 
     <Attribute AttributeId="urn:mytest:testapp:xacml:resource:property-chain:Lesson.Id" IncludeInResult="true"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">lesson_834570716063946</AttributeValue> 
     </Attribute> 
     <Attribute AttributeId="urn:mytest:testapp:xacml:resource:property-chain:Lesson.Uot.ResponsiblePersonId" IncludeInResult="false"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">person_456454345234353</AttributeValue> 
     </Attribute> 
    </Attributes> 

    <Attributes id="res-02" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"> 
     <Attribute AttributeId="urn:mytest:testapp:xacml:resource:property-chain:Lesson.Id" IncludeInResult="true"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">lesson_8345707160639460</AttributeValue> 
     </Attribute> 
     <Attribute AttributeId="urn:mytest:testapp:xacml:resource:property-chain:Lesson.Uot.ResponsiblePersonId" IncludeInResult="false"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">person_4564543452343530</AttributeValue> 
     </Attribute> 
    </Attributes> 

    <Attributes id="res-03" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"> 
     <Attribute AttributeId="urn:mytest:testapp:xacml:resource:property-chain:Lesson.Id" IncludeInResult="true"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">lesson_834570716063947</AttributeValue> 
     </Attribute> 
     <Attribute AttributeId="urn:mytest:testapp:xacml:resource:property-chain:Lesson.Uot.ResponsiblePersonId" IncludeInResult="false"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">person_456454345234353</AttributeValue> 
     </Attribute> 
    </Attributes> 

    <Attributes id="subj" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"> 
     <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" IncludeInResult="false"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">uid_1234567</AttributeValue> 
     </Attribute> 
     <Attribute AttributeId="urn:mytest:testapp:xacml:subject:person-id" IncludeInResult="false"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">person_456454345234353</AttributeValue> 
     </Attribute> 
     <Attribute AttributeId="urn:mytest:testapp:xacml:subject:permissions:LessonOperationsOnMyOwnUots-enabled" IncludeInResult="false"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#boolean">true</AttributeValue> 
     </Attribute> 
    </Attributes> 

    <Attributes id="act-01" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action"> 
     <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Courses.EditLesson</AttributeValue> 
     </Attribute> 
    </Attributes> 

    <Attributes id="act-02" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action"> 
     <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true"> 
     <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Courses.EditLesson</AttributeValue> 
     </Attribute> 
    </Attributes> 

    <MultiRequests> 
     <RequestReference> 
      <AttributesReference ReferenceId="subj"/> 
      <AttributesReference ReferenceId="act-01"/> 
      <AttributesReference ReferenceId="res-01"/> 
     </RequestReference> 
     <RequestReference> 
      <AttributesReference ReferenceId="subj"/> 
      <AttributesReference ReferenceId="act-01"/> 
      <AttributesReference ReferenceId="res-02"/> 
     </RequestReference> 
     <RequestReference> 
      <AttributesReference ReferenceId="subj"/> 
      <AttributesReference ReferenceId="act-02"/> 
      <AttributesReference ReferenceId="res-03"/> 
     </RequestReference> 
    </MultiRequests> 

</Request> 

マイJSON XACML要求:

{ 
    "Request": { 
     "CombinedDecision": false, 
     "ReturnPolicyIdList": true, 

     "Category": [ 
      { 
       "Id": "res-01", 
       "CategoryId": "urn:oasis:names:tc:xacml:3.0:attribute-category:resource", 
       "Attribute": [ 
        { 
         "AttributeId": "urn:mytest:testapp:xacml:resource:property-chain:Lesson.Id", 
         "Value": "lesson_834570716063946" 
        }, 
        { 
         "AttributeId": "urn:mytest:testapp:xacml:resource:property-chain:Lesson.Uot.ResponsiblePersonId", 
         "Value": "person_456454345234353" 
        } 
       ] 
      }, 
      { 
       "Id": "res-02", 
       "CategoryId": "urn:oasis:names:tc:xacml:3.0:attribute-category:resource", 
       "Attribute": [ 
        { 
         "AttributeId": "urn:mytest:testapp:xacml:resource:property-chain:Lesson.Id", 
         "Value": "lesson_8345707160639460" 
        }, 
        { 
         "AttributeId": "urn:mytest:testapp:xacml:resource:property-chain:Lesson.Uot.ResponsiblePersonId", 
         "Value": "person_4564543452343530" 
        } 
       ] 
      } 
     ], 

     "AccessSubject": { 
      "Id": "subj", 
      "Attribute": [ 
       { 
        "AttributeId": "urn:oasis:names:tc:xacml:1.0:subject:subject-id", 
        "Value": "uid_1234567" 
       }, 
       { 
        "AttributeId": "urn:mytest:testapp:xacml:subject:person-id", 
        "Value": "person_456454345234353" 
       }, 
       { 
        "AttributeId": "urn:mytest:testapp:xacml:subject:permissions:LessonOperationsOnMyOwnUots-enabled", 
        "DataType": "boolean", 
        "Value": true 
       } 
      ] 
     }, 

     "Action": { 
      "Id": "act-01", 
      "Attribute": [ 
       { 
        "AttributeId": "urn:oasis:names:tc:xacml:1.0:action:action-id", 
        "Value": "Courses.CreateLesson" 
       } 
      ] 
     }, 

     "MultiRequests": { 
      "RequestReference": [ 
       { 
        "ReferenceId": ["res-01","act-01","subj"] 
       }, 
       { 
        "ReferenceId": ["res-02","act-01","subj"] 
       } 
      ] 
     }  
    } 
} 

答えて

0

短い答えは、あなたのテストに基づいて、いや、それはないです。

私はあなたのXACMLリクエストをAxiomatics Policy Serverに対してテストしましたが正常に動作します。 JSON形式のレスポンスは次のとおりです。

{ 
    "Response":[ 
     { 
      "Decision":"NotApplicable", 
      "Status":{ 
       "StatusCode":{ 
        "Value":"urn:oasis:names:tc:xacml:1.0:status:ok", 
        "StatusCode":{ 
         "Value":"urn:oasis:names:tc:xacml:1.0:status:ok" 
        } 
       } 
      }, 
      "PolicyIdentifierList":{ 

      } 
     }, 
     { 
      "Decision":"NotApplicable", 
      "Status":{ 
       "StatusCode":{ 
        "Value":"urn:oasis:names:tc:xacml:1.0:status:ok", 
        "StatusCode":{ 
         "Value":"urn:oasis:names:tc:xacml:1.0:status:ok" 
        } 
       } 
      }, 
      "PolicyIdentifierList":{ 

      } 
     } 
    ] 
} 
関連する問題