001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.wicket.settings;
018:
019: import org.apache.wicket.authorization.IAuthorizationStrategy;
020: import org.apache.wicket.authorization.IUnauthorizedComponentInstantiationListener;
021: import org.apache.wicket.markup.html.form.persistence.CookieValuePersisterSettings;
022: import org.apache.wicket.util.crypt.ICryptFactory;
023:
024: /**
025: * Interface for security related settings
026: *
027: * @author Igor Vaynberg (ivaynberg)
028: */
029: public interface ISecuritySettings {
030: /**
031: * encryption key used by default crypt factory
032: */
033: public static final String DEFAULT_ENCRYPTION_KEY = "WiCkEt-FRAMEwork";
034:
035: /**
036: * Gets the authorization strategy.
037: *
038: * @return Returns the authorizationStrategy.
039: */
040: IAuthorizationStrategy getAuthorizationStrategy();
041:
042: /**
043: * Get the defaults to be used by persistence manager
044: *
045: * @return CookieValuePersisterSettings
046: */
047: CookieValuePersisterSettings getCookieValuePersisterSettings();
048:
049: /**
050: * @return crypt factory used to generate crypt objects
051: */
052: ICryptFactory getCryptFactory();
053:
054: /**
055: * Gets whether mounts should be enforced. If true, requests for mounted
056: * targets have to done through the mounted paths. If, for instance, a
057: * bookmarkable page is mounted to a path, a request to that same page via
058: * the bookmarkablePage parameter will be denied.
059: *
060: * @return Whether mounts should be enforced
061: */
062: boolean getEnforceMounts();
063:
064: /**
065: * @return The listener
066: * @see IUnauthorizedComponentInstantiationListener
067: */
068: IUnauthorizedComponentInstantiationListener getUnauthorizedComponentInstantiationListener();
069:
070: /**
071: * Sets the authorization strategy.
072: *
073: * @param strategy
074: * new authorization strategy
075: *
076: */
077: void setAuthorizationStrategy(IAuthorizationStrategy strategy);
078:
079: /**
080: * @param cookieValuePersisterSettings
081: * The cookieValuePersisterSettings to set.
082: */
083: void setCookieValuePersisterSettings(
084: CookieValuePersisterSettings cookieValuePersisterSettings);
085:
086: /**
087: * Sets the factory that will be used to create crypt objects. The crypt
088: * object returned from the first call is cached.
089: *
090: * @param cryptFactory
091: */
092: void setCryptFactory(ICryptFactory cryptFactory);
093:
094: /**
095: * Sets whether mounts should be enforced. If true, requests for mounted
096: * targets have to done through the mounted paths. If, for instance, a
097: * bookmarkable page is mounted to a path, a request to that same page via
098: * the bookmarkablePage parameter will be denied.
099: *
100: * @param enforce
101: * Whether mounts should be enforced
102: */
103: void setEnforceMounts(boolean enforce);
104:
105: /**
106: * @param unauthorizedComponentInstantiationListener
107: * The listener to set
108: * @see IUnauthorizedComponentInstantiationListener
109: */
110: void setUnauthorizedComponentInstantiationListener(
111: IUnauthorizedComponentInstantiationListener unauthorizedComponentInstantiationListener);
112: }
|