* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.wamblee.security.authorization;
import org.wamblee.security.authentication.InMemoryGroupSet;
import org.wamblee.security.authentication.UserAdministrationImpl;
import org.wamblee.security.authentication.UserMgtException.Reason;
-
/**
* User access that always returns a user that belongs to a fixed group.
*
private static final String GROUP = "users";
- private UserAdministration userAdmin;
-
- public TestUserAccessor() {
- userAdmin = new UserAdministrationImpl(
- new InMemoryUserSet(new RegexpNameValidator(
- RegexpNameValidator.PASSWORD_PATTERN, Reason.INVALID_PASSWORD,
+ private UserAdministration userAdmin;
+
+ public TestUserAccessor() {
+ userAdmin = new UserAdministrationImpl(new InMemoryUserSet(
+ new RegexpNameValidator(RegexpNameValidator.PASSWORD_PATTERN,
+ Reason.INVALID_PASSWORD,
"Password must contain at least 6 characters"),
- new Md5HexMessageDigester()), new InMemoryGroupSet(),
+ new Md5HexMessageDigester()), new InMemoryGroupSet(),
new RegexpNameValidator(RegexpNameValidator.ID_PATTERN,
Reason.INVALID_USERNAME, "Invalid user"),
new RegexpNameValidator(RegexpNameValidator.ID_PATTERN,
Reason.INVALID_GROUPNAME, "Invalid group"));
- userAdmin.createGroup(GROUP);
- userAdmin.createUser(USER, PASSWORD);
- userAdmin.addUserToGroup(USER, GROUP);
+ userAdmin.createGroup(GROUP);
+ userAdmin.createUser(USER, PASSWORD);
+ userAdmin.addUserToGroup(USER, GROUP);
}
-
+
// NOTE: This is only for test. Normally the user accessor would not depend
- // on user administration. This just ensures that a user administration is created
- // that knows about the given user.
+ // on user administration. This just ensures that a user administration is
+ // created
+ // that knows about the given user.
public UserAdministration getUserAdmin() {
return userAdmin;
}
-
+
/*
* (non-Javadoc)
*