AuthorizationManager类
AuthorizationManager类用于初始化AuthorizationHandler, 并对其进行管理。
起初始化源代码如下:
public synchronized void initialize() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
LOG.trace("Begin authorization manager initialization");
String handler = SqoopConfiguration.getInstance().getContext().getString("org.apache.sqoop.security.authorization.handler", "org.apache.sqoop.security.authorization.DefaultAuthorizationHandler").trim();
authorizationHandler = SecurityFactory.getAuthorizationHandler(handler);
String provider = SqoopConfiguration.getInstance().getContext().getString("org.apache.sqoop.security.authorization.authentication_provider", "org.apache.sqoop.security.authorization.DefaultAuthenticationProvider").trim();
String serverName = SqoopConfiguration.getInstance().getContext().getString("org.apache.sqoop.security.authorization.server_name", "SqoopServer1").trim();
authorizationHandler.doInitialize(SecurityFactory.getAuthenticationProvider(provider), serverName);
LOG.info("Authorization loaded.");
}
authorizationHandler类
authorizationHandler类用于完成授权的过程。
授权系统决定了用户可以执行什么操作,一旦他们完成授权。
系统提供了默认的DefaultAuthorizationHandler, 以及DefaultAuthenticationProvider类来负责授权的过程。