tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/IAMServiceAccountsService.java
private boolean isValidIamSvcaccSecret(IAMServiceAccount iamServiceAccount) {
		if (iamServiceAccount.getSecret() != null) {
			if (iamServiceAccount.getSecret().size() == 0) {
				return false;
			}
			for (IAMSecrets iamSecrets : iamServiceAccount.getSecret()) {
				if (iamSecrets.getAccessKeyId() == null || iamSecrets.getAccessKeyId().length() < 16
						|| iamSecrets.getAccessKeyId().length() > 128) {
					return false;
				}
			}
			// Check for duplicate access keyids
			if (iamServiceAccount.getSecret().size() == 2 &&
					iamServiceAccount.getSecret().get(0).getAccessKeyId().equals(iamServiceAccount.getSecret().get(1).getAccessKeyId())) {
				return false;
			}
		}
		return true;
	}
/**
	 * Method to check the secret in the request is valid if present.
	 * @param iamServiceAccount
	 * @return
	 */
Method to check the secret in the request is valid if present.
Method to check the secret in the request is valid if present .
private boolean isValidIamSvcaccSecret(IAMServiceAccount iamServiceAccount) {
		if (iamServiceAccount.getSecret() != null) {
			if (iamServiceAccount.getSecret().size() == 0) {
				return false;
			}
			for (IAMSecrets iamSecrets : iamServiceAccount.getSecret()) {
				if (iamSecrets.getAccessKeyId() == null || iamSecrets.getAccessKeyId().length() < 16
						|| iamSecrets.getAccessKeyId().length() > 128) {
					return false;
				}
			}
			if (iamServiceAccount.getSecret().size() == 2 &&
					iamServiceAccount.getSecret().get(0).getAccessKeyId().equals(iamServiceAccount.getSecret().get(1).getAccessKeyId())) {
				return false;
			}
		}
		return true;
	}
private boolean isValidIamSvcaccSecret ( IAMServiceAccount iamServiceAccount ) { if ( iamServiceAccount . getSecret ( ) != null ) { if ( iamServiceAccount . getSecret ( ) . size ( ) == 0 ) { return false ; } for ( IAMSecrets iamSecrets : iamServiceAccount . getSecret ( ) ) { if ( iamSecrets . getAccessKeyId ( ) == null || iamSecrets . getAccessKeyId ( ) . length ( ) < 16 || iamSecrets . getAccessKeyId ( ) . length ( ) > 128 ) { return false ; } } if ( iamServiceAccount . getSecret ( ) . size ( ) == 2 && iamServiceAccount . getSecret ( ) . get ( 0 ) . getAccessKeyId ( ) . equals ( iamServiceAccount . getSecret ( ) . get ( 1 ) . getAccessKeyId ( ) ) ) { return false ; } } return true ; }
Method to check the secret in the request is valid if present.
Method to check the secret in the request is valid if present .
// Check for duplicate access keyids