XACML JSON请求中的强制类别

时间:2015-09-11 12:10:46

标签: json rest authorization access-control xacml

我对JSON Profile of XACML 3.0的4个类别有疑问。

当我从PEP向PDP发送JSON请求时,PEP是否总是需要向PDP发送AccessSubject,Resource,Action和Enviroment,或者PEP是否可以在JSON请求中发送任何类别?

这是diagram JSON request

1 个答案:

答案 0 :(得分:2)

JSON请求可能包含任意数量的类别,包括自定义类别。这适用于XACML请求,无论是以JSON还是XML编码(我是此配置文件的编辑器,并为公司工作,Axiomatics,它实现了它。)

JSON配置文件还定义了8个可以使用的默认类别。这些类别名称是:

  • urn:oasis:names:tc:xacml:3.0:attribute-category:resource:Resource
  • urn:oasis:names:tc:xacml:3.0:attribute-category:action:Action
  • urn:oasis:names:tc:xacml:3.0:attribute-category:environment:Environment
  • urn:oasis:names:tc:xacml:1.0:subject-category:access-subject:AccessSubject
  • urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject:RecipientSubject
  • urn:oasis:names:tc:xacml:1.0:subject-category:intermed-subject:IntermediarySubject
  • urn:oasis:names:tc:xacml:1.0:subject-category:codebase:Codebase
  • urn:oasis:names:tc:xacml:1.0:subject-category:reques-machine:RequestingMachine

以下是一个仅使用3个类别并使用其简写符号的示例:

{
    "Request": {
        "AccessSubject": {
            "Attribute": [
                {"AttributeId": "com.acme.user.employeeId",
                 "Value": "Alice"}
            ]},
        "Resource": {
            "Attribute": [
                {"AttributeId": "com.acme.record.recordId",
                    "Value": "123"},
                {"AttributeId": "com.acme.object.objectType",
                 "Value": "record"}
            ]},
        "Action": {
            "Attribute": [
                {"AttributeId": "com.acme.action.actionId",
                 "Value": "view"}
            ]}
    }
}