Package org.apache.geronimo.web.info

Examples of org.apache.geronimo.web.info.SecurityConstraintInfo


        for (MimeMapping mimeMapping: webApp.getMimeMapping()) {
            webAppInfo.mimeMappings.put(mimeMapping.getExtension(), mimeMapping.getMimeType());
        }

        for (SecurityConstraint securityConstraint : webApp.getSecurityConstraint()) {
            SecurityConstraintInfo securityConstraintInfo = webAppInfoFactory.newSecurityConstraintInfo();
            if (securityConstraint.getAuthConstraint() != null) {
                securityConstraintInfo.authConstraint = new AuthConstraintInfo();
                securityConstraintInfo.authConstraint.roleNames.addAll(securityConstraint.getAuthConstraint().getRoleName());
            }
            if (securityConstraint.getUserDataConstraint() != null) {
View Full Code Here


        }
    }

    private SecurityConstraintInfo newHTTPMethodSecurityConstraint(String[] rolesAllowed, TransportGuarantee transportGuarantee, ServletSecurity.EmptyRoleSemantic emptyRoleSemantic,
            String httpMethod, Collection<String> urlPatterns) {
        SecurityConstraintInfo securityConstraint = newSecurityConstraint(rolesAllowed, transportGuarantee, emptyRoleSemantic, true);
        WebResourceCollectionInfo webResourceCollection = securityConstraint.webResourceCollections.get(0);
        webResourceCollection.urlPatterns.addAll(urlPatterns);
        webResourceCollection.httpMethods.add(httpMethod);
        return securityConstraint;
    }
View Full Code Here

        return securityConstraint;
    }

    private SecurityConstraintInfo newHTTPSecurityConstraint(String[] rolesAllowed, TransportGuarantee transportGuarantee, ServletSecurity.EmptyRoleSemantic emptyRoleSemantic,
            Collection<String> omissionMethods, Collection<String> urlPatterns) {
        SecurityConstraintInfo securityConstraint = newSecurityConstraint(rolesAllowed, transportGuarantee, emptyRoleSemantic, !omissionMethods.isEmpty());
        if (securityConstraint != null) {
            WebResourceCollectionInfo webResourceCollection = securityConstraint.webResourceCollections.get(0);
            webResourceCollection.httpMethods.addAll(omissionMethods);
            webResourceCollection.urlPatterns.addAll(urlPatterns);
            webResourceCollection.omission = true;
View Full Code Here

    private SecurityConstraintInfo newSecurityConstraint(String[] rolesAllowed, TransportGuarantee transportGuarantee, ServletSecurity.EmptyRoleSemantic emptyRoleSemantic, boolean force) {
        //IF emptyRoleSemantic=PERMIT AND rolesAllowed={} AND transportGuarantee=NONE then
        //  No Constraint
        //END IF
        if (force || rolesAllowed.length > 0 || transportGuarantee.equals(TransportGuarantee.CONFIDENTIAL) || emptyRoleSemantic.equals(ServletSecurity.EmptyRoleSemantic.DENY)) {
            SecurityConstraintInfo securityConstraint = new SecurityConstraintInfo();
            WebResourceCollectionInfo webResourceCollection = new WebResourceCollectionInfo();
            securityConstraint.webResourceCollections.add(webResourceCollection);
            if (transportGuarantee.equals(TransportGuarantee.CONFIDENTIAL)) {
                securityConstraint.userDataConstraint = TransportGuarantee.CONFIDENTIAL.name();
            }
View Full Code Here

    private void processServletSecurityElement(List<SecurityConstraintInfo> securityConstraints, ServletSecurityElement servletSecurityElement, Collection<String> urlPatterns) {
        if (servletSecurityElement.getHttpMethodConstraints().size() > 0) {
            for (HttpMethodConstraintElement httpMethodConstraint : servletSecurityElement.getHttpMethodConstraints()) {
                //Generate a security-constraint for each HttpMethodConstraint
                SecurityConstraintInfo securityConstraint = newHTTPMethodSecurityConstraint(httpMethodConstraint.getRolesAllowed(), httpMethodConstraint.getTransportGuarantee(),
                        httpMethodConstraint.getEmptyRoleSemantic(), httpMethodConstraint.getMethodName(), urlPatterns);
                if (securityConstraint != null) {
                    securityConstraints.add(securityConstraint);
                }
                declareRoles(httpMethodConstraint.getRolesAllowed());
            }
        }
        SecurityConstraintInfo securityConstraint = newHTTPSecurityConstraint(servletSecurityElement.getRolesAllowed(), servletSecurityElement.getTransportGuarantee(),
                servletSecurityElement.getEmptyRoleSemantic(), servletSecurityElement.getMethodNames(), urlPatterns);
        if (securityConstraint != null) {
            securityConstraints.add(securityConstraint);
        }
        declareRoles(servletSecurityElement.getRolesAllowed());
View Full Code Here

        throw new IllegalStateException("default does not support jsps");
    }

    @Override
    public SecurityConstraintInfo newSecurityConstraintInfo() {
        return new SecurityConstraintInfo();
    }
View Full Code Here

        return new SecurityConstraintInfo();
    }

    @Override
    public SecurityConstraintInfo copy(SecurityConstraintInfo securityConstraintInfo) {
        SecurityConstraintInfo copy = new SecurityConstraintInfo();
        copy.authConstraint = securityConstraintInfo.authConstraint;
        copy.userDataConstraint = securityConstraintInfo.userDataConstraint;
        copy.webResourceCollections.addAll(securityConstraintInfo.webResourceCollections);
        return copy;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.web.info.SecurityConstraintInfo

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.