tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static void updateAwsRolePolicyAssociationOnSDBDelete(String sdb,Map<String,String> acessInfo,String token){
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
				put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER).toString()).
				put(LogMessage.ACTION, "updateAwsRolePolicyAssociation OnSDBDelete").
				put(LogMessage.MESSAGE, "trying updateAwsRolePolicyAssociationOnSDBDelete").
				put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL).toString()).
				build()));
		if(acessInfo!=null){
			String folders[] = sdb.split("[/]+");
			String r_policy = "r_";
			String w_policy = "w_";
			String d_policy = "d_";
			if (folders.length > 0) {
				for (int index = 0; index < folders.length; index++) {
					if (index == folders.length -1 ) {
						r_policy += folders[index];
						w_policy += folders[index];
						d_policy += folders[index];
					}
					else {
						r_policy += folders[index]  +"_";
						w_policy += folders[index] +"_";
						d_policy += folders[index] +"_";
					}
				}
			}	

			updateAwsRolePolicyOnSDBDelete(r_policy,d_policy,w_policy, token, acessInfo);		
		}
	}
// Not using this method and decided to delete the role instead with the concept that you cant have same role used by different safe.S
Not using this method and decided to delete the role instead with the concept that you cant have same role used by different safe.S
Not using this method and decided to delete the role instead with the concept that you cant have same role used by different safe . S
public static void updateAwsRolePolicyAssociationOnSDBDelete(String sdb,Map<String,String> acessInfo,String token){
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
				put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER).toString()).
				put(LogMessage.ACTION, "updateAwsRolePolicyAssociation OnSDBDelete").
				put(LogMessage.MESSAGE, "trying updateAwsRolePolicyAssociationOnSDBDelete").
				put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL).toString()).
				build()));
		if(acessInfo!=null){
			String folders[] = sdb.split("[/]+");
			String r_policy = "r_";
			String w_policy = "w_";
			String d_policy = "d_";
			if (folders.length > 0) {
				for (int index = 0; index < folders.length; index++) {
					if (index == folders.length -1 ) {
						r_policy += folders[index];
						w_policy += folders[index];
						d_policy += folders[index];
					}
					else {
						r_policy += folders[index]  +"_";
						w_policy += folders[index] +"_";
						d_policy += folders[index] +"_";
					}
				}
			}	
			updateAwsRolePolicyOnSDBDelete(r_policy,d_policy,w_policy, token, acessInfo);		
		}
	}
public static void updateAwsRolePolicyAssociationOnSDBDelete ( String sdb , Map < String , String > acessInfo , String token ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) . toString ( ) ) . put ( LogMessage . ACTION , "updateAwsRolePolicyAssociation OnSDBDelete" ) . put ( LogMessage . MESSAGE , "trying updateAwsRolePolicyAssociationOnSDBDelete" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) . toString ( ) ) . build ( ) ) ) ; if ( acessInfo != null ) { String folders [ ] = sdb . split ( "[/]+" ) ; String r_policy = "r_" ; String w_policy = "w_" ; String d_policy = "d_" ; if ( folders . length > 0 ) { for ( int index = 0 ; index < folders . length ; index ++ ) { if ( index == folders . length - 1 ) { r_policy += folders [ index ] ; w_policy += folders [ index ] ; d_policy += folders [ index ] ; } else { r_policy += folders [ index ] + "_" ; w_policy += folders [ index ] + "_" ; d_policy += folders [ index ] + "_" ; } } } updateAwsRolePolicyOnSDBDelete ( r_policy , d_policy , w_policy , token , acessInfo ) ; } }
Not using this method and decided to delete the role instead with the concept that you cant have same role used by different safe.S
Not using this method and decided to delete the role instead with the concept that you cant have same role used by different safe . S