Package org.jboss.security.xacml.interfaces

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


        try {
            final RequestContext requestCtx = util.createXACMLRequest(request, role);
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug(toString(requestCtx));
            }
            final ResponseContext response = pdp.evaluate(requestCtx);
            result = response.getDecision() == XACMLConstants.DECISION_PERMIT ? AuthorizationContext.PERMIT
                    : AuthorizationContext.DENY;
        } catch (Exception e) {
            LOGGER.warn("Exception in processing:", e);
        }
        return result;
View Full Code Here


            final RequestContext requestCtx = util.createXACMLRequest(ejbResource.getEjbName(), ejbResource.getEjbMethod(),
                    ejbResource.getPrincipal(), role);
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug(toString(requestCtx));
            }
            final ResponseContext response = pdp.evaluate(requestCtx);
            result = response.getDecision() == XACMLConstants.DECISION_PERMIT ? AuthorizationContext.PERMIT
                    : AuthorizationContext.DENY;
        } catch (Exception e) {
            LOGGER.error("Exception in processing:", e);
            result = AuthorizationContext.DENY;
        }
View Full Code Here

      if (req == null)
         throw new IllegalStateException("Request Context does not contain a request");

      ResponseCtx resp = pdp.evaluate(req);

      ResponseContext response = RequestResponseContextFactory.createResponseContext();
      response.set(XACMLConstants.RESPONSE_CTX, resp);
      return response;
   }
View Full Code Here

        
         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)
      {
         if(trace)
View Full Code Here

         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)
      {
         if(trace)
View Full Code Here

      {  
         this.bootstrapPDP();
      }
      ResponseCtx resp = policyDecisionPoint.evaluate(req);

      ResponseContext response = RequestResponseContextFactory.createResponseContext();
      response.set(XACMLConstants.RESPONSE_CTX, resp);
      return response;
   }
View Full Code Here

        
         RequestContext requestContext = new JBossRequestContext();
         requestContext.setRequest(requestType);
        
         //pdp evaluation is thread safe
         ResponseContext responseContext = pdp.evaluate(requestContext)
        
         ResponseType responseType = new ResponseType();
         ResultType resultType = responseContext.getResult();
         responseType.getResult().add(resultType);

         XACMLAuthzDecisionStatementType xacmlStatement = SOAPSAMLXACMLUtil.createXACMLAuthzDecisionStatementType();
         xacmlStatement.setRequest(requestType);
         xacmlStatement.setResponse(responseType);
View Full Code Here

      <!-- **************************************************************** -->
      <!-- Test case 4-01: Should be Perm + Obl: Dr A has emergency perm   -->
      <!-- **************************************************************** -->
      */
      String file = "XacmlRequest-04-01.xml";
      ResponseContext response = getResponse(file);
      ResultType result = response.getResult();
      ObligationsType obligationsType = result.getObligations();
      assertTrue("1 obligation", obligationsType.getObligation().size() == 1);
      validateCase(response, XACMLConstants.DECISION_PERMIT)
   }
View Full Code Here

        <!-- **************************************************************** -->
        <!-- Test case 04-02: Should be Perm + Obl: Dr A has emergency perm  -->
        <!-- **************************************************************** -->
       */
      String file = "XacmlRequest-04-02.xml";
      ResponseContext response = getResponse(file);
      ResultType result = response.getResult();
      ObligationsType obligationsType = result.getObligations();
      assertTrue("1 obligation", obligationsType.getObligation().size() == 1);
     
      validateCase( response,   XACMLConstants.DECISION_PERMIT);
   }
View Full Code Here

      !-- **************************************************************** -->
      <!-- Test case 4-03: Should be Deny+Obl: DrA has pea-001 but UBA set   -->
      <!-- **************************************************************** -->
       */
      String file = "XacmlRequest-04-03.xml";
      ResponseContext response = getResponse(file);
      ResultType result = response.getResult();
      ObligationsType obligationsType = result.getObligations();
      assertTrue("1 obligation", obligationsType.getObligation().size() == 1);
      validateCase(response, XACMLConstants.DECISION_DENY)
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.interfaces.ResponseContext

Copyright © 2018 www.massapicom. 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.