Codebasis als Dateien ins Arbeitsrepo statt als Gitlink

QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142)
getrackt, ohne .gitmodules und ohne erreichbares Remote. Der
Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar
gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege
der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen.

Umstellung:
- Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert
  (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6)
- Gitlink aus dem Index entfernt
- Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB

Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte
bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
This commit is contained in:
Christoph Schwörer
2026-08-26 07:43:51 +02:00
parent 18edae75b6
commit f045b99a25
24664 changed files with 5846716 additions and 1 deletions
@@ -0,0 +1,327 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit.Abstractions;
using Centron.BusinessLogic;
using Centron.BusinessLogic.PasswordManager;
using CentronSoftware.Centron.WebServices.Entities.PasswordManager;
using Centron.Data.Entities.Accounts.HotlineArea;
using Centron.Data.Entities.Administration.Customization;
using Xunit;
using Centron.Interfaces.BL;
using Centron.Data.WebServices.Accounts.HotlineArea;
using Centron.BusinessLogic.WebServices.Accounts.HotlineArea;
using Centron.Interfaces;
using Centron.Interfaces.Administration.Customization;
using Centron.BusinessLogic.WebServices.Administration.Customization;
using Centron.Data.WebServices.Administration.Customization;
using Centron.BusinessLogic.Accounts.HotlineArea;
using Centron.BusinessLogic.WebServices.PasswordManager;
using CentronSoftware.Centron.WebServices.Messages;
using CentronSoftware.Centron.WebServices.RestRequests.PasswordManager;
using NHibernate.Linq;
using Centron.BusinessLogic.Administration.CentronConfigDb;
using Centron.BusinessLogic.Administration.Rights;
using Centron.BusinessLogic.WebServices.Administration.CentronConfigDb;
using Centron.Common.TextCoding;
using CentronSoftware.Centron.WebServices.RestRequests;
namespace Centron.Tests.EndToEnd.Tests.PasswordManager
{
public class PasswordManagerExportTests : EndToEndTest
{
public PasswordManagerExportTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public override void Execute()
{
this.PrepareDatabase();
// Create new password categories in DB
var categories = this.CreateCategories();
var properties = this.CreateCategoryProperties(categories);
// Create instances of the new password categories
var categoryItems = this.CreateTestItems(properties);
var propertyValues = this.CreatePropertiesForItems(categoryItems , properties);
// Call Export method and check if we can retrieve the test data
this.PrepareUserWithSpecialRights();
this.LoadCustomerAccessDataWithObjectData();
}
private void PrepareUserWithSpecialRights()
{
using var session = new BLSession();
session.GetBL<AppRightsBL>().AddRightToRightGroup(UserRightsConst.PasswordManager.EXPORT_ACCESS_AND_PASSWORD_DATA, 40, GetLoggedInUser().User);
}
private void PrepareDatabase()
{
var user = this.GetLoggedInUser();
// Use file instead of config DB
this.WithSession(f => f.GetBL<PasswordManagerWebServiceBL>().UpdatePasswordManagerSettings(user, new PasswordManagerSettingsDTO
{
IsPasswordManagerGuidelineManagementActive = false,
SecondsUntilNewAuthentificationPasswordManagerAccess = 0,
MasterPasswordSaveLocation = MasterPasswordSaveLocation.SecureFile,
MasterPasswordSecureFileName = "TestMasterKey.txt"
}));
var masterkeySaveresult = this.WithSession(f => f.GetBL<CentronConfigurationDbWebServiceBL>().SetHotlineMasterKey(user, "1234ABC567")).ThrowIfError();
Assert.True(masterkeySaveresult);
}
private HotlineCustomCategoryDTO CreateCategories()
{
var user = this.GetLoggedInUser();
using var session = new BLSession();
var hotlineCategoryWebServiceBL = session.GetBL<HotlineCustomCategoryWebserviceBL>();
var serverCategory = new HotlineCustomCategoryDTO()
{
Name = "MyTestServer"
};
var categoryResult = hotlineCategoryWebServiceBL.SaveHotlineCategory(user, serverCategory).ThrowIfError();
return categoryResult;
}
private IList<ModuleCustomPropertyDTO> CreateCategoryProperties(HotlineCustomCategoryDTO category)
{
var user = this.GetLoggedInUser();
using var session = new BLSession();
var passwordManagerBL = session.GetBL<PasswordManagerBL>();
var hotlineModuleCustomPropertyBL = session.GetBL<ModuleCustomPropertyWebServiceBL>();
var moduleCustomProperties = new List<ModuleCustomPropertyDTO>()
{
new ModuleCustomPropertyDTO
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory,
Name = "Bezeichnung",
Category = "MyTestServer",
DataType = CustomizationDataTypes.String,
IsMandatory = true,
SortOrder = 1,
IsVisible = true,
Sealable = false
},
new ModuleCustomPropertyDTO
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory,
Name = "URL",
Category = "MyTestServer",
DataType = CustomizationDataTypes.Hyperlink,
IsMandatory = true,
SortOrder = 1,
IsVisible = true,
Sealable = false
},
new ModuleCustomPropertyDTO
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory,
Name = "Benutzername",
Category = "MyTestServer",
DataType = CustomizationDataTypes.String,
IsMandatory = true,
SortOrder = 1,
IsVisible = true,
Sealable = false
},
new ModuleCustomPropertyDTO
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory,
Name = "Benutzerpasswort",
Category = "MyTestServer",
DataType = CustomizationDataTypes.EncryptedText,
IsMandatory = true,
SortOrder = 1,
IsVisible = true,
Sealable = false
},
new ModuleCustomPropertyDTO
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory,
Name = "Benutzerboolean",
Category = "MyTestServer",
DataType = CustomizationDataTypes.Boolean,
IsMandatory = true,
SortOrder = 1,
IsVisible = true,
Sealable = false
},
new ModuleCustomPropertyDTO
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory,
Name = "Benutzerint",
Category = "MyTestServer",
DataType = CustomizationDataTypes.Integer,
IsMandatory = true,
SortOrder = 1,
IsVisible = true,
Sealable = false
},
new ModuleCustomPropertyDTO
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory,
Name = "Benutzertime",
Category = "MyTestServer",
DataType = CustomizationDataTypes.DateTime,
IsMandatory = true,
SortOrder = 1,
IsVisible = true,
Sealable = false
},
new ModuleCustomPropertyDTO
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory,
Name = "Benutzerdecimal",
Category = "MyTestServer",
DataType = CustomizationDataTypes.Decimal,
IsMandatory = true,
SortOrder = 1,
IsVisible = true,
Sealable = false
}
};
hotlineModuleCustomPropertyBL.SaveCustomPropertyStructure(user, moduleCustomProperties, CentronObjectKindNumeric.HotlineCustomCategory, category.I3D).ThrowIfError();
return hotlineModuleCustomPropertyBL.GetCustomPropertyStructureForModule(user,
new CustomPropertyFilter()
{
ObjectI3D = category.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustomCategory
}).ThrowIfError();
}
private List<HotlineCustomItemDTO> CreateTestItems(IList<ModuleCustomPropertyDTO> properties)
{
var user = this.GetLoggedInUser();
using var session = new BLSession();
var passwordManagerBL = session.GetBL<PasswordManagerBL>();
var hotlineCategoryWebServiceBL = session.GetBL<HotlineCustomCategoryWebserviceBL>();
var hotlineItemWebServiceBL = session.GetBL<HotlineCustomItemWebserviceBL>();
var test01 = new HotlineCustomItemDTO()
{
Name = "Zugang TestServer Kunde01",
HotlineCustomCategoryI3D = properties.First().ObjectI3D.Value,
CustomerI3D = 10010,
IsActive = true
};
var test02 = new HotlineCustomItemDTO()
{
Name = "Zugang TestServer Kunde02",
HotlineCustomCategoryI3D = properties.First().ObjectI3D.Value,
CustomerI3D = 10011,
IsActive = true
};
var savedItems = new List<HotlineCustomItemDTO>();
var result1 = hotlineItemWebServiceBL.SaveHotlineItem(user, test01).ThrowIfError();
var result2 = hotlineItemWebServiceBL.SaveHotlineItem(user, test02).ThrowIfError();
savedItems.Add(result1);
savedItems.Add(result2);
return savedItems;
}
private List<ModuleCustomPropertyValueDTO> CreatePropertiesForItems(List<HotlineCustomItemDTO> items, IList<ModuleCustomPropertyDTO> properties)
{
var user = this.GetLoggedInUser();
using var session = new BLSession();
var passwordManagerBL = session.GetBL<PasswordManagerBL>();
var customPropertyValueBL = session.GetBL<ModuleCustomPropertyValueWebServiceBL>();
var savedPropertyValues = new List<ModuleCustomPropertyValueDTO>();
var configurationBL = session.GetBL<CentronConfigurationDbBL>();
configurationBL.SetHotlineMasterKey(user, "1234ABC567");
foreach (var item in items)
{
foreach (var property in properties)
{
var propertyValue = new ModuleCustomPropertyValueDTO
{
ObjectI3D = item.I3D,
ModuleCustomPropertyI3D = property.I3D,
ObjectKind = CentronObjectKindNumeric.HotlineCustom,
};
switch (property.DataType)
{
case CustomizationDataTypes.String:
propertyValue.ValueString = $"Test value for {property.Name} on {item.Name}";
break;
case CustomizationDataTypes.EncryptedText:
propertyValue.ValueEncryptedString = $"Encrypted value for {property.Name}"; // Gets encrypted by SaveCustomPropertyValue method
break;
case CustomizationDataTypes.Boolean:
propertyValue.ValueBoolean = true;
break;
case CustomizationDataTypes.Integer:
propertyValue.ValueInteger = 123;
break;
case CustomizationDataTypes.Decimal:
propertyValue.ValueDecimal = 1.23m;
break;
case CustomizationDataTypes.DateTime:
propertyValue.ValueDateTime = DateTime.Now;
break;
case CustomizationDataTypes.Hyperlink:
propertyValue.ValueText = "https://10.10.10.10:1010";
break;
default:
break;
}
var savedValue = customPropertyValueBL.SaveCustomPropertyValue(propertyValue).ThrowIfError();
savedPropertyValues.Add(savedValue);
}
}
return savedPropertyValues;
}
private void LoadCustomerAccessDataWithObjectData()
{
using var session = new BLSession();
var passwordManagerWebServiceBL = session.GetBL<PasswordManagerWebServiceBL>();
var user = this.GetLoggedInUser();
var exportType = CustomerAccessDataExportType.DataObjects;
var customerAccessData = new List<CustomerAccessDataExportDTO>();
foreach (var customerI3D in new List<int>() { 10010, 10011 } )
{
var newAccessData = passwordManagerWebServiceBL.GetCustomerAccessDataForExport(
user,
new GetCustomerAccessDataForExportRequest()
{
CustomerI3D = customerI3D,
ExportType = exportType,
IncludeFileData = false,
IncludeImageData = false
}
).ThrowIfError();
customerAccessData.AddRange(newAccessData);
}
this.Verifier.Verify("customerAccessData", customerAccessData);
}
}
}
@@ -0,0 +1,232 @@
[
{
CategoryI3D: 2,
CategoryItemsData: [
{
HotlineCustomItemID: 10,
HotlineCustomItemName: 'Zugang TestServer Kunde01',
I3D: 0,
Properties: [
{
EncryptedString: null,
PropertyDataType: 4,
PropertyName: 'Bezeichnung',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: 'Test value for Bezeichnung on Zugang TestServer Kunde01'
},
{
EncryptedString: null,
PropertyDataType: 10,
PropertyName: 'URL',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: 'https://10.10.10.10:1010'
},
{
EncryptedString: null,
PropertyDataType: 4,
PropertyName: 'Benutzername',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: 'Test value for Benutzername on Zugang TestServer Kunde01'
},
{
EncryptedString: 'Encrypted value for Benutzerpasswort',
PropertyDataType: 8,
PropertyName: 'Benutzerpasswort',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: null
},
{
EncryptedString: null,
PropertyDataType: 5,
PropertyName: 'Benutzerboolean',
ValueBoolean: true,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: null
},
{
EncryptedString: null,
PropertyDataType: 1,
PropertyName: 'Benutzerint',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: 123,
ValueString: null
},
{
EncryptedString: null,
PropertyDataType: 3,
PropertyName: 'Benutzertime',
ValueBoolean: null,
ValueDateTime: DateTime,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: null
},
{
EncryptedString: null,
PropertyDataType: 2,
PropertyName: 'Benutzerdecimal',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: 1.23,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: null
}
]
}
],
CategoryItemsTableCSV: null,
CategoryItemsTableXLSX: null,
CategoryName: 'MyTestServer',
CustomerAccessDataExportType: 2,
ExportErrorMessage: null,
I3D: 0,
ItemFilesAndImages: []
},
{
CategoryI3D: 2,
CategoryItemsData: [
{
HotlineCustomItemID: 11,
HotlineCustomItemName: 'Zugang TestServer Kunde02',
I3D: 0,
Properties: [
{
EncryptedString: null,
PropertyDataType: 4,
PropertyName: 'Bezeichnung',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: 'Test value for Bezeichnung on Zugang TestServer Kunde02'
},
{
EncryptedString: null,
PropertyDataType: 10,
PropertyName: 'URL',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: 'https://10.10.10.10:1010'
},
{
EncryptedString: null,
PropertyDataType: 4,
PropertyName: 'Benutzername',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: 'Test value for Benutzername on Zugang TestServer Kunde02'
},
{
EncryptedString: 'Encrypted value for Benutzerpasswort',
PropertyDataType: 8,
PropertyName: 'Benutzerpasswort',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: null
},
{
EncryptedString: null,
PropertyDataType: 5,
PropertyName: 'Benutzerboolean',
ValueBoolean: true,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: null
},
{
EncryptedString: null,
PropertyDataType: 1,
PropertyName: 'Benutzerint',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: 123,
ValueString: null
},
{
EncryptedString: null,
PropertyDataType: 3,
PropertyName: 'Benutzertime',
ValueBoolean: null,
ValueDateTime: DateTime,
ValueDecimal: null,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: null
},
{
EncryptedString: null,
PropertyDataType: 2,
PropertyName: 'Benutzerdecimal',
ValueBoolean: null,
ValueDateTime: null,
ValueDecimal: 1.23,
ValueFile: null,
ValueImage: null,
ValueInteger: null,
ValueString: null
}
]
}
],
CategoryItemsTableCSV: null,
CategoryItemsTableXLSX: null,
CategoryName: 'MyTestServer',
CustomerAccessDataExportType: 2,
ExportErrorMessage: null,
I3D: 0,
ItemFilesAndImages: []
}
]