<commit_before>package eu.bcvsolutions.idm.acc.service.api;

import eu.bcvsolutions.idm.acc.domain.AccountOperationType;
import eu.bcvsolutions.idm.acc.domain.SystemEntityType;
import eu.bcvsolutions.idm.acc.domain.SystemOperationType;
import eu.bcvsolutions.idm.acc.entity.AccAccount;
import eu.bcvsolutions.idm.acc.entity.AccIdentityAccount;
import eu.bcvsolutions.idm.acc.entity.SysSystem;
import eu.bcvsolutions.idm.core.api.entity.AbstractEntity;
import eu.bcvsolutions.idm.core.model.dto.PasswordChangeDto;
import eu.bcvsolutions.idm.core.model.entity.IdmIdentity;
import eu.bcvsolutions.idm.icf.api.IcfUidAttribute;
import eu.bcvsolutions.idm.security.api.domain.GuardedString;

public interface SysProvisioningService {

	/**
	 * Do provisioning for given identity on all connected systems
	 * 
	 * @param identity
	 */
	void doIdentityProvisioning(IdmIdentity identity);

	/**
	 * Do delete provisioning for given account on connected system
	 * 
	 * @param account
	 */
	void deleteAccount(AccAccount account);
	
	/**
	 * 
	 * Change password for selected identity accounts.
	 * @param identity
	 * @param passwordChange
	 */
	void changePassword(IdmIdentity identity, PasswordChangeDto passwordChange);
	
	/**
	 * Do provisioning only for single attribute. For example, it is needed to change password 
	 * @param uid
	 * @param idmPropertyName
	 * @param value
	 * @param system
	 * @param operationType
	 * @param entityType
	 */
	void doProvisioningForAttribute(String uid, String idmPropertyName, Object value, SysSystem system, 
			AccountOperationType operationType, SystemEntityType entityType,  AbstractEntity entity);

	
	/**
	 * Do authenticate check for given identityAccount on target resource. Username for check is get from account (attribute UID) linked in identityAccount.
	 * @param identityAccount
	 * @param system
	 * @return
	 */
	IcfUidAttribute authenticate(AccIdentityAccount identityAccount, SysSystem system);
	
	/**
	 * Do authenticate check for given username and password on target resource
	 * @param username
	 * @param password
	 * @param system
	 * @param operationType
	 * @param entityType
	 * @return
	 */
	IcfUidAttribute authenticate(String username, GuardedString password, SysSystem system,
			SystemOperationType operationType, SystemEntityType entityType);
	<commit_msg>Extended provisioning service by new method for provisioning by IdentityAccount and Account<commit_after>package eu.bcvsolutions.idm.acc.service.api;

import eu.bcvsolutions.idm.acc.domain.AccountOperationType;
import eu.bcvsolutions.idm.acc.domain.SystemEntityType;
import eu.bcvsolutions.idm.acc.domain.SystemOperationType;
import eu.bcvsolutions.idm.acc.entity.AccAccount;
import eu.bcvsolutions.idm.acc.entity.AccIdentityAccount;
import eu.bcvsolutions.idm.acc.entity.SysSystem;
import eu.bcvsolutions.idm.core.api.entity.AbstractEntity;
import eu.bcvsolutions.idm.core.model.dto.PasswordChangeDto;
import eu.bcvsolutions.idm.core.model.entity.IdmIdentity;
import eu.bcvsolutions.idm.icf.api.IcfUidAttribute;
import eu.bcvsolutions.idm.security.api.domain.GuardedString;

public interface SysProvisioningService {

	/**
	 * Do provisioning for given identity on all connected systems
	 * 
	 * @param identity
	 */
	void doProvisioning(IdmIdentity identity);
	
	/**
	 * Do provisioning for given account on connected system
	 * 
	 * @param account
	 */
	void doProvisioning(AccAccount account);
	
	/**
	 * Do provisioning for given identity account
	 * 
	 * @param identityAccount
	 */
	void doProvisioning(AccIdentityAccount identityAccount);

	/**
	 * Do delete provisioning for given account on connected system
	 * 
	 * @param account
	 */
	void doDeleteProvisioning(AccAccount account);
	
	/**
	 * 
	 * Change password for selected identity accounts.
	 * @param identity
	 * @param passwordChange
	 */
	void changePassword(IdmIdentity identity, PasswordChangeDto passwordChange);
	
	/**
	 * Do provisioning only for single attribute. For example, it is needed to change password 
	 * @param uid
	 * @param idmPropertyName
	 * @param value
	 * @param system
	 * @param operationType
	 * @param entityType
	 */
	void doProvisioningForAttribute(String uid, String idmPropertyName, Object value, SysSystem system, 
			AccountOperationType operationType, SystemEntityType entityType,  AbstractEntity entity);

	
	/**
	 * Do authenticate check for given identityAccount on target resource. Username for check is get from account (attribute UID) linked in identityAccount.
	 * @param identityAccount
	 * @param system
	 * @return
	 */
	IcfUidAttribute authenticate(AccIdentityAccount identityAccount, SysSystem system);
	
	/**
	 * Do authenticate check for given username and password on target resource
	 * @param username
	 * @param password
	 * @param system
	 * @param operationType
	 * @param entityType
	 * @return
	 */
	IcfUidAttribute authenticate(String username, GuardedString password, SysSystem system,
			SystemOperationType operationType, SystemEntityType entityType);

	
{'fraction_non_alphanumeric': 0.08225194649630665, 'fraction_numerical': 0.0, 'mean_word_length': 4.686719636776391, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4632875', 'n_tokens_mistral': 1496, 'n_tokens_neox': 1360, 'n_words': 385}