Пример #1
0
 public AnonymizerEngine(AnonymizerConfigurationManager configurationManager)
 {
     _configurationManger = configurationManager;
     _processors          = new Dictionary <string, IAnonymizerProcessor>();
     InitializeProcessors(_configurationManger);
     _logger.LogDebug("AnonymizerEngine initialized successfully");
 }
Пример #2
0
 private void InitializeProcessors(AnonymizerConfigurationManager configurationManager)
 {
     _processors[AnonymizerMethod.DateShift.ToString().ToUpperInvariant()]  = DateShiftProcessor.Create(configurationManager);
     _processors[AnonymizerMethod.Redact.ToString().ToUpperInvariant()]     = RedactProcessor.Create(configurationManager);
     _processors[AnonymizerMethod.CryptoHash.ToString().ToUpperInvariant()] = new CryptoHashProcessor(configurationManager.GetParameterConfiguration().CryptoHashKey);
     _processors[AnonymizerMethod.Keep.ToString().ToUpperInvariant()]       = new KeepProcessor();
 }
        public static AnonymizerEngine CreateWithFileContext(string configFilePath, string fileName, string inputFolderName)
        {
            var configurationManager = AnonymizerConfigurationManager.CreateFromConfigurationFile(configFilePath);
            var dateShiftScope       = configurationManager.GetParameterConfiguration().DateShiftScope;
            var dateShiftKeyPrefix   = string.Empty;

            if (dateShiftScope == DateShiftScope.File)
            {
                dateShiftKeyPrefix = Path.GetFileName(fileName);
            }
            else if (dateShiftScope == DateShiftScope.Folder)
            {
                dateShiftKeyPrefix = Path.GetFileName(inputFolderName.TrimEnd('\\', '/'));
            }

            configurationManager.SetDateShiftKeyPrefix(dateShiftKeyPrefix);
            return(new AnonymizerEngine(configurationManager));
        }
Пример #4
0
 public AnonymizerEngine(string configFilePath) : this(AnonymizerConfigurationManager.CreateFromConfigurationFile(configFilePath))
 {
 }
 public AnonymizerEngine(AnonymizerConfigurationManager configurationManager)
 {
     _configurationManger = configurationManager;
     _processors          = new Dictionary <string, IAnonymizerProcessor>();
     InitializeProcessors(_configurationManger);
 }
 private void InitializeProcessors(AnonymizerConfigurationManager configurationManager)
 {
     _processors[AnonymizerMethods.DateShift.ToString().ToUpperInvariant()] = DateShiftProcessor.Create(configurationManager);
     _processors[AnonymizerMethods.Redact.ToString().ToUpperInvariant()]    = RedactProcessor.Create(configurationManager);
     _processors[AnonymizerMethods.Keep.ToString().ToUpperInvariant()]      = new KeepProcessor();
 }