1package org.apache.archiva.redback.system;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122import org.apache.archiva.redback.policy.AccountLockedException;
23import org.apache.archiva.redback.policy.MustChangePasswordException;
24import org.apache.archiva.redback.policy.UserSecurityPolicy;
25import org.apache.archiva.redback.users.UserManagerException;
26import org.apache.archiva.redback.users.UserNotFoundException;
27import org.apache.archiva.redback.authentication.AuthenticationDataSource;
28import org.apache.archiva.redback.authentication.AuthenticationException;
29import org.apache.archiva.redback.authorization.AuthorizationException;
30import org.apache.archiva.redback.authorization.AuthorizationResult;
31import org.apache.archiva.redback.keys.KeyManager;
32import org.apache.archiva.redback.users.UserManager;
3334/**35 * SecuritySystem:36 *37 * @author: Jesse McConnell <jesse@codehaus.org>38 */39publicinterfaceSecuritySystem40 {
4142// ----------------------------------------------------------------------------43// Authentication44// ----------------------------------------------------------------------------4546SecuritySession authenticate( AuthenticationDataSource source )
47throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException,
48 UserManagerException;
4950boolean isAuthenticated( AuthenticationDataSource source )
51throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException,
52 UserManagerException;
5354// ----------------------------------------------------------------------------55// Authorization56// ----------------------------------------------------------------------------5758AuthorizationResult authorize( SecuritySession session, String permission )
59throws AuthorizationException;
6061boolean isAuthorized( SecuritySession session, String permission )
62throws AuthorizationException;
6364/**65 * return AuthorizationResult without changing authorization66 *67 * @param session68 * @param permission69 * @param resource70 * @return71 * @throws AuthorizationException72 */73AuthorizationResult authorize( SecuritySession session, String permission, String resource )
74throws AuthorizationException;
7576boolean isAuthorized( SecuritySession session, String permission, String resource )
77throws AuthorizationException;
7879// ----------------------------------------------------------------------------80// User Management81// ----------------------------------------------------------------------------8283UserManager getUserManager();
8485// ----------------------------------------------------------------------------86// Key Management87// ----------------------------------------------------------------------------8889KeyManager getKeyManager();
9091// ----------------------------------------------------------------------------92// Policy Management93// ----------------------------------------------------------------------------9495UserSecurityPolicy getPolicy();
9697/**98 * @return is it possible to modify user datas (some userManager cannot i.e ldap)99 * @since 2.1100 */101boolean userManagerReadOnly();
102 }
103