Skip to content

Commit

Permalink
HBASE-24121 [Authorization] ServiceAuthorizationManager isn't dynamic…
Browse files Browse the repository at this point in the history
…ally updatable. And it should be (#1439)

Signed-off-by: Bharath Vissapragada <bharathv@apache.org>
Signed-off-by: Michael Stack <stack@apache.org>
  • Loading branch information
Reidddddd committed Apr 9, 2020
1 parent 611c62f commit 5012241
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.apache.hadoop.hbase.regionserver.RSRpcServices;
import org.apache.hadoop.hbase.regionserver.slowlog.RpcLogDetails;
import org.apache.hadoop.hbase.regionserver.slowlog.SlowLogRecorder;
import org.apache.hadoop.hbase.security.HBasePolicyProvider;
import org.apache.hadoop.hbase.security.SaslUtil;
import org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection;
import org.apache.hadoop.hbase.security.User;
Expand All @@ -58,6 +59,7 @@
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authorize.AuthorizationException;
import org.apache.hadoop.security.authorize.PolicyProvider;
import org.apache.hadoop.security.authorize.ProxyUsers;
import org.apache.hadoop.security.authorize.ServiceAuthorizationManager;
import org.apache.hadoop.security.token.SecretManager;
import org.apache.hadoop.security.token.TokenIdentifier;
Expand Down Expand Up @@ -311,6 +313,14 @@ public void onConfigurationChange(Configuration newConf) {
if (scheduler instanceof ConfigurationObserver) {
((ConfigurationObserver) scheduler).onConfigurationChange(newConf);
}
// Make sure authManager will read hbase-policy file
System.setProperty("hadoop.policy.file", "hbase-policy.xml");
synchronized (authManager) {
authManager.refresh(newConf, new HBasePolicyProvider());
}
LOG.info("Refreshed hbase-policy.xml successfully");
ProxyUsers.refreshSuperUserGroupsConfiguration(newConf);
LOG.info("Refreshed super and proxy users successfully");
}

protected void initReconfigurable(Configuration confToLoad) {
Expand Down

0 comments on commit 5012241

Please sign in to comment.