tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/IAMServiceAccountsService.java
private boolean isCloudSecurityAdminApproleAction(String token, IAMServiceAccountApprole iamServiceAccountApprole) {

		if (TVaultConstants.CLOUD_SECURITY_IAM_ADMIN_APPROLE.equals(iamServiceAccountApprole.getApprolename())
				&& TVaultConstants.READ_POLICY.equals(iamServiceAccountApprole.getAccess())
				&& TVaultConstants.CLOUD_SECURITY_AZURE_AD_MANAGER_ROLE.equalsIgnoreCase(iamServiceAccountApprole.getIamSvcAccName())
				&& isAuthorizedIAMAdminApprole(token)) {
			log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
					.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
					.put(LogMessage.ACTION, "isCloudSecurityAdminApproleAction")
					.put(LogMessage.MESSAGE, "CloudSecurity approle association to IAM service account AzureADRoleManager")
					.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
			return true;
		}
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, "isCloudSecurityAdminApproleAction")
				.put(LogMessage.MESSAGE, "Access denied: No permission to associate this approle to IAM service account")
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
		return false;
	}
/**
	 * To check if Cloud Security admin approle is being added to AzureADRoleManager IAM service account
	 */
To check if Cloud Security admin approle is being added to AzureADRoleManager IAM service account
To check if Cloud Security admin approle is being added to AzureADRoleManager IAM service account
private boolean isCloudSecurityAdminApproleAction(String token, IAMServiceAccountApprole iamServiceAccountApprole) {
		if (TVaultConstants.CLOUD_SECURITY_IAM_ADMIN_APPROLE.equals(iamServiceAccountApprole.getApprolename())
				&& TVaultConstants.READ_POLICY.equals(iamServiceAccountApprole.getAccess())
				&& TVaultConstants.CLOUD_SECURITY_AZURE_AD_MANAGER_ROLE.equalsIgnoreCase(iamServiceAccountApprole.getIamSvcAccName())
				&& isAuthorizedIAMAdminApprole(token)) {
			log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
					.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
					.put(LogMessage.ACTION, "isCloudSecurityAdminApproleAction")
					.put(LogMessage.MESSAGE, "CloudSecurity approle association to IAM service account AzureADRoleManager")
					.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
			return true;
		}
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, "isCloudSecurityAdminApproleAction")
				.put(LogMessage.MESSAGE, "Access denied: No permission to associate this approle to IAM service account")
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
		return false;
	}
private boolean isCloudSecurityAdminApproleAction ( String token , IAMServiceAccountApprole iamServiceAccountApprole ) { if ( TVaultConstants . CLOUD_SECURITY_IAM_ADMIN_APPROLE . equals ( iamServiceAccountApprole . getApprolename ( ) ) && TVaultConstants . READ_POLICY . equals ( iamServiceAccountApprole . getAccess ( ) ) && TVaultConstants . CLOUD_SECURITY_AZURE_AD_MANAGER_ROLE . equalsIgnoreCase ( iamServiceAccountApprole . getIamSvcAccName ( ) ) && isAuthorizedIAMAdminApprole ( token ) ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "isCloudSecurityAdminApproleAction" ) . put ( LogMessage . MESSAGE , "CloudSecurity approle association to IAM service account AzureADRoleManager" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; return true ; } log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "isCloudSecurityAdminApproleAction" ) . put ( LogMessage . MESSAGE , "Access denied: No permission to associate this approle to IAM service account" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; return false ; }
To check if Cloud Security admin approle is being added to AzureADRoleManager IAM service account
To check if Cloud Security admin approle is being added to AzureADRoleManager IAM service account