Commit Graph

185 Commits

Author SHA1 Message Date
bdf68b6bc4 Bump version to 1.0.2
Updated project version from 1.0.1 to 1.0.2 in the `.csproj` file.
This includes changes to `<Version>`, `<AssemblyVersion>`, and
`<FileVersion>` to reflect a minor update or patch.
2026-05-29 10:24:12 +02:00
c69635fc43 Refactor and enhance CookieNamesTests methods
Refactored and renamed several test methods in `CookieNamesTests` to improve clarity and align with updated functionality. Replaced methods testing `GetEnvelopeReceiverKeyOrDefault` with new methods for `GetEnvelopeReceiverCookieName` and `GetEnvelopeKeyOrDefault`. Added new tests to validate behavior with default cookie names and incorrect bases. Renamed `TryGetEnvelopeReceiverKey` methods to `TryGetEnvelopeKey` for consistency, while maintaining their functionality.
2026-05-29 10:21:50 +02:00
98fbbea5c3 Refactor cookie name methods and update tests
Renamed and refactored methods in `CookieNames` to improve naming consistency and simplify usage. Added overloads with default `defaultCookieName` set to `"AuthToken"`. Updated XML documentation to reflect these changes.

Updated `CookieNamesTests` to use the new method names and signatures. Adjusted test cases to align with the new default behavior and ensure compatibility.

These changes enhance code readability, reduce redundancy, and standardize method naming conventions.
2026-05-29 10:21:27 +02:00
f455241af1 Add unit tests for CookieNames class functionality
Added a new `CookieNamesTests` class to validate methods in the
`CookieNames` class, including scenarios for generating and
extracting cookie names and keys. Tests cover valid, invalid,
and unrelated cookie names, as well as round-trip validation
of `GetEnvelopeReceiverCookieName` and `GetEnvelopeReceiverKeyOrDefault`.

Updated `DigitalData.Auth.Tests.csproj` to include a project
reference to `DigitalData.Auth.Claims` for testing purposes.
2026-05-29 09:50:24 +02:00
2551de233f Refactor cookie handling and bump version to 1.0.1
Refactored `CookieNames.cs` to replace the `GetEnvelopeReceiverCookieName(string key)` method with new methods for extracting envelope receiver keys from cookie names:
- Added `GetEnvelopeReceiverKeyOrDefault` to extract keys or return `null` if the format is invalid.
- Added `TryGetEnvelopeReceiverKey` to attempt key extraction with a success flag.

Updated `DigitalData.Auth.Claims.csproj` to increment `Version`, `AssemblyVersion`, and `FileVersion` from 1.0.0 to 1.0.1, reflecting the new functionality.
2026-05-29 09:50:10 +02:00
25387238e3 Bump version to 1.4.1 in project file
Updated `DigitalData.Auth.API.csproj` to increment `<Version>`, `<AssemblyVersion>`, and `<FileVersion>` from `1.4.0` to `1.4.1`. This minor version update reflects bug fixes or small improvements without introducing breaking changes.
2026-05-29 09:12:47 +02:00
2c78ed106c Add CookieNames helper for constructing cookie names
Introduce a new static class `CookieNames` in the `DigitalData.Auth.Claims` namespace to centralize and standardize the construction of cookie names for envelope receiver tokens.

- Added `GetEnvelopeReceiverCookieName` methods to generate cookie names with or without a default cookie name.
- Updated `AuthController` to use the `CookieNames` helper for constructing cookie names, replacing direct concatenation logic.
- Improved maintainability and consistency of cookie naming conventions across the application.
2026-05-29 09:01:21 +02:00
8f722ce3c9 Add DigitalData.Auth.Claims project and enhance JWT handling
Added the `DigitalData.Auth.Claims` project to the solution,
including its build and debug configurations. Updated
`DigitalData.Auth.API.csproj` to reference the new project
and incremented version numbers to 1.4.0.

Enhanced `Program.cs` with a new JWT signature handler for
`EnvelopeReceiverSecretDto`, generating claims for envelope
and receiver-specific data. Added `DirectorySearchService`
to the service collection, configured via `DirectorySearchOptions`.
2026-05-29 08:48:10 +02:00
2fed1baff5 Add JWT token support for EnvelopeReceiver entities
Enhanced the `AuthController` to support JWT token generation
for `EnvelopeReceiverSecretDto` entities. Added a new
dependency `IJwtSignatureHandler<EnvelopeReceiverSecretDto>`
and updated the constructor to inject it.

Refactored the `CreateTokenForEnvelopeReceiver` method:
- Added a `cookie` query parameter to control token delivery.
- Implemented consumer validation using `_consumerService`.
- Added token descriptor retrieval from `_keyPool`.
- Improved `AccessCode` validation for `EnvelopeReceiver`.
- Added logic to set tokens as cookies or return in the body.

Updated `using` directives to include required namespaces.
Improved error handling, readability, and flexibility in
token generation and delivery.
2026-05-29 08:47:54 +02:00
3ba55cbe9a Add DigitalData.Auth.Claims project and EnvelopeClaimNames
Added a new .NET project `DigitalData.Auth.Claims` targeting `net8.0`
with metadata for NuGet packaging. The project is configured to
not generate a NuGet package on build.

Introduced the `EnvelopeClaimNames` static class to define strongly-typed
constants for custom JWT claim names specific to envelope receiver tokens.
These include `EnvelopeId`, `EnvelopeUuid`, `ReceiverId`, and
`ReceiverSignature`. Added XML documentation for all constants.
2026-05-29 08:47:18 +02:00
90d74282d8 Add envelope receiver token endpoint to AuthController
Refactor `AuthController` to include `IMediator` dependency and
introduce a new `CreateTokenForEnvelopeReceiver` API endpoint
to handle envelope receiver authentication.

- Updated `using` directives to remove unused namespaces and
  add required ones for new functionality.
- Added `ReceiverLogin` model to represent envelope receiver
  login credentials.
- Implemented `ReadEnvelopeReceiverSecretQuery` to validate
  access codes for envelope receivers.
- Cleaned up unused fields and dependencies in `AuthController`.
2026-05-29 00:21:36 +02:00
a7a386924e Update JwtBearer and EnvelopeGenerator packages
Added Microsoft.AspNetCore.Authentication.JwtBearer (8.0.17) to the test project.
Updated EnvelopeGenerator to version 1.2.0.3 in the API project.
Aligned JwtBearer version to 8.0.17 for the net8.0 target framework.
2026-05-29 00:21:10 +02:00
e55a6a3663 Add global exception handling middleware
Introduced `ExceptionHandlingMiddleware` to handle exceptions
globally, log errors, and return appropriate JSON responses.
Registered the middleware in `Program.cs` to ensure all requests
are processed through it. Added localization support in
`Program.cs` to enable localized error messages and other
features.
2026-05-29 00:20:55 +02:00
e80ad19c96 Add MediatR package to enable Mediator design pattern
The `MediatR` package (version 12.5.0) was added to the
`DigitalData.Auth.API.csproj` file. This introduces support
for the Mediator design pattern, which helps reduce coupling
between components and facilitates structured communication
via requests, commands, or queries.
2026-05-28 22:37:29 +02:00
d2d992b41e Add DbTriggerParams section to appsettings.json
Introduced a new `DbTriggerParams` configuration section in
`appsettings.json` to define database triggers for various
application components.

The section includes keys such as `Envelope`, `History`,
`EmailOut`, `EnvelopeReceiverReadOnly`, `Receiver`, and
`EmailTemplate`, each with corresponding arrays of trigger
names. This change enhances the application's ability to
manage database events in a structured and configurable way.
2026-05-28 22:30:28 +02:00
ff8d683040 Add EF Core SQL Server support to the project
Added `Microsoft.EntityFrameworkCore.SqlServer` package to the
`DigitalData.Auth.API.csproj` file to enable SQL Server as the
database provider. Updated `Program.cs` to include the
`Microsoft.EntityFrameworkCore` namespace for database interaction.
2026-05-28 22:26:48 +02:00
163916e330 Update dependencies and integrate EnvelopeGenerator
Updated `DigitalData.Auth.Tests.csproj` to include `Microsoft.EntityFrameworkCore` version `8.0.17`.

Refactored `AuthController.cs` to remove unused imports and update to the latest `DigitalData.Core.Abstraction.Application` namespaces.

Streamlined `DigitalData.Auth.API.csproj`:
- Changed target framework to `net8.0`.
- Upgraded `DigitalData.Core.Abstractions` to `4.3.0` and `DigitalData.Core.Application` to `3.4.0`.
- Added `EnvelopeGenerator` and `Microsoft.EntityFrameworkCore` dependencies.
- Removed outdated `UserManager` dependencies.

Enhanced `Program.cs`:
- Integrated `EnvelopeGenerator` services with database context and caching configuration.
- Removed `AddUserManager` service registration.
- Added SQL Server logging and error handling for `DbContext`.

These changes improve maintainability, adopt modern frameworks, and introduce new functionality with `EnvelopeGenerator`.
2026-05-28 22:26:31 +02:00
6bcc16cead Update project version to 1.3.0
Bump <Version>, <AssemblyVersion>, and <FileVersion> in DigitalData.Auth.API.csproj from 1.2.0 to 1.3.0.
2026-02-03 14:00:46 +01:00
a461cbaa71 Add CommonUserRoles section to appsettings.json
Added "CommonUserRoles" array with roles: Admin, UserManager, ContentManager, and Signatory to appsettings.json for improved role management configuration. No other changes made.
2026-02-03 13:58:45 +01:00
ce69779c9f Enhance JWT user claims with configurable roles
Updated Program.cs to include "CommonUserRoles" from configuration in JWT claims for users, adding them under ClaimTypes.Role if present. Also added System.Security.Claims using directive to support this change. This enables dynamic role assignment in user tokens.
2026-02-03 13:58:32 +01:00
31a371ecb9 Update consumer name for Id 2 in repository config
Changed the "Name" field for consumer Id 2 from "sign-flow-gen" to "sign-flow" in consumer-repository.json. No other fields were affected.
2026-02-03 13:01:50 +01:00
e530bceacd Update Audience for sign-flow-gen in consumer-repository
Changed the "Audience" field for the consumer with Id 2 ("sign-flow-gen") from "sign-flow-gen.digitaldata.works" to "sign-flow.digitaldata.works" in consumer-repository.json. No other fields were affected.
2026-02-02 12:56:06 +01:00
c82c7baed7 Update JWT Audience value in appsettings.json
Changed the Audience for JWT config with Id "f3c0881b-c349-442a-ac24-d02da0798abd" from "sign-flow-gen.digitaldata.works" to "sign-flow.digitaldata.works" to reflect the correct audience for token validation.
2026-02-02 12:55:56 +01:00
fec5a21612 Restrict NLog setup to non-dev; set log level to Trace
NLog provider setup and clearing of logging providers now occur
only outside development environments. The minimum logging level
is explicitly set to Trace for all environments.
2026-02-02 12:55:41 +01:00
09cb93736d chore: Aktualisierung des Entwicklungsportals zur Verwendung von 9090 2025-07-22 17:51:52 +02:00
Developer 02
4f5a33f7ec Support multiple target frameworks in project file
Updated `DigitalData.Auth.API.csproj` to target both `net7.0` and `net8.0`.
Replaced `TargetFramework` with `TargetFrameworks` for multi-targeting.
Conditionally included `Microsoft.AspNetCore.Authentication.JwtBearer` based on the target framework version.
Added a project reference to `DigitalData.Auth.Abstractions`.
2025-05-10 10:24:12 +02:00
Developer 02
ae28159562 Bump version to 1.2.0 in DigitalData.Auth.API.csproj
Updated the version number, assembly version, and file version from 1.1.2 to 1.2.0 in the project file, reflecting a new release of the software.
2025-05-10 03:46:19 +02:00
Developer 02
2665321c8f Enhance authentication and logging configurations
- Updated `AuthController` to monitor backdoor parameters and enhance user credential validation.
- Changed route for `Hash` method in `CryptController` for clarity.
- Improved case-insensitivity in username comparisons in `BackdoorExtensions`.
- Modified logging setup in `Program.cs` to clear providers and set minimum level to Trace.
- Added separate logging configuration for warnings in `appsettings.json`.
- Restructured `backdoors.json` to encapsulate entries within `BackdoorParams`.
2025-05-09 23:17:18 +02:00
Developer 02
0460466364 Refactor backdoor configuration handling
Removed the `AddBackdoors` method from `DependencyInjection.cs` and replaced its usage in `Program.cs` with `Configure<Backdoor>`. Updated `using` directives to include `Microsoft.Extensions.DependencyInjection`. Added a new `BackdoorParams` class to encapsulate backdoor configuration settings.
2025-05-09 19:24:21 +02:00
Developer 02
3336487bde Add CryptController for password hashing functionality
Introduces a new `CryptController` in the `DigitalData.Auth.API.Controllers` namespace. This API controller features a GET endpoint, `Hash`, which accepts a password as a query parameter and returns its BCrypt hashed version.
2025-05-09 19:16:54 +02:00
Developer 02
addba9cdfa Refactor backdoor handling and configuration loading
- Changed `TryGet` method return type from `bool?` to `bool` in `BackdoorExtensions.cs` for improved clarity.
- Updated configuration retrieval in `DependencyInjection.cs` to use `GetSection("backdoors")` for targeted loading.
- Added `backdoors.json` configuration file in `Program.cs` to enhance modularity and organization of settings.
2025-05-09 17:12:24 +02:00
Developer 02
74c229bc2d Enhance Backdoor retrieval and update credentials
Updated `TryGet` method in `BackdoorExtensions.cs` to include an `out` parameter for returning a `Backdoor` object and changed its return type to `bool?`. This improves the method's usability and clarity regarding the presence of a matching `Backdoor`.

Modified `backdoors.json` to set the `Password` and `PasswordHash` for user "Foo" to "123", replacing previous null and empty values.
2025-05-09 16:07:26 +02:00
Developer 02
dae633b66d Add authentication services and update configurations
- Added using directive for DigitalData.Auth.API.Models.
- Removed obsolete service configuration line.
- Introduced new service registrations: AddBackdoors, AddAuthService, and AddRSAPool.
- Retained configuration for AuthApiParams to ensure settings are utilized.
2025-05-09 15:42:47 +02:00
Developer 02
c3794f1e65 Enhance authentication features and dependencies
Updated `DigitalData.Auth.API.csproj` to include new package references for improved security and functionality. Added a `Verify` method in the `Backdoor` class to securely check user credentials against plain text and hashed passwords. Introduced `BackdoorExtensions` with methods for easier retrieval of `Backdoor` instances by username.
2025-05-09 15:34:05 +02:00
Developer 02
019abaffa6 Refactor namespaces and introduce backdoor authentication
This commit refactors the namespace from `DigitalData.Auth.API.Dto` to `DigitalData.Auth.API.Models` in several files, improving the organization of data structures. A new `Backdoor` class is added to support backdoor authentication, along with a method in `DependencyInjection.cs` to register backdoor configurations. Additionally, `AuthApiParams` configuration is included in `Program.cs`, and a new JSON structure for backdoor users is introduced in `backdoors.json`. These changes enhance the codebase's structure and functionality.
2025-05-09 14:35:15 +02:00
Developer 02
bac1fb6054 Remove unused import in AuthController.cs 2025-05-05 10:17:40 +02:00
Developer 02
2c330a9dff refactor: Hinzufügen des Token-Deskriptors, der mit sign-flow-gen erstellt wurde 2025-04-29 11:45:10 +02:00
Developer 02
d3b8f400e5 chore (Clent): Aktualisiert auf 1.3.7 2025-04-28 14:01:37 +02:00
Developer 02
358cfdb707 fix: Behandlung von leeren PEM-Inhalten in der ClientPublicKey-Klasse
- Die UpdateContent-Methode wurde aktualisiert, um den SecurityKey zurückzusetzen, wenn der PEM-Inhalt leer oder mit Leerzeichen versehen ist.
- Es wurde sichergestellt, dass ein neuer RSA-Schlüssel erstellt wird, wenn der Inhalt ungültig oder nicht vorhanden ist.
2025-04-28 12:45:15 +02:00
Developer 02
cf375a587e feat(DIExtensions): rename DependencyInjection 2025-04-28 11:24:11 +02:00
Developer 02
a429c65ead feat: Unterstützung für .NET 9.0 hinzugefügt und Paketversion auf 1.3.6 aktualisiert
- net9.0 zu TargetFrameworks hinzugefügt.
- Paketverweise für Microsoft.AspNetCore.SignalR.Client und Microsoft.Extensions.Hosting.Abstractions, die auf net9.0 abzielen, hinzugefügt.
- Bumped Package Version, AssemblyVersion und FileVersion auf 1.3.6.
2025-04-28 10:03:41 +02:00
Developer 02
79aebe4ef7 chore(IISProfile): Hinzugefügt, um die Standard-IIS-Konfiguration zu implementieren 2025-03-25 15:41:50 +01:00
Developer 02
b4366e5bbb chore: Nuget-Pakete werden je nach Rahmenwerk bedingt konfiguriert. 2025-03-25 12:38:01 +01:00
Developer 02
fab002a20c chore Upgrade auf 1.1.2 2025-03-17 11:01:21 +01:00
Developer 02
51492110a7 refactor(DigitalData.Auth.Client): DigitalData.Core.Security wurde auf 1.1.1 aktualisiert. 2025-03-17 10:59:54 +01:00
Developer 02
421f2657dd refactor(DigitalData.Auth.Client): DigitalData.Core.Security wurde auf 1.1.0 aktualisiert. 2025-03-17 10:02:52 +01:00
Developer 02
a77c70f655 refactor(AuthClient): Hochgestuft auf 1.3.3 2025-03-12 10:50:35 +01:00
Developer 02
031f830b8f refactor(AuthClient): Detaillierte Protokollierung für AuthClient hinzugefügt. 2025-03-12 10:47:15 +01:00
Developer 02
5f9efa3bb0 refactor(AuthClient): Ausführlichere Protokollierung hinzufügen. 2025-03-12 10:27:06 +01:00
Developer 02
d46dbbb877 refactor(ClientParams): Die Eigenschaft NextRetryDelay wurde entfernt, um die Logik zu vereinfachen. 2025-03-12 09:48:27 +01:00