Examples of AttributeValueType


Examples of org.jboss.security.xacml.core.model.context.AttributeValueType

      AttributeType attributeType = new AttributeType();
      attributeType.setAttributeId(attrID);
      attributeType.setDataType(dataType)
      if(issuer != null)
         attributeType.setIssuer(issuer);
      AttributeValueType avt = new AttributeValueType();
      avt.getContent().add(value);
      attributeType.getAttributeValue().add(avt);
      return attributeType;
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.context.AttributeValueType

        env.getAttribute().add(attFacility);
        return env;
    }

    private AttributeValueType createAttributeValueType(String value) {
        AttributeValueType avt = new AttributeValueType();
        avt.getContent().add(value);
        return avt;
    }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.AttributeValueType

      return adt;
   }

   private static AttributeValueType getBareAttributeValueType(Object value, String dataType)
   {
      AttributeValueType avt = new AttributeValueType();
      avt.setDataType(dataType);
      avt.getContent().add(value);
      return avt;
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.AttributeValueType

      permitRuleApplyType.setFunctionId(XACMLConstants.FUNCTION_STRING_IS_IN);

      SubjectAttributeDesignatorType sadt = PolicyAttributeFactory.createSubjectAttributeDesignatorType(
            XACMLConstants.ATTRIBUTEID_ROLE, XMLSchemaConstants.DATATYPE_STRING, null, false, null);
      JAXBElement<SubjectAttributeDesignatorType> sadtElement = objectFactory.createSubjectAttributeDesignator(sadt);
      AttributeValueType avt = PolicyAttributeFactory.createStringAttributeType("developer");
      JAXBElement<AttributeValueType> jaxbAVT = objectFactory.createAttributeValue(avt);
      permitRuleApplyType.getExpression().add(jaxbAVT);
      permitRuleApplyType.getExpression().add(sadtElement);

      permitRuleConditionType.setExpression(objectFactory.createApply(permitRuleApplyType));
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.AttributeValueType

      return adt;
   }

   private static AttributeValueType getBareAttributeValueType(Object value, String dataType)
   {
      AttributeValueType avt = new AttributeValueType();
      avt.setDataType(dataType);
      avt.getContent().add(value);
      return avt;
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.policy.AttributeValueType

      return adt;
   }
  
   private static AttributeValueType getBareAttributeValueType(Object value, String dataType)
   {
      AttributeValueType avt = new AttributeValueType();
      avt.setDataType(dataType);
      avt.getContent().add(value);
      return avt;
   }
View Full Code Here

Examples of org.opensaml.xacml.ctx.AttributeValueType

    @org.junit.Test
    public void testCreateXACMLRequest() throws Exception {
        Document doc = docBuilder.newDocument();
       
        // Subject
        AttributeValueType subjectIdAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "alice-user@apache.org"
            );
        AttributeType subjectIdAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ID,
                    XACMLConstants.RFC_822_NAME,
                    null,
                    Collections.singletonList(subjectIdAttributeValue)
            );
       
        AttributeValueType subjectGroupAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "manager"
            );
        AttributeType subjectGroupAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ROLE,
                    XACMLConstants.XS_ANY_URI,
                    "admin-user@apache.org",
                    Collections.singletonList(subjectGroupAttributeValue)
            );
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        attributes.add(subjectIdAttribute);
        attributes.add(subjectGroupAttribute);
        SubjectType subject = RequestComponentBuilder.createSubjectType(attributes, null);
       
        // Resource
        AttributeValueType resourceAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "{http://www.example.org/contract/DoubleIt}DoubleIt"
            );
        AttributeType resourceAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.RESOURCE_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(resourceAttributeValue)
            );
        attributes.clear();
        attributes.add(resourceAttribute);
        ResourceType resource = RequestComponentBuilder.createResourceType(attributes, null);
       
        // Action
        AttributeValueType actionAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "execute"
            );
        AttributeType actionAttribute =
            RequestComponentBuilder.createAttributeType(
View Full Code Here

Examples of org.opensaml.xacml.ctx.AttributeValueType

    @org.junit.Test
    public void testEnvironment() throws Exception {
        Document doc = docBuilder.newDocument();
       
        // Subject
        AttributeValueType subjectIdAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "alice-user@apache.org"
            );
        AttributeType subjectIdAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ID,
                    XACMLConstants.RFC_822_NAME,
                    null,
                    Collections.singletonList(subjectIdAttributeValue)
            );
       
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        attributes.add(subjectIdAttribute);
        SubjectType subject = RequestComponentBuilder.createSubjectType(attributes, null);
       
        // Resource
        AttributeValueType resourceAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "{http://www.example.org/contract/DoubleIt}DoubleIt"
            );
        AttributeType resourceAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.RESOURCE_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(resourceAttributeValue)
            );
        attributes.clear();
        attributes.add(resourceAttribute);
        ResourceType resource = RequestComponentBuilder.createResourceType(attributes, null);
       
        // Action
        AttributeValueType actionAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "execute"
            );
        AttributeType actionAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.ACTION_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(actionAttributeValue)
            );
        attributes.clear();
        attributes.add(actionAttribute);
        ActionType action = RequestComponentBuilder.createActionType(attributes);
       
        // Environment
        DateTime dateTime = new DateTime();
        AttributeValueType environmentAttributeValue =
            RequestComponentBuilder.createAttributeValueType(dateTime.toString());
        AttributeType environmentAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.CURRENT_DATETIME,
                    XACMLConstants.XS_DATETIME,
View Full Code Here

Examples of org.opensaml.xacml.ctx.AttributeValueType

        String issuer = getIssuer(message);
        String actionToUse = getAction(message);
       
        // Subject
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        AttributeValueType subjectIdAttributeValue =
            RequestComponentBuilder.createAttributeValueType(principal.getName());
        AttributeType subjectIdAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ID,
                    XACMLConstants.XS_STRING,
                    issuer,
                    Collections.singletonList(subjectIdAttributeValue)
            );
        attributes.add(subjectIdAttribute);
       
        if (roles != null) {
            List<AttributeValueType> roleAttributes = new ArrayList<AttributeValueType>();
            for (String role : roles) {
                if (role != null) {
                    AttributeValueType subjectRoleAttributeValue =
                        RequestComponentBuilder.createAttributeValueType(role);
                    roleAttributes.add(subjectRoleAttributeValue);
                }
            }
           
            if (!roleAttributes.isEmpty()) {
                AttributeType subjectRoleAttribute =
                    RequestComponentBuilder.createAttributeType(
                            XACMLConstants.SUBJECT_ROLE,
                            XACMLConstants.XS_ANY_URI,
                            issuer,
                            roleAttributes
                    );
                attributes.add(subjectRoleAttribute);
            }
        }
        SubjectType subjectType = RequestComponentBuilder.createSubjectType(attributes, null);
       
        // Resource
        ResourceType resourceType = createResourceType(message);
       
        // Action
        AttributeValueType actionAttributeValue =
            RequestComponentBuilder.createAttributeValueType(actionToUse);
        AttributeType actionAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.ACTION_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(actionAttributeValue)
            );
        attributes.clear();
        attributes.add(actionAttribute);
        ActionType actionType = RequestComponentBuilder.createActionType(attributes);
       
        // Environment
        attributes.clear();
        if (sendDateTime) {
            DateTime dateTime = new DateTime();
            AttributeValueType environmentAttributeValue =
                RequestComponentBuilder.createAttributeValueType(dateTime.toString());
            AttributeType environmentAttribute =
                RequestComponentBuilder.createAttributeType(
                        XACMLConstants.CURRENT_DATETIME,
                        XACMLConstants.XS_DATETIME,
View Full Code Here

Examples of org.opensaml.xacml.ctx.AttributeValueType

        //
        // Create XACML request
        //
       
        // Subject
        AttributeValueType subjectIdAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "alice-user@apache.org"
            );
        AttributeType subjectIdAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ID,
                    XACMLConstants.RFC_822_NAME,
                    null,
                    Collections.singletonList(subjectIdAttributeValue)
            );
       
        AttributeValueType subjectGroupAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "manager"
            );
        AttributeType subjectGroupAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ROLE,
                    XACMLConstants.XS_ANY_URI,
                    "admin-user@apache.org",
                    Collections.singletonList(subjectGroupAttributeValue)
            );
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        attributes.add(subjectIdAttribute);
        attributes.add(subjectGroupAttribute);
        SubjectType subject = RequestComponentBuilder.createSubjectType(attributes, null);
       
        // Resource
        AttributeValueType resourceAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "{http://www.example.org/contract/DoubleIt}DoubleIt"
            );
        AttributeType resourceAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.RESOURCE_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(resourceAttributeValue)
            );
        attributes.clear();
        attributes.add(resourceAttribute);
        ResourceType resource = RequestComponentBuilder.createResourceType(attributes, null);
       
        // Action
        AttributeValueType actionAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "execute"
            );
        AttributeType actionAttribute =
            RequestComponentBuilder.createAttributeType(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.