Package io.undertow.servlet.api

Examples of io.undertow.servlet.api.TransportGuaranteeType


        List<Set<String>> list = exchange.getAttachment(ServletAttachments.REQUIRED_ROLES);
        if(list == null) {
            exchange.putAttachment(ServletAttachments.REQUIRED_ROLES, list = new ArrayList<Set<String>>());
        }
        list.addAll(securityMatch.getRequiredRoles());
        TransportGuaranteeType type = exchange.getAttachment(ServletAttachments.TRANSPORT_GUARANTEE_TYPE);
        if(type == null || type.ordinal() < securityMatch.getTransportGuaranteeType().ordinal()) {
            exchange.putAttachment(ServletAttachments.TRANSPORT_GUARANTEE_TYPE, securityMatch.getTransportGuaranteeType());
        }
        HttpHandlers.executeHandler(next, exchange);
    }
View Full Code Here


        this.portManager = portManager;
    }

    @Override
    protected boolean confidentialityRequired(HttpServerExchange exchange) {
        TransportGuaranteeType transportGuarantee = exchange.getAttachment(ServletAttachments.TRANSPORT_GUARANTEE_TYPE);

        // 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

                extensionRoleInformation.isEmpty();
    }

    public SecurityPathMatch getSecurityInfo(final String path, final String method) {
        final List<Set<String>> roleSet = new ArrayList<Set<String>>();
        TransportGuaranteeType type = TransportGuaranteeType.NONE;
        type = handleMatch(method, defaultPathSecurityInformation, roleSet, type);
        PathSecurityInformation match = exactPathRoleInformation.get(path);
        if (match != null) {
            type = handleMatch(method, match, roleSet, type);
        }
View Full Code Here

    @Override
    protected boolean confidentialityRequired(HttpServerExchange exchange) {
        final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);

        //the configure (via web.xml or annotations) guarantee
        TransportGuaranteeType configuredGuarantee = servletRequestContext.getTransportGuarenteeType();
        Deployment deployment = servletRequestContext.getDeployment();
        final AuthorizationManager authorizationManager = deployment.getDeploymentInfo().getAuthorizationManager();

        TransportGuaranteeType connectionGuarantee = servletRequestContext.getOriginalRequest().isSecure() ? TransportGuaranteeType.CONFIDENTIAL : TransportGuaranteeType.NONE;

        TransportGuaranteeType transportGuarantee = authorizationManager.transportGuarantee(connectionGuarantee, configuredGuarantee, servletRequestContext.getOriginalRequest());

        // 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

    @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

        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

        this.portManager = portManager;
    }

    @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

        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

        List<SingleConstraintMatch> list = servletRequestContext.getRequiredConstrains();
        if (list == null) {
            servletRequestContext.setRequiredConstrains(list = new ArrayList<>());
        }
        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

    @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

TOP

Related Classes of io.undertow.servlet.api.TransportGuaranteeType

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.