Skip to content

Commit

Permalink
#371 Introduce example Identity domain.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstone committed Sep 9, 2020
1 parent b0c34d2 commit 03e0df5
Show file tree
Hide file tree
Showing 81 changed files with 2,645 additions and 133 deletions.
23 changes: 22 additions & 1 deletion RapidField.SolidInstruments.sln
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments.Example.Domain.AccessControl.Service", "example\RapidField.SolidInstruments.Example.Domain.AccessControl.Service\RapidField.SolidInstruments.Example.Domain.AccessControl.Service.csproj", "{77026FD0-F0DC-48B8-A678-0E67BDCC29EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RapidField.SolidInstruments.Example.BeaconService", "example\RapidField.SolidInstruments.Example.BeaconService\RapidField.SolidInstruments.Example.BeaconService.csproj", "{423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments.Example.BeaconService", "example\RapidField.SolidInstruments.Example.BeaconService\RapidField.SolidInstruments.Example.BeaconService.csproj", "{423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments.Example.Domain.AccessControl.HttpApi", "example\RapidField.SolidInstruments.Example.Domain.AccessControl.HttpApi\RapidField.SolidInstruments.Example.Domain.AccessControl.HttpApi.csproj", "{AC2D0816-3ABF-4458-80DB-E4BADDD9A2E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RapidField.SolidInstruments.Example.Domain.Identity", "example\RapidField.SolidInstruments.Example.Domain.Identity\RapidField.SolidInstruments.Example.Domain.Identity.csproj", "{630F6AC9-3A4C-4B8A-B55D-D44A7BFBB025}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RapidField.SolidInstruments.Example.Domain.Identity.Service", "example\RapidField.SolidInstruments.Example.Domain.Identity.Service\RapidField.SolidInstruments.Example.Domain.Identity.Service.csproj", "{352E9021-1010-4A5D-8435-F8331DA63F95}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -631,6 +637,18 @@ Global
{423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}.Release|Any CPU.Build.0 = Release|Any CPU
{AC2D0816-3ABF-4458-80DB-E4BADDD9A2E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC2D0816-3ABF-4458-80DB-E4BADDD9A2E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC2D0816-3ABF-4458-80DB-E4BADDD9A2E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC2D0816-3ABF-4458-80DB-E4BADDD9A2E0}.Release|Any CPU.Build.0 = Release|Any CPU
{630F6AC9-3A4C-4B8A-B55D-D44A7BFBB025}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{630F6AC9-3A4C-4B8A-B55D-D44A7BFBB025}.Debug|Any CPU.Build.0 = Debug|Any CPU
{630F6AC9-3A4C-4B8A-B55D-D44A7BFBB025}.Release|Any CPU.ActiveCfg = Release|Any CPU
{630F6AC9-3A4C-4B8A-B55D-D44A7BFBB025}.Release|Any CPU.Build.0 = Release|Any CPU
{352E9021-1010-4A5D-8435-F8331DA63F95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{352E9021-1010-4A5D-8435-F8331DA63F95}.Debug|Any CPU.Build.0 = Debug|Any CPU
{352E9021-1010-4A5D-8435-F8331DA63F95}.Release|Any CPU.ActiveCfg = Release|Any CPU
{352E9021-1010-4A5D-8435-F8331DA63F95}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -707,6 +725,9 @@ Global
{7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34}
{77026FD0-F0DC-48B8-A678-0E67BDCC29EB} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34}
{423CCBD1-0299-4C1A-BFDB-05AF2BF4847A} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34}
{AC2D0816-3ABF-4458-80DB-E4BADDD9A2E0} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34}
{630F6AC9-3A4C-4B8A-B55D-D44A7BFBB025} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34}
{352E9021-1010-4A5D-8435-F8331DA63F95} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {834FCFB0-DA00-4ABD-9424-6FE1398A9F6E}
Expand Down
117 changes: 105 additions & 12 deletions cicd/modules/BuildAndDeployment.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ $SolutionConfigurationDebug = "Debug";
$SolutionConfigurationRelease = "Release";

# Namespaces
$ExampleAccessControlHttpApiApplicationNamespace = "RapidField.SolidInstruments.Example.Domain.AccessControl.HttpApi";
$ExampleAccessControlServiceApplicationNamespace = "RapidField.SolidInstruments.Example.Domain.AccessControl.Service";
$ExampleBeaconServiceApplicationNamespace = "RapidField.SolidInstruments.Example.BeaconService";
$ExampleIdentityServiceApplicationNamespace = "RapidField.SolidInstruments.Example.Domain.Identity.Service";

# Regular expressions
$ValidCommitMessageRegularExpressionPattern = "^(#[1-9][0-9]{0,4} )?[A-Z][A-Za-z0-9\,\.\!\;\:\'\""\@\#\$\%\^\&\*\-\+\=_\(\)\[\]\{\}\|\\\/\s]{8,144}$";
Expand All @@ -113,7 +115,8 @@ $RepositoryName = $env:APPVEYOR_REPO_NAME;
$TagName = $env:APPVEYOR_REPO_TAG_NAME;

# Other configuration values
$TargetFrameworkForExampleServiceApplication = "netcoreapp2.1";
$TargetFrameworkForExampleHttpApiApplications = "netcoreapp3.1";
$TargetFrameworkForExampleServiceApplications = "netcoreapp3.1";

# Modules
Import-Module $FilePathForCoreModule -Force;
Expand Down Expand Up @@ -609,7 +612,48 @@ Function SignPackages

<#
.Synopsis
Starts the example access control service application.
Starts the example AccessControl domain HTTP API application.
#>
Function StartExampleAccessControlHttpApiApplication
{
Param
(
[Parameter(Mandatory = $true, Position = 0)]
[String] $SolutionConfiguration
)

ComposeStart "Starting the example AccessControl domain HTTP API application using $SolutionConfiguration configuration.";
$BinaryDirectoryPath = Join-Path -Path "$DirectoryPathForExample" -ChildPath "$ExampleAccessControlHttpApiApplicationNamespace\bin\$SolutionConfiguration\$TargetFrameworkForExampleHttpApiApplications";
$BinaryFileName = "$ExampleAccessControlHttpApiApplicationNamespace.dll";
$BinaryFilePath = Join-Path -Path "$BinaryDirectoryPath" -ChildPath "$BinaryFileName";
ComposeNormal "Using binary path: $BinaryFilePath";
Push-Location "$BinaryDirectoryPath";
Start-Process -ArgumentList "$BinaryFileName" -FilePath "dotnet" -WindowStyle Minimized;
Pop-Location;
ComposeFinish "Finished starting the application.";
}

<#
.Synopsis
Starts the example AccessControl domain HTTP API application in debug mode.
#>
Function StartExampleAccessControlHttpApiApplicationDebug
{
StartExampleAccessControlHttpApiApplication -SolutionConfiguration $SolutionConfigurationDebug;
}

<#
.Synopsis
Starts the example AccessControl domain HTTP API application in release mode.
#>
Function StartExampleAccessControlHttpApiApplicationRelease
{
StartExampleAccessControlHttpApiApplication -SolutionConfiguration $SolutionConfigurationRelease;
}

<#
.Synopsis
Starts the example AccessControl domain service application.
#>
Function StartExampleAccessControlServiceApplication
{
Expand All @@ -619,16 +663,20 @@ Function StartExampleAccessControlServiceApplication
[String] $SolutionConfiguration
)

ComposeStart "Starting the example access control service application using $SolutionConfiguration configuration.";
$BinaryFilePath = Join-Path -Path "$DirectoryPathForExample" -ChildPath "$ExampleServiceApplicationNamespace\bin\$SolutionConfiguration\$TargetFrameworkForExampleServiceApplication\$ExampleAccessControlServiceApplicationNamespace.dll";
ComposeStart "Starting the example AccessControl domain service application using $SolutionConfiguration configuration.";
$BinaryDirectoryPath = Join-Path -Path "$DirectoryPathForExample" -ChildPath "$ExampleAccessControlServiceApplicationNamespace\bin\$SolutionConfiguration\$TargetFrameworkForExampleServiceApplications";
$BinaryFileName = "$ExampleAccessControlServiceApplicationNamespace.dll";
$BinaryFilePath = Join-Path -Path "$BinaryDirectoryPath" -ChildPath "$BinaryFileName";
ComposeNormal "Using binary path: $BinaryFilePath";
Start-Process -ArgumentList "$BinaryFilePath" -FilePath "dotnet" -WindowStyle Minimized;
Push-Location "$BinaryDirectoryPath";
Start-Process -ArgumentList "$BinaryFileName" -FilePath "dotnet" -WindowStyle Minimized;
Pop-Location;
ComposeFinish "Finished starting the application.";
}

<#
.Synopsis
Starts the example access control service application in debug mode.
Starts the example AccessControl domain service application in debug mode.
#>
Function StartExampleAccessControlServiceApplicationDebug
{
Expand All @@ -637,7 +685,7 @@ Function StartExampleAccessControlServiceApplicationDebug

<#
.Synopsis
Starts the example access control service application in release mode.
Starts the example AccessControl domain service application in release mode.
#>
Function StartExampleAccessControlServiceApplicationRelease
{
Expand All @@ -646,7 +694,7 @@ Function StartExampleAccessControlServiceApplicationRelease

<#
.Synopsis
Starts the example beacon service application.
Starts the example Beacon service application.
#>
Function StartExampleBeaconServiceApplication
{
Expand All @@ -657,15 +705,19 @@ Function StartExampleBeaconServiceApplication
)

ComposeStart "Starting the example beacon service application using $SolutionConfiguration configuration.";
$BinaryFilePath = Join-Path -Path "$DirectoryPathForExample" -ChildPath "$ExampleServiceApplicationNamespace\bin\$SolutionConfiguration\$TargetFrameworkForExampleServiceApplication\$ExampleBeaconServiceApplicationNamespace.dll";
$BinaryDirectoryPath = Join-Path -Path "$DirectoryPathForExample" -ChildPath "$ExampleBeaconServiceApplicationNamespace\bin\$SolutionConfiguration\$TargetFrameworkForExampleServiceApplications";
$BinaryFileName = "$ExampleBeaconServiceApplicationNamespace.dll";
$BinaryFilePath = Join-Path -Path "$BinaryDirectoryPath" -ChildPath "$BinaryFileName";
ComposeNormal "Using binary path: $BinaryFilePath";
Start-Process -ArgumentList "$BinaryFilePath" -FilePath "dotnet" -WindowStyle Minimized;
Push-Location "$BinaryDirectoryPath";
Start-Process -ArgumentList "$BinaryFileName" -FilePath "dotnet" -WindowStyle Minimized;
Pop-Location;
ComposeFinish "Finished starting the application.";
}

<#
.Synopsis
Starts the example beacon service application in debug mode.
Starts the example Beacon service application in debug mode.
#>
Function StartExampleBeaconServiceApplicationDebug
{
Expand All @@ -674,13 +726,54 @@ Function StartExampleBeaconServiceApplicationDebug

<#
.Synopsis
Starts the example beacon service application in release mode.
Starts the example Beacon service application in release mode.
#>
Function StartExampleBeaconServiceApplicationRelease
{
StartExampleBeaconServiceApplication -SolutionConfiguration $SolutionConfigurationRelease;
}

<#
.Synopsis
Starts the example Identity domain service application.
#>
Function StartExampleIdentityServiceApplication
{
Param
(
[Parameter(Mandatory = $true, Position = 0)]
[String] $SolutionConfiguration
)

ComposeStart "Starting the example Identity domain service application using $SolutionConfiguration configuration.";
$BinaryDirectoryPath = Join-Path -Path "$DirectoryPathForExample" -ChildPath "$ExampleIdentityServiceApplicationNamespace\bin\$SolutionConfiguration\$TargetFrameworkForExampleServiceApplications";
$BinaryFileName = "$ExampleIdentityServiceApplicationNamespace.dll";
$BinaryFilePath = Join-Path -Path "$BinaryDirectoryPath" -ChildPath "$BinaryFileName";
ComposeNormal "Using binary path: $BinaryFilePath";
Push-Location "$BinaryDirectoryPath";
Start-Process -ArgumentList "$BinaryFileName" -FilePath "dotnet" -WindowStyle Minimized;
Pop-Location;
ComposeFinish "Finished starting the application.";
}

<#
.Synopsis
Starts the example Identity domain service application in debug mode.
#>
Function StartExampleIdentityServiceApplicationDebug
{
StartExampleIdentityServiceApplication -SolutionConfiguration $SolutionConfigurationDebug;
}

<#
.Synopsis
Starts the example Identity domain service application in release mode.
#>
Function StartExampleIdentityServiceApplicationRelease
{
StartExampleIdentityServiceApplication -SolutionConfiguration $SolutionConfigurationRelease;
}

<#
.Synopsis
Stops all running .NET applications.
Expand Down
7 changes: 5 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ This path contains sample projects that utilize the **Solid Instruments** [const

- [`RapidField.SolidInstruments.Example.BeaconService`](/example/RapidField.SolidInstruments.Example.BeaconService) demonstrates a utility service that publishes scheduled heartbeat messages.
- [`RapidField.SolidInstruments.Example.Domain`](/example/RapidField.SolidInstruments.Example.Domain) houses a sample collection of shared domain models that utilize the **Solid Instruments** [messaging](../src/RapidField.SolidInstruments.Messaging/README.md) constructs.
- [`RapidField.SolidInstruments.Example.Domain.AccessControl`](/example/RapidField.SolidInstruments.Example.Domain.AccessControl) demonstrates access control domain logic utilizing the **Solid Instruments** [data access](../src/RapidField.SolidInstruments.DataAccess/README.md) constructs.
- [`RapidField.SolidInstruments.Example.Domain.AccessControl.Service`](/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service) demonstrates an access control domain service utilizing the **Solid Instruments** [data access](../src/RapidField.SolidInstruments.DataAccess/README.md) and [messaging](../src/RapidField.SolidInstruments.Messaging/README.md) constructs.
- [`RapidField.SolidInstruments.Example.Domain.AccessControl`](/example/RapidField.SolidInstruments.Example.Domain.AccessControl) demonstrates AccessControl domain logic utilizing the **Solid Instruments** [data access](../src/RapidField.SolidInstruments.DataAccess/README.md) constructs.
- [`RapidField.SolidInstruments.Example.Domain.AccessControl.HttpApi`](/example/RapidField.SolidInstruments.Example.Domain.AccessControl.HttpApi) demonstrates an AccessControl domain HTTP API utilizing the **Solid Instruments** [data access](../src/RapidField.SolidInstruments.DataAccess/README.md) and [messaging](../src/RapidField.SolidInstruments.Messaging/README.md) constructs.
- [`RapidField.SolidInstruments.Example.Domain.AccessControl.Service`](/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service) demonstrates an AccessControl domain service utilizing the **Solid Instruments** [data access](../src/RapidField.SolidInstruments.DataAccess/README.md) and [messaging](../src/RapidField.SolidInstruments.Messaging/README.md) constructs.
- [`RapidField.SolidInstruments.Example.Domain.Identity`](/example/RapidField.SolidInstruments.Example.Domain.Identity) demonstrates Identity domain logic utilizing the **Solid Instruments** [data access](../src/RapidField.SolidInstruments.DataAccess/README.md) constructs.
- [`RapidField.SolidInstruments.Example.Domain.Identity.Service`](/example/RapidField.SolidInstruments.Example.Domain.Identity.Service) demonstrates an Identity domain service utilizing the **Solid Instruments** [data access](../src/RapidField.SolidInstruments.DataAccess/README.md) and [messaging](../src/RapidField.SolidInstruments.Messaging/README.md) constructs.

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.8" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RapidField.SolidInstruments.Example.Domain\RapidField.SolidInstruments.Example.Domain.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using RapidField.SolidInstruments.InversionOfControl;
using RapidField.SolidInstruments.InversionOfControl.DotNetNative;
using System.Collections.Generic;

namespace RapidField.SolidInstruments.Example.Domain.AccessControl.HttpApi
{
/// <summary>
/// Encapsulates container configuration for the application.
/// </summary>
public class ApplicationDependencyPackage : DotNetNativeDependencyPackage
{
/// <summary>
/// Initializes a new instance of the <see cref="ApplicationDependencyPackage" /> class.
/// </summary>
public ApplicationDependencyPackage()
: base()
{
return;
}

/// <summary>
/// Creates a new collection of dependency modules for the package.
/// </summary>
/// <param name="applicationConfiguration">
/// Configuration information for the application.
/// </param>
/// <returns>
/// The package's dependency modules.
/// </returns>
protected override IEnumerable<IDependencyModule<ServiceCollection>> CreateModules(IConfiguration applicationConfiguration) => new IDependencyModule<ServiceCollection>[]
{
new DatabaseContextDependencyModule(applicationConfiguration),
new ServiceBusDependencyModule(applicationConfiguration),
new MessageHandlerModule(applicationConfiguration)
};
}
}
Loading

0 comments on commit 03e0df5

Please sign in to comment.