首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Eclipse的ALFA插件编写XACML 3.0义务

使用Eclipse的ALFA插件编写XACML 3.0义务
EN

Stack Overflow用户
提问于 2014-05-27 04:26:22
回答 1查看 421关注 0票数 1

我有一个带有两个(resource:type)属性和一个(resource:id)属性的XACML请求:

代码语言:javascript
复制
    <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实现这一点

EN

回答 1

Stack Overflow用户

发布于 2014-05-27 04:46:56

首先,请注意,您的XACML请求实际上是一个XACML 2.0请求,而ALFA输出的是一组XACML 3.0策略。所以你会有一个版本不匹配。

其次,在ALFA中,要构建一个包含两个属性的义务,您可以执行以下操作:

代码语言:javascript
复制
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的资源的状态或压力执行操作视图?

您通常希望请求压力,然后独立或作为多个请求请求状态。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23877279

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档