我有一个带有两个(resource:type)属性和一个(resource:id)属性的XACML请求:
<Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os" >
<Resource>
<Attribute AttributeId="resource:type" DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>status</AttributeValue>
</Attribute>
<Attribute AttributeId="resource:type" DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>pressure</AttributeValue>
</Attribute>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>status:of:nariman</AttributeValue>
</Attribute>
</Resource>
<Subject>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>1111</AttributeValue>
</Attribute>
</Subject>
<Action>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id">
<AttributeValue>view</AttributeValue>
</Attribute>
</Action>
</Request> 我想定义一个义务,上面的每个资源属性都有三个对应的义务表达式。如何使用ALFA实现这一点
发布于 2014-05-27 04:46:56
首先,请注意,您的XACML请求实际上是一个XACML 2.0请求,而ALFA输出的是一组XACML 3.0策略。所以你会有一个版本不匹配。
其次,在ALFA中,要构建一个包含两个属性的义务,您可以执行以下操作:
namespace stackoverflow{
attribute subjectId{
category = subjectCat
id = "urn:oasis:names:tc:xacml:1.0:subject:subject-id"
type = string
}
attribute resourceId{
category = resourceCat
id = "urn:oasis:names:tc:xacml:1.0:resource:resource-id"
type = string
}
attribute resourceType{
category = resourceCat
id = "resource:type"
type = string
}
attribute actionId{
category = actionCat
id = "urn:oasis:names:tc:xacml:1.0:action:action-id"
type = string
}
obligation displayAttributes = "obligation.displayAttributes"
policy example{
apply firstApplicable
rule example{
permit
on permit{
obligation displayAttributes{
subjectId = subjectId
resourceId = resourceId
resourceType = resourceType
actionId = actionId
}
}
}
}
}顺便说一下,您的XACML请求似乎有一个语义错误。英语的等价物是什么?现在你在问:
用户1111是否可以对id为status: of :nariman的资源的状态或压力执行操作视图?
您通常希望请求压力,然后独立或作为多个请求请求状态。
https://stackoverflow.com/questions/23877279
复制相似问题