@Override protected void handlePlexusResourceSecurity(PlexusResource resource) { PathProtectionDescriptor descriptor = resource.getResourceProtection(); if (descriptor == null) { return; } // sanity check: path protection descriptor path and resource URI must align if (!shiroAntPathMatcher.match(descriptor.getPathPattern(), resource.getResourceUri())) { throw new IllegalStateException(String.format( "Plexus resource %s would attach to URI=%s but protect path=%s that does not matches URI!", resource.getClass().getName(), resource.getResourceUri(), descriptor.getPathPattern())); } String filterExpression = descriptor.getFilterExpression(); if (filterExpression != null && !filterExpression.contains("authcNxBasic")) { // don't create session unless the user logs in from the UI filterExpression = "noSessionCreation," + filterExpression; } // HACK: Disable CSRFGuard support for now, its too problematic //if (filterExpression != null // && (filterExpression.contains("authcBasic") || filterExpression.contains("authcNxBasic"))) { // filterExpression += ",csrfToken"; //} this.protectedPathManager.addProtectedResource("/service/local" + descriptor.getPathPattern(), filterExpression); }
@Override protected void handlePlexusResourceSecurity( PlexusResource resource ) { PathProtectionDescriptor descriptor = resource.getResourceProtection(); if ( descriptor == null ) { return; } String filterExpression = descriptor.getFilterExpression(); if ( filterExpression != null && !filterExpression.contains( "authcNxBasic" ) ) { // don't create session unless the user logs in from the UI filterExpression = "noSessionCreation," + filterExpression; } this.protectedPathManager.addProtectedResource( "/service/*" + descriptor.getPathPattern(), filterExpression ); }
+ contentResource.getResourceProtection().getPathPattern(), "noSessionCreation," + contentResource.getResourceProtection().getFilterExpression() );