diff --git a/.ci/appsettings.override.postgres.json b/.ci/appsettings.override.postgres.json index 4e283a0ef2..db969cf1ec 100644 --- a/.ci/appsettings.override.postgres.json +++ b/.ci/appsettings.override.postgres.json @@ -40,7 +40,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { @@ -70,7 +70,7 @@ }, "Messages": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/.ci/appsettings.override.sqlserver.json b/.ci/appsettings.override.sqlserver.json index f5c2508a28..4729176977 100644 --- a/.ci/appsettings.override.sqlserver.json +++ b/.ci/appsettings.override.sqlserver.json @@ -40,7 +40,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { @@ -70,7 +70,7 @@ }, "Messages": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/AdminApi/src/AdminApi/appsettings.override.json b/AdminApi/src/AdminApi/appsettings.override.json index 359ad05882..ecc0924145 100644 --- a/AdminApi/src/AdminApi/appsettings.override.json +++ b/AdminApi/src/AdminApi/appsettings.override.json @@ -41,7 +41,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/AdminApi/test/AdminApi.Tests.Integration/api.appsettings.local.override.json b/AdminApi/test/AdminApi.Tests.Integration/api.appsettings.local.override.json index 61ca711435..b11165f4dc 100644 --- a/AdminApi/test/AdminApi.Tests.Integration/api.appsettings.local.override.json +++ b/AdminApi/test/AdminApi.Tests.Integration/api.appsettings.local.override.json @@ -21,7 +21,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/BuildingBlocks/src/DevelopmentKit.Identity/ValueObjects/IdentityAddress.cs b/BuildingBlocks/src/DevelopmentKit.Identity/ValueObjects/IdentityAddress.cs index 146fc9b57c..7c124e6881 100644 --- a/BuildingBlocks/src/DevelopmentKit.Identity/ValueObjects/IdentityAddress.cs +++ b/BuildingBlocks/src/DevelopmentKit.Identity/ValueObjects/IdentityAddress.cs @@ -67,13 +67,13 @@ public static bool IsValid(string? stringValue) return checksumIsValid; } - public static IdentityAddress Create(byte[] publicKey, string instanceUrl) + public static IdentityAddress Create(byte[] publicKey, string didDomainName) { var hashedPublicKey = SHA256.HashData(SHA512.HashData(publicKey))[..10]; var identitySpecificPart = Hex(hashedPublicKey); - var mainPhrase = $"did:e:{instanceUrl}:dids:{identitySpecificPart}"; + var mainPhrase = $"did:e:{didDomainName}:dids:{identitySpecificPart}"; var checksum = CalculateChecksum(mainPhrase); return new IdentityAddress((mainPhrase + checksum).ToLower()); @@ -124,7 +124,7 @@ public static implicit operator IdentityAddress(string stringValue) return ParseUnsafe(stringValue); } - [GeneratedRegex($@"^(?did:e:(?(?:[a-z0-9]+\.)*[a-z]{{2,}}):dids:(?[0-9a-f]{{20}}))(?[0-9a-f]{{{CHECKSUM_LENGTH_S}}})$")] + [GeneratedRegex($@"^(?did:e:(?(?:[a-z0-9]+\.)*[a-z]{{2,}}):dids:(?[0-9a-f]{{20}}))(?[0-9a-f]{{{CHECKSUM_LENGTH_S}}})$")] private static partial Regex IdentityAddressValidatorRegex(); #endregion diff --git a/BuildingBlocks/test/DevelopmentKit.Identity.Tests/IdentityAddressTests.cs b/BuildingBlocks/test/DevelopmentKit.Identity.Tests/IdentityAddressTests.cs index bb7b6a6bba..88352edf2b 100644 --- a/BuildingBlocks/test/DevelopmentKit.Identity.Tests/IdentityAddressTests.cs +++ b/BuildingBlocks/test/DevelopmentKit.Identity.Tests/IdentityAddressTests.cs @@ -47,7 +47,7 @@ public void IsValidReturnsFalseForInvalidAddress(string identityAddress) public void AddressIsCreatedCorrectly() { var testData = TestData.Valid(); - var address = IdentityAddress.Create(testData.PublicKey, testData.InstanceUrl); + var address = IdentityAddress.Create(testData.PublicKey, testData.DidDomainName); address.Value.Should().Be(testData.Address); } @@ -56,7 +56,7 @@ public void AddressIsCreatedCorrectly() public void EfConverterWorksCorrectly() { var testData = TestData.Valid(); - var address = IdentityAddress.Create(testData.PublicKey, testData.InstanceUrl); + var address = IdentityAddress.Create(testData.PublicKey, testData.DidDomainName); address.Value.Should().Be(testData.Address); } @@ -91,7 +91,7 @@ public void AddressesWithInvalidMainPartAreDeclined() internal class TestData { - public required string InstanceUrl { get; set; } + public required string DidDomainName { get; set; } public required byte[] PublicKey { get; set; } public required string Address { get; set; } @@ -105,7 +105,7 @@ public static TestData Valid() Address = "did:e:prod.enmeshed.eu:dids:56b3f2a0c202e27229aa87", PublicKey = Convert.FromBase64String("tB9KFp/YqHrom3m5qUuZsd6l30DkaNjN14SxRw7YZuI="), Checksum = "87", - InstanceUrl = "prod.enmeshed.eu" + DidDomainName = "prod.enmeshed.eu" }; } @@ -116,7 +116,7 @@ public static TestData WithInvalidMainPart() Address = "did:e:prod.enmeshed.eu:dids:56b3f2a0c202e27d39aa87", PublicKey = Convert.FromBase64String("tB9KFp/YqHrom3m5qUuZsd6l30DkaNjN14SxRw7YZuI="), Checksum = "87", - InstanceUrl = "prod.enmeshed.eu" + DidDomainName = "prod.enmeshed.eu" }; } @@ -127,7 +127,7 @@ public static TestData WithInvalidChecksum() Address = "did:e:prod.enmeshed.eu:dids:56b3f2a0c202e27229aa55", PublicKey = Convert.FromBase64String("tB9KFp/YqHrom3m5qUuZsd6l30DkaNjN14SxRw7YZuI="), Checksum = "55", - InstanceUrl = "prod.enmeshed.eu" + DidDomainName = "prod.enmeshed.eu" }; } } diff --git a/ConsumerApi.Tests.Integration/api.appsettings.local.override.json b/ConsumerApi.Tests.Integration/api.appsettings.local.override.json index a1edfdf4ed..e737daa94b 100644 --- a/ConsumerApi.Tests.Integration/api.appsettings.local.override.json +++ b/ConsumerApi.Tests.Integration/api.appsettings.local.override.json @@ -21,7 +21,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { @@ -38,7 +38,7 @@ }, "Messages": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/ConsumerApi/appsettings.json b/ConsumerApi/appsettings.json index a676272c54..2d6dba2272 100644 --- a/ConsumerApi/appsettings.json +++ b/ConsumerApi/appsettings.json @@ -28,7 +28,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost", + "DidDomainName": "localhost", "Pagination": { "DefaultPageSize": 50, "MaxPageSize": 200 @@ -45,7 +45,7 @@ }, "Messages": { "Application": { - "InstanceUrl": "localhost", + "DidDomainName": "localhost", "MaxNumberOfUnreceivedMessagesFromOneSender": 20, "Pagination": { "DefaultPageSize": 50, diff --git a/ConsumerApi/appsettings.override.json b/ConsumerApi/appsettings.override.json index f2ab336caf..37ea21f48a 100644 --- a/ConsumerApi/appsettings.override.json +++ b/ConsumerApi/appsettings.override.json @@ -46,7 +46,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { @@ -83,7 +83,7 @@ }, "Messages": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/EventHandlerService/src/EventHandlerService/appsettings.override.json b/EventHandlerService/src/EventHandlerService/appsettings.override.json index 7c5e5447f3..2a47a331be 100644 --- a/EventHandlerService/src/EventHandlerService/appsettings.override.json +++ b/EventHandlerService/src/EventHandlerService/appsettings.override.json @@ -33,7 +33,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { @@ -70,7 +70,7 @@ }, "Messages": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/Jobs/src/Job.IdentityDeletion/appsettings.override.json b/Jobs/src/Job.IdentityDeletion/appsettings.override.json index eab126ef63..58dec4ed6c 100644 --- a/Jobs/src/Job.IdentityDeletion/appsettings.override.json +++ b/Jobs/src/Job.IdentityDeletion/appsettings.override.json @@ -33,7 +33,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/Modules/Devices/src/Devices.Application/ApplicationOptions.cs b/Modules/Devices/src/Devices.Application/ApplicationOptions.cs index 08cfd816a7..55bdc5c50e 100644 --- a/Modules/Devices/src/Devices.Application/ApplicationOptions.cs +++ b/Modules/Devices/src/Devices.Application/ApplicationOptions.cs @@ -10,7 +10,7 @@ public class ApplicationOptions [Required] [MinLength(3)] [MaxLength(45)] - public string InstanceUrl { get; set; } = null!; + public string DidDomainName { get; set; } = null!; } public class PaginationOptions diff --git a/Modules/Devices/src/Devices.Application/Identities/Commands/CreateIdentity/Handler.cs b/Modules/Devices/src/Devices.Application/Identities/Commands/CreateIdentity/Handler.cs index 4a159c3ed5..dc6417c6f1 100644 --- a/Modules/Devices/src/Devices.Application/Identities/Commands/CreateIdentity/Handler.cs +++ b/Modules/Devices/src/Devices.Application/Identities/Commands/CreateIdentity/Handler.cs @@ -37,7 +37,7 @@ public async Task Handle(CreateIdentityCommand command, _logger.LogTrace("Challenge successfully validated."); - var address = IdentityAddress.Create(publicKey.Key, _applicationOptions.InstanceUrl); + var address = IdentityAddress.Create(publicKey.Key, _applicationOptions.DidDomainName); _logger.LogTrace("Address created. Result: '{address}'", address); diff --git a/Modules/Devices/src/Devices.Application/Users/Commands/SeedTestUsers/Handler.cs b/Modules/Devices/src/Devices.Application/Users/Commands/SeedTestUsers/Handler.cs index 34c51cae6c..123a308024 100644 --- a/Modules/Devices/src/Devices.Application/Users/Commands/SeedTestUsers/Handler.cs +++ b/Modules/Devices/src/Devices.Application/Users/Commands/SeedTestUsers/Handler.cs @@ -29,7 +29,7 @@ public async Task Handle(SeedTestUsersCommand request, CancellationToken cancell var basicTier = await _tiersRepository.FindBasicTier(cancellationToken); var user = new ApplicationUser(new Device(new Identity("test", - IdentityAddress.Create([1, 1, 1, 1, 1], _applicationOptions.InstanceUrl), + IdentityAddress.Create([1, 1, 1, 1, 1], _applicationOptions.DidDomainName), [1, 1, 1, 1, 1], basicTier!.Id, 1 ), CommunicationLanguage.DEFAULT_LANGUAGE)) { @@ -42,7 +42,7 @@ public async Task Handle(SeedTestUsersCommand request, CancellationToken cancell await _dbContext.Set().AddAsync(user, cancellationToken); user = new ApplicationUser(new Device(new Identity("test", - IdentityAddress.Create([2, 2, 2, 2, 2], _applicationOptions.InstanceUrl), + IdentityAddress.Create([2, 2, 2, 2, 2], _applicationOptions.DidDomainName), [2, 2, 2, 2, 2], basicTier.Id, 1 ), CommunicationLanguage.DEFAULT_LANGUAGE)) { diff --git a/Modules/Messages/src/Messages.Application/ApplicationOptions.cs b/Modules/Messages/src/Messages.Application/ApplicationOptions.cs index 179eaab853..242bec1791 100644 --- a/Modules/Messages/src/Messages.Application/ApplicationOptions.cs +++ b/Modules/Messages/src/Messages.Application/ApplicationOptions.cs @@ -13,7 +13,7 @@ public class ApplicationOptions [Required] [MinLength(3)] [MaxLength(45)] - public string InstanceUrl { get; set; } = null!; + public string DidDomainName { get; set; } = null!; } public class PaginationOptions diff --git a/Modules/Messages/src/Messages.Application/Messages/Commands/AnonymizeMessagesOfIdentity/Handler.cs b/Modules/Messages/src/Messages.Application/Messages/Commands/AnonymizeMessagesOfIdentity/Handler.cs index d10431cbd8..85c3c45cc2 100644 --- a/Modules/Messages/src/Messages.Application/Messages/Commands/AnonymizeMessagesOfIdentity/Handler.cs +++ b/Modules/Messages/src/Messages.Application/Messages/Commands/AnonymizeMessagesOfIdentity/Handler.cs @@ -23,7 +23,7 @@ public async Task Handle(AnonymizeMessagesOfIdentityCommand request, Cancellatio { var messages = await _messagesRepository.Find(Message.WasCreatedBy(request.IdentityAddress), cancellationToken); - var newIdentityAddress = IdentityAddress.Create(Encoding.Unicode.GetBytes(DELETED_IDENTITY_STRING), _applicationOptions.InstanceUrl); + var newIdentityAddress = IdentityAddress.Create(Encoding.Unicode.GetBytes(DELETED_IDENTITY_STRING), _applicationOptions.DidDomainName); foreach (var message in messages) { diff --git a/SseServer/src/SseServer/appsettings.override.json b/SseServer/src/SseServer/appsettings.override.json index e220b9222b..36cde2617f 100644 --- a/SseServer/src/SseServer/appsettings.override.json +++ b/SseServer/src/SseServer/appsettings.override.json @@ -19,7 +19,7 @@ "Modules": { "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/docker-compose/adminui.appsettings.override.json b/docker-compose/adminui.appsettings.override.json index e60d5fb4cb..fe96ab1915 100644 --- a/docker-compose/adminui.appsettings.override.json +++ b/docker-compose/adminui.appsettings.override.json @@ -40,7 +40,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": { diff --git a/docker-compose/consumerapi.appsettings.override.json b/docker-compose/consumerapi.appsettings.override.json index 1964dbddc6..520fa773bb 100644 --- a/docker-compose/consumerapi.appsettings.override.json +++ b/docker-compose/consumerapi.appsettings.override.json @@ -45,7 +45,7 @@ }, "Devices": { "Application": { - "InstanceUrl": "localhost" + "DidDomainName": "localhost" }, "Infrastructure": { "SqlDatabase": {