ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [4/4] incubator-ranger git commit: Merge branch 'master' into tag-policy
Date Fri, 29 May 2015 03:47:03 GMT
Merge branch 'master' into tag-policy


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/2474fed1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/2474fed1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/2474fed1

Branch: refs/heads/tag-policy
Commit: 2474fed115430d54be8be95caec5f66703b3c83c
Parents: 525fd59 fb6e94f
Author: Madhan Neethiraj <madhan@apache.org>
Authored: Thu May 28 20:40:45 2015 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Thu May 28 20:40:45 2015 -0700

----------------------------------------------------------------------
 .../ranger/services/kms/client/KMSClient.java   |  70 +++--
 .../java/org/apache/ranger/biz/KmsKeyMgr.java   | 291 ++++++++++++++-----
 .../org/apache/ranger/biz/ServiceDBStore.java   |  25 +-
 .../java/org/apache/ranger/rest/XKeyREST.java   |   6 +-
 src/main/assembly/knox-agent.xml                |   8 -
 5 files changed, 280 insertions(+), 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/2474fed1/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
----------------------------------------------------------------------
diff --cc security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
index 041f032,b259be6..66111ba
--- a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
@@@ -1792,25 -1756,9 +1792,25 @@@ public class ServiceDBStore extends Abs
  		serviceDbObj.setPolicyUpdateTime(service.getPolicyUpdateTime());
  
  		serviceDao.update(serviceDbObj);
 +
 +		// if this is a tag service, update all services that refer to this tag service
 +		// so that next policy-download from plugins will get updated tag policies
 +		boolean isTagService = serviceDbObj.getType() == EmbeddedServiceDefsUtil.instance().getTagServiceDefId();
 +		if(isTagService) {
 +			List<XXService> referringServices = serviceDao.findByTagServiceId(serviceDbObj.getId());
 +
 +			if(CollectionUtils.isNotEmpty(referringServices)) {
 +				for(XXService referringService : referringServices) {
 +					referringService.setPolicyVersion(getNextVersion(referringService.getPolicyVersion()));
 +					referringService.setPolicyUpdateTime(service.getPolicyUpdateTime());
 +
 +					serviceDao.update(referringService);
 +				}
 +			}
 +		}
  	}
  
- 	private void createNewPolicyItemsForPolicy(RangerPolicy policy, XXPolicy xPolicy, List<RangerPolicyItem>
policyItems, XXServiceDef xServiceDef) {
+ 	private void createNewPolicyItemsForPolicy(RangerPolicy policy, XXPolicy xPolicy, List<RangerPolicyItem>
policyItems, XXServiceDef xServiceDef) throws Exception {
  		
  		for (int itemOrder = 0; itemOrder < policyItems.size(); itemOrder++) {
  			RangerPolicyItem policyItem = policyItems.get(itemOrder);


Mime
View raw message