Examples of PolicyDecisionPoint


Examples of org.apache.cxf.rt.security.xacml.pdp.api.PolicyDecisionPoint

        msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
        String resourceURI = "https://localhost:8080/doubleit";
        msg.put(Message.REQUEST_URI, resourceURI);
        msg.put(SecurityContext.class, sc);
       
        PolicyDecisionPoint pdp = new DummyPDP();
        XACMLAuthorizingInterceptor authorizingInterceptor = new XACMLAuthorizingInterceptor(pdp);
        authorizingInterceptor.handleMessage(msg);
    }
View Full Code Here

Examples of org.apache.cxf.rt.security.xacml.pdp.api.PolicyDecisionPoint

        msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
        String resourceURI = "https://localhost:8080/doubleit";
        msg.put(Message.REQUEST_URI, resourceURI);
        msg.put(SecurityContext.class, sc);
       
        PolicyDecisionPoint pdp = new DummyPDP();
        XACMLAuthorizingInterceptor authorizingInterceptor = new XACMLAuthorizingInterceptor(pdp);
       
        try {
            authorizingInterceptor.handleMessage(msg);
            fail("Failure expected on deny");
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.PolicyDecisionPoint

     * @throws Exception
     */
    @Test
    public void testInteropTestWithXMLRequests() throws Exception {
        assertNotNull("PDPServiceBean should be injected.", pdpServiceBean);
        final PolicyDecisionPoint pdp = pdpServiceBean.getJBossPDP();
        assertNotNull("JBossPDP should be not-null", pdp);
        assertEquals("Case 1 should be deny", XACMLConstants.DECISION_DENY, getDecision(pdp, "scenario2-testcase1-request.xml"));
        assertEquals("Case 2 should be permit", XACMLConstants.DECISION_PERMIT,
                getDecision(pdp, "scenario2-testcase2-request.xml"));
        assertEquals("Case 3 should be permit", XACMLConstants.DECISION_PERMIT,
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.PolicyDecisionPoint

     * @throws Exception
     */
    @Test
    public void testInteropTestWithObjects() throws Exception {
        assertNotNull("PDPServiceBean should be injected.", pdpServiceBean);
        final PolicyDecisionPoint pdp = pdpServiceBean.getJBossPDP();
        assertNotNull("JBossPDP should be not-null", pdp);
        assertEquals("Case 1 should be deny", XACMLConstants.DECISION_DENY,
                getDecision(pdp, getRequestContext("false", "false", 10)));
        assertEquals("Case 2 should be permit", XACMLConstants.DECISION_PERMIT,
                getDecision(pdp, getRequestContext("false", "false", 1)));
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.PolicyDecisionPoint

      try
      {
         RequestContext requestCtx = util.createXACMLRequest(this.ejbName,
               this.ejbMethod.getName(),this.ejbPrincipal, callerRoles);
        
         PolicyDecisionPoint pdp = util.getPDP(policyRegistration, this.policyContextID);
         if(pdp == null)
            throw new IllegalStateException("PDP is null");
        
         ResponseContext response = pdp.evaluate(requestCtx);
         result = response.getDecision() == XACMLConstants.DECISION_PERMIT ?
               AuthorizationContext.PERMIT : AuthorizationContext.DENY;
      }
      catch(Exception e)
      {
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.PolicyDecisionPoint

   {
      //See if a PDP exists already
      Map<String,Object> contextMap = new HashMap<String,Object>();
      contextMap.put("PDP", "PDP");
     
      PolicyDecisionPoint pdp = null;
      try
      {
         pdp = policyRegistration.getPolicy(contextID,
               PolicyRegistration.XACML, contextMap);
      }
      catch(Exception ignore)
      {  
      }
      if(pdp == null)
      {
         Set<XACMLPolicy> policies = (Set<XACMLPolicy>)policyRegistration.getPolicy(contextID,
               PolicyRegistration.XACML, null);
         if(policies == null)
            throw new IllegalStateException("Missing xacml policy for contextid:" + contextID);
         JBossPolicyLocator jpl = new JBossPolicyLocator(policies);
         JBossPolicySetLocator jpsl = new JBossPolicySetLocator(policies);
         HashSet<PolicyLocator> plset = new HashSet<PolicyLocator>();
         plset.add(jpl);
         plset.add(jpsl);
        
         pdp = new JBossPDP();
         pdp.setPolicies(policies);
         pdp.setLocators(plset);
      }
      return pdp;
   }
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.PolicyDecisionPoint

      {
         RequestContext requestCtx = util.createXACMLRequest(request,callerRoles);
         if(this.policyContextID == null)
           this.policyContextID = PolicyContext.getContextID();
         
         PolicyDecisionPoint pdp = util.getPDP(this.policyRegistration, this.policyContextID);
         ResponseContext response = pdp.evaluate(requestCtx);
         result = response.getDecision() == XACMLConstants.DECISION_PERMIT ?
               AuthorizationContext.PERMIT : AuthorizationContext.DENY;
      }
      catch(Exception e)
      {
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.PolicyDecisionPoint

   private boolean debug = "true".equals(System.getProperty("debug", "false"));

   public void testWebBinding() throws Exception
   {
      PolicyType policyType = constructPolicy();
      PolicyDecisionPoint pdp = new JBossPDP();

      XACMLPolicy policy = PolicyFactory.createPolicy(policyType);
      Set<XACMLPolicy> policies = new HashSet<XACMLPolicy>();
      policies.add(policy);

      pdp.setPolicies(policies);

      //Add the basic locators also
      PolicyLocator policyLocator = new JBossPolicyLocator();
      policyLocator.setPolicies(policies); //Locators need to be given the policies

      Set<PolicyLocator> locators = new HashSet<PolicyLocator>();
      locators.add(policyLocator);
      pdp.setLocators(locators);
      assertNotNull("JBossPDP is != null", pdp);

      Principal p = new Principal()
      {
         public String getName()
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.PolicyDecisionPoint

   public void testPDPForHimss09()
   {
      ClassLoader tcl = Thread.currentThread().getContextClassLoader();
      URL configFile = tcl.getResource("test/config/himss09-interop-config.xml");
      assertNotNull("configFile != null", configFile);
      PolicyDecisionPoint pdp = new JBossPDP(configFile);
      assertNotNull(pdp);
   }
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.PolicyDecisionPoint

   public void testPDPConfig() throws Exception
   {
      ClassLoader tcl = Thread.currentThread().getContextClassLoader();
      URL configFile = tcl.getResource("test/config/interopPolicySetConfig.xml");
      assertNotNull("configFile != null", configFile);
      PolicyDecisionPoint pdp = new JBossPDP(configFile);
      XACMLTestUtil.validateInteropCases(pdp);
   }
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.