Examples of TransportGuaranteeType


Examples of io.undertow.servlet.api.TransportGuaranteeType

        super.handleRequest(exchange);
    }

    @Override
    protected boolean confidentialityRequired(HttpServerExchange exchange) {
        TransportGuaranteeType transportGuarantee = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getTransportGuarenteeType();

        // TODO - We may be able to add more flexibility here especially with authentication mechanisms such as Digest for
        // INTEGRAL - for now just use SSL.
        return (TransportGuaranteeType.CONFIDENTIAL == transportGuarantee || TransportGuaranteeType.INTEGRAL == transportGuarantee);
    }
View Full Code Here

Examples of io.undertow.servlet.api.TransportGuaranteeType

        List<SingleConstraintMatch> list = servletRequestContext.getRequiredConstrains();
        if (list == null) {
            servletRequestContext.setRequiredConstrains(list = new ArrayList<SingleConstraintMatch>());
        }
        list.add(securityMatch.getMergedConstraint());
        TransportGuaranteeType type = servletRequestContext.getTransportGuarenteeType();
        if (type == null || type.ordinal() < securityMatch.getTransportGuaranteeType().ordinal()) {
            servletRequestContext.setTransportGuarenteeType(securityMatch.getTransportGuaranteeType());
        }
        next.handleRequest(exchange);
    }
View Full Code Here

Examples of io.undertow.servlet.api.TransportGuaranteeType

    @Override
    public void handleRequest(HttpServerExchange exchange) throws Exception {
        final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
        final AuthorizationManager authorizationManager = servletRequestContext.getDeployment().getDeploymentInfo().getAuthorizationManager();

        TransportGuaranteeType connectionGuarantee = servletRequestContext.getOriginalRequest().isSecure() ? TransportGuaranteeType.CONFIDENTIAL : TransportGuaranteeType.NONE;
        TransportGuaranteeType transportGuarantee = authorizationManager.transportGuarantee(connectionGuarantee,
                servletRequestContext.getTransportGuarenteeType(), servletRequestContext.getOriginalRequest());
        servletRequestContext.setTransportGuarenteeType(transportGuarantee);

        if (TransportGuaranteeType.REJECTED == transportGuarantee) {
            HttpServletResponse response = (HttpServletResponse) servletRequestContext.getServletResponse();
View Full Code Here

Examples of io.undertow.servlet.api.TransportGuaranteeType

        super.handleRequest(exchange);
    }

    @Override
    protected boolean confidentialityRequired(HttpServerExchange exchange) {
        TransportGuaranteeType transportGuarantee = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getTransportGuarenteeType();

        // TODO - We may be able to add more flexibility here especially with authentication mechanisms such as Digest for
        // INTEGRAL - for now just use SSL.
        return (TransportGuaranteeType.CONFIDENTIAL == transportGuarantee || TransportGuaranteeType.INTEGRAL == transportGuarantee);
    }
View Full Code Here

Examples of io.undertow.servlet.api.TransportGuaranteeType

        List<SingleConstraintMatch> list = servletRequestContext.getRequiredConstrains();
        if (list == null) {
            servletRequestContext.setRequiredConstrains(list = new ArrayList<SingleConstraintMatch>());
        }
        list.add(securityMatch.getMergedConstraint());
        TransportGuaranteeType type = servletRequestContext.getTransportGuarenteeType();
        if (type == null || type.ordinal() < securityMatch.getTransportGuaranteeType().ordinal()) {
            servletRequestContext.setTransportGuarenteeType(securityMatch.getTransportGuaranteeType());
        }
        next.handleRequest(exchange);
    }
View Full Code Here

Examples of io.undertow.servlet.api.TransportGuaranteeType

    @Override
    public void handleRequest(HttpServerExchange exchange) throws Exception {
        final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
        final AuthorizationManager authorizationManager = servletRequestContext.getDeployment().getDeploymentInfo().getAuthorizationManager();

        TransportGuaranteeType connectionGuarantee = servletRequestContext.getOriginalRequest().isSecure() ? TransportGuaranteeType.CONFIDENTIAL : TransportGuaranteeType.NONE;
        TransportGuaranteeType transportGuarantee = authorizationManager.transportGuarantee(connectionGuarantee,
                servletRequestContext.getTransportGuarenteeType(), servletRequestContext.getOriginalRequest());
        servletRequestContext.setTransportGuarenteeType(transportGuarantee);

        if (TransportGuaranteeType.REJECTED == transportGuarantee) {
            HttpServletResponse response = (HttpServletResponse) servletRequestContext.getServletResponse();
View Full Code Here

Examples of io.undertow.servlet.api.TransportGuaranteeType

        super.handleRequest(exchange);
    }

    @Override
    protected boolean confidentialityRequired(HttpServerExchange exchange) {
        TransportGuaranteeType transportGuarantee = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getTransportGuarenteeType();

        // TODO - We may be able to add more flexibility here especially with authentication mechanisms such as Digest for
        // INTEGRAL - for now just use SSL.
        return (TransportGuaranteeType.CONFIDENTIAL == transportGuarantee || TransportGuaranteeType.INTEGRAL == transportGuarantee);
    }
View Full Code Here

Examples of org.jboss.metadata.web.spec.TransportGuaranteeType

      if (scs != null)
      {
         for (SecurityConstraintMetaData value : scs)
         {
            org.apache.catalina.deploy.SecurityConstraint constraint = new org.apache.catalina.deploy.SecurityConstraint();
            TransportGuaranteeType tg = value.getTransportGuarantee();
            constraint.setUserConstraint(tg.name());
            AuthConstraintMetaData acmd = value.getAuthConstraint();
            constraint.setAuthConstraint(acmd != null);
            if (acmd != null)
            {
               if (acmd.getRoleNames() != null)
View Full Code Here

Examples of org.jboss.metadata.web.spec.TransportGuaranteeType

      if(constraints != null)
      {
         for(SecurityConstraintMetaData sc : constraints)
         {
            WebResourceCollectionsMetaData resources = sc.getResourceCollections();
            TransportGuaranteeType transport = sc.getTransportGuarantee();
            if( sc.isExcluded() || sc.isUnchecked() )
            {
               // Process the permissions for the excluded/unchecked resources
               if(resources != null)
               for(WebResourceCollectionMetaData wrc : resources)
               {
                  List<String> httpMethods = wrc.getHttpMethods();
                  List<String> urlPatterns = wrc.getUrlPatterns();
                  int length = urlPatterns != null ? urlPatterns.size() : 0;
                  for(int n = 0; n < length; n ++)
                  {
                     String url = urlPatterns.get(n);
                     PatternInfo info = (PatternInfo) patternMap.get(url);
                     // Add the excluded methods
                     if( sc.isExcluded() )
                     {
                        info.addExcludedMethods(httpMethods);
                     }
                  }
               }
            }
            else
            {
               // Process the permission for the resources x roles
               if(resources != null)
               for(WebResourceCollectionMetaData wrc : resources)
               {
                  List<String> httpMethods = wrc.getHttpMethods();
                  List<String> urlPatterns = wrc.getUrlPatterns();
                  int length = urlPatterns != null ? urlPatterns.size() : 0;
                  for(int n = 0; n < length; n ++)
                  {
                     String url = urlPatterns.get(n);
                     // Get the qualified url pattern
                     PatternInfo info = (PatternInfo) patternMap.get(url);
                     HashSet<String> mappedRoles = new HashSet<String>();
                     if(sc.getRoleNames() != null)
                     for(String role : sc.getRoleNames())
                     {
                        if( role.equals("*") )
                        {
                           //JBAS-1824: Allow "*" to provide configurable authorization bypass
                           if(metaData.isJaccAllStoreRole())
                              mappedRoles.add("*");
                           else
                           {
                              // The wildcard ref maps to all declared security-role names
                              for(SecurityRoleMetaData srmd : metaData.getSecurityRoles())
                              {
                                 role = srmd.getRoleName();
                                 mappedRoles.add(role);
                              }
                           }
                        }
                        else
                        {
                           mappedRoles.add(role);
                        }
                     }
                     info.addRoles(mappedRoles, httpMethods);
                     // Add the transport to methods
                     info.addTransport(transport.name(), httpMethods);
                     //SECURITY-63: Missing auth-constraint needs unchecked policy
                     if(sc.getAuthConstraint() == null)
                        info.isMissingAuthConstraint = true;
                  }
               }
View Full Code Here

Examples of org.jboss.metadata.web.spec.TransportGuaranteeType

    */
   public static UserDataConstraintMetaData newUserDataConstraint(final String transportGuarantee,
         final SecurityConstraintMetaData securityConstraintMD)
   {
      final UserDataConstraintMetaData userDataConstraintMD = new UserDataConstraintMetaData();
      final TransportGuaranteeType transportGuaranteeValue = TransportGuaranteeType.valueOf(transportGuarantee);

      userDataConstraintMD.setTransportGuarantee(transportGuaranteeValue);
      securityConstraintMD.setUserDataConstraint(userDataConstraintMD);

      return userDataConstraintMD;
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.