/** * {@inheritDoc} */ @Override public String getPackageResourceGuard() { return Stringz.className(application.getResourceSettings().getPackageResourceGuard()); }
/** * Adds the given file patterns to package resource guard from the given application. * * @param application * the application * @param patterns * the patterns */ public static void addFilePatternsToPackageResourceGuard(final Application application, final String... patterns) { final IPackageResourceGuard packageResourceGuard = application.getResourceSettings() .getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { final SecurePackageResourceGuard guard = (SecurePackageResourceGuard)packageResourceGuard; for (final String pattern : patterns) { guard.addPattern(pattern); } } }
/** * Checks whether access is granted for this resource. * * By default IPackageResourceGuard is used to check the permissions but the resource itself can * also make the check. * * @param path * resource path * @return <code>true<code> if resource access is granted */ protected boolean accept(String path) { IPackageResourceGuard guard = Application.get() .getResourceSettings() .getPackageResourceGuard(); return guard.accept(path); }
/** * Checks whether access is granted for this resource. * * By default IPackageResourceGuard is used to check the permissions but the resource itself can * also make the check. * * @param path * resource path * @return <code>true<code> if resource access is granted */ protected boolean accept(String path) { IPackageResourceGuard guard = Application.get() .getResourceSettings() .getPackageResourceGuard(); return guard.accept(path); }
@Override public void init(WebApplication webApplication) { IPackageResourceGuard packageResourceGuard = webApplication.getResourceSettings().getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard; for(String pattern : props.getPattern()){ guard.addPattern(pattern); } } wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass()) .withDetail("properties", props) .build()); }
@Override public void init(WebApplication webApplication) { IPackageResourceGuard packageResourceGuard = webApplication.getResourceSettings().getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard; for(String pattern : props.getPattern()){ guard.addPattern(pattern); } } wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass()) .withDetail("properties", props) .build()); }
public void init(Application application) { application.getRootRequestMapperAsCompound().add(new TinyMceRequestMapper()); // Resource Package Guard security settings to fix .htm file problem IPackageResourceGuard packageResourceGuard = application.getResourceSettings().getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard; guard.addPattern("+wicket/contrib/tinymce/tiny_mce/**/*.htm"); } }
/** * updates the security manager to allow fonts and less files if necessary. * * @param app The current application */ private static void updateSecurityManager(final Application app) { final IPackageResourceGuard packageResourceGuard = app.getResourceSettings().getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard; guard.addPattern("+*.woff"); guard.addPattern("+*.woff2"); guard.addPattern("+*.eot"); guard.addPattern("+*.svg"); guard.addPattern("+*.ttf"); guard.addPattern("+*.css.map"); } }
@Override protected void onGlobalSettings() { super.onGlobalSettings(); getApplicationSettings().setUploadProgressUpdatesEnabled(true); // deactivate ajax debug mode // getDebugSettings().setAjaxDebugModeEnabled(false); configureBootstrap(); // configureResourceBundles(); optimizeForWebPerformance(); new AnnotatedMountScanner().scanPackage(getPackageToScan()).mount(this); if (Strings.isTrue(getProperties().getProperty("cdn.useCdn"))) { final String cdn = getProperties().getProperty("cdn.baseUrl"); StaticResourceRewriteMapper.withBaseUrl(cdn).install(this); } final IPackageResourceGuard packageResourceGuard = getResourceSettings() .getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { final SecurePackageResourceGuard securePackageResourceGuard = (SecurePackageResourceGuard)packageResourceGuard; securePackageResourceGuard.addPattern("+*.woff2"); } }