Package org.acegisecurity

Examples of org.acegisecurity.ConfigAttributeDefinition


                .anyTimes();

        org.easymock.classextension.EasyMock.replay(filter);

        XACMLFilterDecisionVoter voter = new XACMLFilterDecisionVoter();
        return voter.vote(aut, filter, new ConfigAttributeDefinition());

    }
View Full Code Here


    public void setMappings( List mappings ) {
        Iterator it = mappings.iterator();
        while (it.hasNext()) {
            RESTfulDefinitionSourceMapping mapping = (RESTfulDefinitionSourceMapping)it.next();
            ConfigAttributeDefinition configDefinition = new ConfigAttributeDefinition();

            Iterator configAttributesIt = mapping.getConfigAttributes().iterator();
            while (configAttributesIt.hasNext()) {
                String s = (String) configAttributesIt.next();
                configDefinition.addConfigAttribute( new SecurityConfig(s) );
            }
            delegate.addSecureUrl(mapping.getUrl(), mapping.getHttpMethods(), configDefinition);
        }
    }
View Full Code Here

        }

        Set set = new HashSet();

        while (iter.hasNext()) {
            ConfigAttributeDefinition def = (ConfigAttributeDefinition) iter.next();
            Iterator attributes = def.getConfigAttributes();

            while (attributes.hasNext()) {
                ConfigAttribute attr = (ConfigAttribute) attributes.next();

                if (!this.channelDecisionManager.supports(attr)) {
View Full Code Here

        if (!(response instanceof HttpServletResponse)) {
            throw new ServletException("HttpServletResponse required");
        }

        FilterInvocation fi = new FilterInvocation(request, response, chain);
        ConfigAttributeDefinition attr = this.filterInvocationDefinitionSource.getAttributes(fi);

        if (attr != null) {
            if (logger.isDebugEnabled()) {
                logger.debug("Request: " + fi.toString() + "; ConfigAttributes: " + attr.toString());
            }

            channelDecisionManager.decide(fi, attr);

            if (fi.getResponse().isCommitted()) {
View Full Code Here

        int abstain = 0;

        Iterator configIter = config.getConfigAttributes();

        while (configIter.hasNext()) {
            ConfigAttributeDefinition thisDef = new ConfigAttributeDefinition();
            thisDef.addConfigAttribute((ConfigAttribute) configIter.next());

            Iterator voters = this.getDecisionVoters().iterator();

            while (voters.hasNext()) {
                AccessDecisionVoter voter = (AccessDecisionVoter) voters.next();
View Full Code Here

        return (mappedName.endsWith("*") && methodName.startsWith(mappedName.substring(0, mappedName.length() - 1)))
        || (mappedName.startsWith("*") && methodName.endsWith(mappedName.substring(1, mappedName.length())));
    }

    protected ConfigAttributeDefinition lookupAttributes(Method method) {
        ConfigAttributeDefinition definition = new ConfigAttributeDefinition();

        // Add attributes explictly defined for this method invocation
        ConfigAttributeDefinition directlyAssigned = (ConfigAttributeDefinition) this.methodMap.get(method);
        merge(definition, directlyAssigned);

        // Add attributes explicitly defined for this method invocation's interfaces
        Class[] interfaces = method.getDeclaringClass().getInterfaces();

        for (int i = 0; i < interfaces.length; i++) {
            Class clazz = interfaces[i];

            try {
                // Look for the method on the current interface
                Method interfaceMethod = clazz.getDeclaredMethod(method.getName(), (Class[]) method.getParameterTypes());
                ConfigAttributeDefinition interfaceAssigned =
                        (ConfigAttributeDefinition) this.methodMap.get(interfaceMethod);
                merge(definition, interfaceAssigned);
            } catch (Exception e) {
                // skip this interface
            }
View Full Code Here

     */
    public void setMappings(List mappings) {
        Iterator it = mappings.iterator();
        while (it.hasNext()) {
            MethodDefinitionSourceMapping mapping = (MethodDefinitionSourceMapping) it.next();
            ConfigAttributeDefinition configDefinition = new ConfigAttributeDefinition();

            Iterator configAttributesIt = mapping.getConfigAttributes().iterator();
            while (configAttributesIt.hasNext()) {
                String s = (String) configAttributesIt.next();
                configDefinition.addConfigAttribute(new SecurityConfig(s));
            }

            addSecureMethod(mapping.getMethodName(), configDefinition);
        }
    }
View Full Code Here

    public Iterator getConfigAttributeDefinitions() {
        return null;
    }

    protected ConfigAttributeDefinition lookupAttributes(Method method) {
        ConfigAttributeDefinition definition = new ConfigAttributeDefinition();

        Class interceptedClass = method.getDeclaringClass();

        // add the class level attributes for the implementing class
        addClassAttributes(definition, interceptedClass);

        // add the class level attributes for the implemented interfaces
        addClassAttributes(definition, interceptedClass.getInterfaces());

        // add the method level attributes for the implemented method
        addMethodAttributes(definition, method);

        // add the method level attributes for the implemented intreface methods
        addInterfaceMethodAttributes(definition, method);

        if (definition.size() == 0) {
            return null;
        } else {
            return definition;
        }
    }
View Full Code Here

    public boolean isAllowed(MethodInvocation mi, Authentication authentication) {
        Assert.notNull(mi, "MethodInvocation required");
        Assert.notNull(mi.getMethod(), "MethodInvocation must provide a non-null getMethod()");

        ConfigAttributeDefinition attrs = securityInterceptor.obtainObjectDefinitionSource().getAttributes(mi);

        if (attrs == null) {
            if (securityInterceptor.isRejectPublicInvocations()) {
                return false;
            }
View Full Code Here

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {
        FilterInvocation fi = new FilterInvocation(request, response, chain);

        ConfigAttributeDefinition cad = this.filterInvocationDefinitionSource.getAttributes(fi);

        if (cad == null) {
            if (logger.isDebugEnabled()) {
                logger.debug(fi.getRequestUrl() + " has no matching filters");
            }
View Full Code Here

TOP

Related Classes of org.acegisecurity.ConfigAttributeDefinition

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.