Skip to content

Commit

Permalink
Created a Contracts project. (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Utar94 authored Jan 24, 2024
1 parent d531616 commit c5ccb02
Show file tree
Hide file tree
Showing 40 changed files with 139 additions and 42 deletions.
10 changes: 8 additions & 2 deletions Identity.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logitar.Identity.Domain.Uni
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logitar.Identity.EFCore.SqlServer.IntegrationTests", "tests\Logitar.Identity.EFCore.SqlServer.IntegrationTests\Logitar.Identity.EFCore.SqlServer.IntegrationTests.csproj", "{FA9AB722-026B-4842-B888-E9824568CBC1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logitar.Identity.Infrastructure.UnitTests", "tests\Logitar.Identity.Infrastructure.UnitTests\Logitar.Identity.Infrastructure.UnitTests.csproj", "{04C669C6-0B63-45A1-8F0F-16A7E7FC023E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logitar.Identity.Infrastructure.UnitTests", "tests\Logitar.Identity.Infrastructure.UnitTests\Logitar.Identity.Infrastructure.UnitTests.csproj", "{04C669C6-0B63-45A1-8F0F-16A7E7FC023E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logitar.Identity.Tests", "tests\Logitar.Identity.Tests\Logitar.Identity.Tests.csproj", "{D0781AC3-5827-4DAE-BBAD-481634FF3C0F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logitar.Identity.Tests", "tests\Logitar.Identity.Tests\Logitar.Identity.Tests.csproj", "{D0781AC3-5827-4DAE-BBAD-481634FF3C0F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logitar.Identity.Contracts", "src\Logitar.Identity.Contracts\Logitar.Identity.Contracts.csproj", "{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -76,6 +78,10 @@ Global
{D0781AC3-5827-4DAE-BBAD-481634FF3C0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0781AC3-5827-4DAE-BBAD-481634FF3C0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0781AC3-5827-4DAE-BBAD-481634FF3C0F}.Release|Any CPU.Build.0 = Release|Any CPU
{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
21 changes: 21 additions & 0 deletions src/Logitar.Identity.Contracts/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Logitar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
46 changes: 46 additions & 0 deletions src/Logitar.Identity.Contracts/Logitar.Identity.Contracts.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>Logitar.Identity.Contracts</Title>
<Authors>Francis Pion</Authors>
<Company>Logitar</Company>
<Product>Logitar.Identity</Product>
<Description>Exposes interfaces and other public contracts of an Identity system.</Description>
<Copyright>© 2024 Logitar All Rights Reserved.</Copyright>
<PackageIcon>logitar.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/Logitar/Identity</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<AssemblyVersion>0.11.3.0</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<Version>0.11.3</Version>
<NeutralLanguage>en-CA</NeutralLanguage>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageReleaseNotes>Created the contracts.</PackageReleaseNotes>
<PackageTags>logitar;net;framework;identity;contracts</PackageTags>
<PackageProjectUrl>https://github.com/Logitar/Identity/tree/main/src/Logitar.Identity.Contracts</PackageProjectUrl>
</PropertyGroup>

<ItemGroup>
<None Update="LICENSE">
<PackagePath>\</PackagePath>
<Pack>True</Pack>
</None>
<None Update="logitar.png">
<PackagePath>\</PackagePath>
<Pack>True</Pack>
</None>
<None Update="README.md">
<PackagePath>\</PackagePath>
<Pack>True</Pack>
</None>
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/Logitar.Identity.Contracts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Logitar.Identity.Contracts

Exposes interfaces and other public contracts of an Identity system.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Logitar.Identity.Domain.Settings;
namespace Logitar.Identity.Contracts.Settings;

/// <summary>
/// The settings used to validate passwords.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Logitar.Identity.Domain.Settings;
namespace Logitar.Identity.Contracts.Settings;

/// <summary>
/// The settings applying to roles.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Logitar.Identity.Domain.Settings;
namespace Logitar.Identity.Contracts.Settings;

/// <summary>
/// The settings used to validate unique names.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Logitar.Identity.Domain.Settings;
namespace Logitar.Identity.Contracts.Settings;

/// <summary>
/// The settings applying to users.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Logitar.Identity.Domain.Users;
namespace Logitar.Identity.Contracts.Users;

/// <summary>
/// Describes postal addresses.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Logitar.Identity.Domain.Users;
namespace Logitar.Identity.Contracts.Users;

/// <summary>
/// Describes email addresses.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Logitar.Identity.Domain.Users;
namespace Logitar.Identity.Contracts.Users;

/// <summary>
/// Describes phone numbers.
Expand Down
Binary file added src/Logitar.Identity.Contracts/logitar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/Logitar.Identity.Domain/Logitar.Identity.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/Logitar/Identity</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<AssemblyVersion>0.11.2.0</AssemblyVersion>
<AssemblyVersion>0.11.3.0</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<Version>0.11.2</Version>
<Version>0.11.3</Version>
<NeutralLanguage>en-CA</NeutralLanguage>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageReleaseNotes>Fixed repositories and tests.</PackageReleaseNotes>
<PackageReleaseNotes>Created a Contracts package.</PackageReleaseNotes>
<PackageTags>logitar;net;framework;identity;domain</PackageTags>
<PackageProjectUrl>https://github.com/Logitar/Identity/tree/main/src/Logitar.Identity.Domain</PackageProjectUrl>
</PropertyGroup>
Expand Down Expand Up @@ -55,6 +55,10 @@
<PackageReference Include="NodaTime" Version="3.1.10" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Logitar.Identity.Contracts\Logitar.Identity.Contracts.csproj" />
</ItemGroup>

<ItemGroup>
<Using Include="System.Collections.Immutable" />
<Using Include="System.Globalization" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using FluentValidation;
using Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Passwords.Validators;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Settings;

/// <summary>
/// Represents a resolver for role settings, allowing developers to customize how those settings are resolved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Settings;

/// <summary>
/// Represents a resolver for user settings, allowing developers to customize how those settings are resolved.
Expand Down
4 changes: 3 additions & 1 deletion src/Logitar.Identity.Domain/Settings/PasswordSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Settings;

/// <summary>
/// The settings used to validate passwords.
Expand Down
4 changes: 3 additions & 1 deletion src/Logitar.Identity.Domain/Settings/RoleSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Settings;

/// <summary>
/// The settings applying to roles.
Expand Down
3 changes: 2 additions & 1 deletion src/Logitar.Identity.Domain/Settings/RoleSettingsResolver.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Configuration;
using Logitar.Identity.Contracts.Settings;
using Microsoft.Extensions.Configuration;

namespace Logitar.Identity.Domain.Settings;

Expand Down
4 changes: 3 additions & 1 deletion src/Logitar.Identity.Domain/Settings/UniqueNameSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Settings;

/// <summary>
/// The settings used to validate unique names.
Expand Down
4 changes: 3 additions & 1 deletion src/Logitar.Identity.Domain/Settings/UserSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Settings;

/// <summary>
/// The settings applying to users.
Expand Down
3 changes: 2 additions & 1 deletion src/Logitar.Identity.Domain/Settings/UserSettingsResolver.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Configuration;
using Logitar.Identity.Contracts.Settings;
using Microsoft.Extensions.Configuration;

namespace Logitar.Identity.Domain.Settings;

Expand Down
2 changes: 1 addition & 1 deletion src/Logitar.Identity.Domain/Shared/UniqueNameUnit.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using FluentValidation;
using Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Shared;

Expand Down
2 changes: 1 addition & 1 deletion src/Logitar.Identity.Domain/Shared/UniqueNameValidator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using FluentValidation;
using Logitar.Identity.Domain.Settings;
using Logitar.Identity.Contracts.Settings;

namespace Logitar.Identity.Domain.Shared;

Expand Down
1 change: 1 addition & 0 deletions src/Logitar.Identity.Domain/Users/AddressUnit.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentValidation;
using Logitar.Identity.Contracts.Users;
using Logitar.Identity.Domain.Users.Validators;

namespace Logitar.Identity.Domain.Users;
Expand Down
1 change: 1 addition & 0 deletions src/Logitar.Identity.Domain/Users/EmailUnit.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentValidation;
using Logitar.Identity.Contracts.Users;
using Logitar.Identity.Domain.Users.Validators;

namespace Logitar.Identity.Domain.Users;
Expand Down
12 changes: 0 additions & 12 deletions src/Logitar.Identity.Domain/Users/IContact.cs

This file was deleted.

3 changes: 2 additions & 1 deletion src/Logitar.Identity.Domain/Users/PhoneExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PhoneNumbers;
using Logitar.Identity.Contracts.Users;
using PhoneNumbers;

namespace Logitar.Identity.Domain.Users;

Expand Down
1 change: 1 addition & 0 deletions src/Logitar.Identity.Domain/Users/PhoneUnit.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentValidation;
using Logitar.Identity.Contracts.Users;
using Logitar.Identity.Domain.Users.Validators;

namespace Logitar.Identity.Domain.Users;
Expand Down
1 change: 1 addition & 0 deletions src/Logitar.Identity.Domain/Users/UserManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using FluentValidation;
using Logitar.EventSourcing;
using Logitar.Identity.Contracts.Settings;
using Logitar.Identity.Domain.Sessions;
using Logitar.Identity.Domain.Settings;
using Logitar.Identity.Domain.Shared;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentValidation;
using Logitar.Identity.Contracts.Users;

namespace Logitar.Identity.Domain.Users.Validators;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentValidation;
using Logitar.Identity.Contracts.Users;

namespace Logitar.Identity.Domain.Users.Validators;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentValidation;
using Logitar.Identity.Contracts.Users;

namespace Logitar.Identity.Domain.Users.Validators;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/Logitar/Identity</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<AssemblyVersion>0.11.1.0</AssemblyVersion>
<AssemblyVersion>0.11.3.0</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<Version>0.11.1</Version>
<Version>0.11.3</Version>
<NeutralLanguage>en-CA</NeutralLanguage>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<PackageReleaseNotes>Added the GetLogitarIdentityJsonConverters method.</PackageReleaseNotes>
<PackageReleaseNotes>Created a Contracts package.</PackageReleaseNotes>
<PackageTags>logitar;net;framework;identity;infrastructure</PackageTags>
<PackageProjectUrl>https://github.com/Logitar/Identity/tree/main/src/Logitar.Identity.Infrastructure</PackageProjectUrl>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentValidation;
using Logitar.Identity.Contracts.Settings;
using Logitar.Identity.Domain.Passwords;
using Logitar.Identity.Domain.Passwords.Validators;
using Logitar.Identity.Domain.Settings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Configuration;
using Logitar.Identity.Contracts.Settings;
using Microsoft.Extensions.Configuration;

namespace Logitar.Identity.Domain.Settings;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Configuration;
using Logitar.Identity.Contracts.Settings;
using Microsoft.Extensions.Configuration;

namespace Logitar.Identity.Domain.Settings;

Expand Down
4 changes: 3 additions & 1 deletion tests/Logitar.Identity.Domain.UnitTests/Users/PhoneMock.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Logitar.Identity.Domain.Users;
using Logitar.Identity.Contracts.Users;

namespace Logitar.Identity.Domain.Users;

internal record PhoneMock : IPhone
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Logitar.Data;
using Logitar.Data.SqlServer;
using Logitar.EventSourcing;
using Logitar.Identity.Contracts.Settings;
using Logitar.Identity.Domain.Sessions;
using Logitar.Identity.Domain.Settings;
using Logitar.Identity.Domain.Shared;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Logitar.Data.SqlServer;
using Logitar.EventSourcing;
using Logitar.EventSourcing.EntityFrameworkCore.Relational;
using Logitar.Identity.Contracts.Settings;
using Logitar.Identity.Domain.Passwords;
using Logitar.Identity.Domain.Roles;
using Logitar.Identity.Domain.Sessions;
Expand Down

0 comments on commit c5ccb02

Please sign in to comment.