Commit Graph

2039 Commits

Author SHA1 Message Date
abbe6a26a9 Refactor ControllerExtensions to SenderClaimExtensions
Renamed the extension class for claims handling and added a private GetRequiredClaimOfSender method for ClaimsPrincipal. This method throws a detailed exception when a required claim is missing, improving error reporting and debugging.
2026-02-02 16:11:29 +01:00
3066dac541 Rename EnvelopeAuthExtensions to ReceiverClaimExtensions
Refactored the class name in ReceiverClaimExtensions.cs to better reflect its focus on receiver-specific claim extension methods rather than general envelope authentication. No functional changes were made.
2026-02-02 15:58:47 +01:00
b1aa6d6639 Refactor claim extraction methods for receiver context
Renamed authentication-related extension methods to clarify that they extract claims for the "receiver" context (e.g., GetAuthReceiverSignature → GetReceiverSignatureOfReceiver). Updated all usages in AnnotationController and ReadOnlyController. Also renamed the helper method GetRequiredClaim to GetRequiredClaimOfReceiver for improved clarity and reduced ambiguity.
2026-02-02 15:58:07 +01:00
31fe1c34f2 Remove GetClaimValue extension from EnvelopeAuthExtensions
The GetClaimValue method, which delegated to GetRequiredClaim for retrieving claim values by type, has been removed from the EnvelopeAuthExtensions class. Other functionality in the class remains unchanged.
2026-02-02 15:13:10 +01:00
d7644bfe07 Move ClaimsPrincipal extensions to API.Extensions namespace
Refactored ControllerExtensions: moved user claim extraction
methods from EnvelopeGenerator.API.Controllers to the new
EnvelopeGenerator.API.Extensions namespace. Updated all
references and using statements accordingly. No logic changes;
improves code organization and clarity.
2026-02-02 15:07:27 +01:00
4759b16a85 Mark GetAnnotationParams as obsolete (PSPDF Kit deprecated)
Added [Obsolete] attribute to GetAnnotationParams in ConfigController to indicate that PSPDF Kit will no longer be used and the method is deprecated. This warns developers to avoid using this method in future development.
2026-02-02 15:05:15 +01:00
cfdfb43631 Restrict annotation endpoints to Receiver.FullyAuth role
Updated [Authorize] attributes to require Receiver.FullyAuth role on AnnotationController and relevant methods. Removed redundant claim checks now enforced by role-based authorization. Clarified [Obsolete] message for PSPDF Kit endpoint.
2026-02-02 14:55:44 +01:00
6254bb6e3f Update auth role and envelopeId check in CreateAsync
Changed [Authorize] to require Receiver.FullyAuth role for CreateAsync, restricting access to receiver users. Removed explicit null check and logging for envelopeId claim, allowing the method to proceed without this validation.
2026-02-02 14:55:10 +01:00
f995fa9fc3 Refactor claim accessors to enforce required claims
Refactored EnvelopeAuthExtensions to require presence of all key authentication claims. Added GetRequiredClaim helper that throws detailed exceptions if claims are missing or invalid, replacing nullable return types with non-nullable ones. This ensures authentication logic fails fast and provides clearer error messages when claims are misconfigured or tampered with.
2026-02-02 14:54:59 +01:00
c2fefe798d Add Sender constant to Role in Domain.Constants
Added a new Sender constant to the Role class within the EnvelopeGenerator.Domain.Constants namespace, allowing it to be used alongside existing Receiver role constants.
2026-02-02 11:58:30 +01:00
849a282ec5 Refactor Role constants; add Receiver class, mark obsolete
Refactored the Role class by introducing a nested static Receiver class containing PreAuth and FullyAuth constants. Marked the original Role.PreAuth and Role.FullyAuth as [Obsolete] with guidance to use the new Receiver constants. Added a conditional using directive for System for NETFRAMEWORK compatibility.
2026-02-02 11:55:17 +01:00
6b23dcdba7 Refactor: unify role constants under new Role class
Replaced all usages of ReceiverRole with the new Role class in EnvelopeGenerator.Domain.Constants. Removed ReceiverRole.cs and added Role.cs with PreAuth and FullyAuth constants. Updated all [Authorize] attributes and role checks in controllers and authentication logic to use Role.FullyAuth and Role.PreAuth. This centralizes role management for improved maintainability and clarity.
2026-02-02 11:53:26 +01:00
a60d0f63e2 Update CORS origins and authentication config values
Expanded AllowedOrigins for CORS to include additional URLs. Updated AuthClientParams URL and adjusted Audience values in both AuthClientParams and AuthTokenKeys to use sign-flow.digitaldata.works. No other settings were changed.
2026-02-02 11:43:15 +01:00
2481059b49 Update AuthClientParams URL and Audience in dev settings
Changed AuthClientParams "Url" to use the new endpoint (http://172.24.12.39:9090/auth-hub) and updated the "Audience" in "PublicKeys" from "sign-flow-gen.digitaldata.works" to "sign-flow.digitaldata.works" in appsettings.Development.json.
2026-02-02 11:42:17 +01:00
6334097d5e Remove CommonServices project reference from API
The EnvelopeGenerator.API.csproj file no longer includes a direct ProjectReference to EnvelopeGenerator.CommonServices.vbproj. This change decouples the API project from the CommonServices project.
2026-02-02 10:30:09 +01:00
9baa126c8c Update LocalizationController namespace and localizer types
Changed namespace to EnvelopeGenerator.API.Controllers. Updated _mLocalizer and its constructor parameter to use IStringLocalizer<Resource> instead of IStringLocalizer<Model>. Removed unused EnvelopeGenerator.CommonServices using directive.
2026-02-02 10:29:44 +01:00
1ef46013cd Remove EnvelopeGenerator.Terminal from solution
EnvelopeGenerator.Terminal project and all related configuration
and solution folder mappings have been removed from
EnvelopeGenerator.sln. This cleans up the solution by excluding
the Terminal project and its build settings.
2026-02-02 10:26:12 +01:00
72dffd1043 Update SQL to use User.GetId() for current user context
Replaced usage of the userId variable with User.GetId() when formatting the SQL query in EnvelopeReceiverController. This ensures the user ID is dynamically retrieved from the authenticated user context, improving accuracy and security.
2026-02-02 10:17:55 +01:00
eda30472b9 No changes detected in diff
No code was added or removed in the provided diff; only context lines were present.
2026-02-02 10:14:15 +01:00
75846573da Add XML docs and standardize repository access patterns
Added XML documentation to extension and handler classes for improved maintainability. Refactored repository access to use .Query instead of .ReadOnly() for consistency. Updated async extension methods for better readability and error handling.
2026-02-02 10:07:50 +01:00
f59c0d90ad Refactor namespaces to EnvelopeGenerator.API
Replaced all EnvelopeGenerator.GeneratorAPI namespaces with EnvelopeGenerator.API across controllers, models, extensions, middleware, and annotation-related files. Updated using/import statements and namespace declarations accordingly. Added wwwroot folder to project file. Minor code adjustments made for consistency. This unifies API naming for improved clarity and maintainability.
2026-02-02 10:00:21 +01:00
cf40449112 remove angular website 2026-02-02 09:56:31 +01:00
a59d4836d4 Add EnvelopeGenerator.API project, remove GeneratorAPI
Added EnvelopeGenerator.API project to the solution with appropriate build configurations and folder placement. Removed the EnvelopeGenerator.GeneratorAPI project and all related solution references and configurations.
2026-01-30 15:12:28 +01:00
f475cf4ea9 Remove dotnet-ef tool config and IIS publish profiles
Deleted dotnet-tools.json (dotnet-ef config) and IIS publish profiles for .NET 7 and .NET 9 (IISProfileNet7Win64.pubxml, IISProfileNet9Win64.pubxml) to clean up unused deployment and tooling files.
2026-01-30 15:12:10 +01:00
d39018ca39 Add TfaRegistrationController for receiver TFA endpoints
Introduced TfaRegistrationController with endpoints to register and manage two-factor authentication for envelope receivers. Includes a GET endpoint to generate TFA registration metadata (QR code and deadline) and a POST endpoint to log out receivers. Implements error handling, logging, and uses dependency injection for required services. Added necessary using directives.
2026-01-30 15:05:32 +01:00
b49482137f Add ReadOnlyController for envelope sharing flows
Introduced ReadOnlyController to manage read-only envelope sharing. Added a POST endpoint for authorized users to create read-only receivers, send notification emails, and record sharing events in envelope history. Includes error handling and logging throughout the process.
2026-01-30 15:04:05 +01:00
bd40404d97 Add DocumentController for envelope document retrieval
Introduced DocumentController to provide a secured GET endpoint for authenticated receivers to download envelope documents. Handles missing or empty documents with error logging and NotFoundException. Utilizes MediatR and ILogger via dependency injection.
2026-01-30 14:48:10 +01:00
6f16921a79 Remove Obsolete attributes and update FirstAsync behavior
Removed Obsolete attributes from FirstAsync and Exceptions class. Changed FirstAsync return type to non-nullable Task<T> and updated its logic to throw the provided exception when the sequence is empty, instead of returning null.
2026-01-30 14:41:54 +01:00
1afc95f9c6 Add obsolete FirstAsync extension to TaskExtensions
Added FirstAsync<T, TException> as an obsolete extension method for Task<IEnumerable<T>>. This method returns the first element or throws a custom exception if the result is null, using a provided factory delegate. Intended for legacy .NET projects.
2026-01-30 14:24:57 +01:00
6aed820196 Mark TaskExtensions and new helpers as [Obsolete]
Marked TaskExtensions class and all its methods as [Obsolete] with guidance to implement Mediator behaviors instead. Added new [Obsolete] extension methods for null/empty checks and chaining. Introduced an [Obsolete] Exceptions class with factory methods for common exceptions. All changes are intended for legacy or transitional use only.
2026-01-30 14:20:05 +01:00
e17c4d02f8 Update Annotation model import to PsPdfKitAnnotation
Changed the import in ConfigController to use the PsPdfKitAnnotation namespace for annotation models instead of the previous Annotation namespace. This ensures the controller works with the updated annotation model definitions.
2026-01-30 13:07:00 +01:00
8187924a8c Add EnvelopeAuthExtensions for envelope claim handling
Introduces EnvelopeAuthExtensions with helper methods to retrieve envelope-specific claims from ClaimsPrincipal and to sign in envelope receivers using cookie authentication. Supports extracting envelope and receiver details via claims for authentication flows.
2026-01-30 13:06:40 +01:00
1bf530f7e7 Add EnvelopeClaimTypes for custom envelope claim strings
Introduced EnvelopeGenerator.GeneratorAPI namespace and EnvelopeClaimTypes static class. Added Title and Id claim type constants for envelope-related information, with XML documentation for clarity.
2026-01-30 13:06:27 +01:00
9cadc8e901 Add PSPDFKit annotation model and utilities
Introduce classes and interfaces for modeling PDF annotations, including support for layout, relative positioning, background rendering, and color. Added Annotation, AnnotationParams, Background, Color, Extensions, and IAnnotation to EnvelopeGenerator.GeneratorAPI.Models.PsPdfKitAnnotation. Enables flexible annotation management and rendering.
2026-01-30 13:02:34 +01:00
1d4ad13532 Add core model classes for auth, culture, images, and links
Introduced new models in EnvelopeGenerator.GeneratorAPI.Models:
- Auth, ContactLink, Culture, Cultures, CustomImages, ErrorViewModel, Image, MainViewModel, and TFARegParams.
These provide foundational structures for authentication, localization, error handling, image management, and contact links. All changes are new file additions.
2026-01-30 12:55:44 +01:00
03a8154b1c Add ConfigController to expose annotation config via API
Introduced a secured ConfigController with a GET endpoint at /api/Config/Annotations to provide annotation configuration data to clients. Utilizes dependency injection for configuration and includes necessary using directives.
2026-01-30 09:43:26 +01:00
20b8acd3fc Add AnnotationController for envelope annotation workflow
Introduces AnnotationController to manage envelope annotations and signature lifecycle. Includes endpoints for creating/updating annotations (for PSPDF Kit, obsolete) and rejecting documents, both requiring "FullyAuth" role. Utilizes MediatR for CQRS operations, dependency injection, and provides detailed logging and error handling. Legacy service dependencies are marked as obsolete.
2026-01-30 09:42:29 +01:00
a3afeb175f Refactor controllers for MediatR and cleaner API design
- Switch EnvelopeController and ReceiverController to MediatR for all operations
- Encapsulate UserId in CreateEnvelopeCommand via Authorize() method
- Change CreateEnvelopeCommand binding to [FromBody]
- Add CancellationToken support to EnvelopeReceiverController
- Remove obsolete CRUD logic from ReceiverController; now only supports GET via MediatR
- Clean up unused dependencies and update controller summaries for clarity
2026-01-28 14:14:04 +01:00
114555c843 Add XML docs to ReadEnvelopeReceiverQueryHandler ctor
Added XML documentation comments to the constructor of the ReadEnvelopeReceiverQueryHandler class, including parameter descriptions for envelopeReceiver, rcvRepo, and mapper. The summary section is currently empty.
2026-01-28 14:10:03 +01:00
f294ef2fde Refactor EnvelopeTypeController to use MediatR
Replace IEnvelopeTypeService with IMediator in EnvelopeTypeController and update GetAllAsync to use ReadEnvelopeTypesQuery. Remove obsolete service-based code and attributes. Also, remove AsNoTracking() from repository query in ReadEnvelopeTypesQueryHandler.
2026-01-28 13:48:02 +01:00
02ad819da9 Refactor EnvelopeReceiverController to use MediatR only
Remove all usage of IEnvelopeReceiverService from EnvelopeReceiverController, including constructor injection and obsolete attributes. Update endpoints to exclusively use MediatR for handling queries. Clean up related obsolete code, comments, and unused usings. Update documentation to reflect these changes.
2026-01-28 13:43:34 +01:00
041d98ca78 Refactor EnvelopeController to use MediatR exclusively
Removed all usage of the obsolete IEnvelopeService from EnvelopeController, refactoring endpoints to use MediatR with ReadEnvelopeQuery. Simplified GetAsync and GetDocResultAsync logic, updated method signatures, and eliminated obsolete code paths and attributes. Cleaned up unused usings and updated constructor dependencies.
2026-01-28 13:41:43 +01:00
afea2fb5ea Refactor envelope queries into unified ReadEnvelopeQuery
Consolidate envelope querying logic by extending ReadEnvelopeQuery to support user filtering and status options, and introduce ReadEnvelopeQueryHandler to process all envelope queries. Remove ReadUserEnvelopesQuery and its handler, reducing duplication and improving maintainability.
2026-01-28 13:34:54 +01:00
beeb9e4e75 Refactor EmailTemplateController to use generic IRepository
Replaces IEmailTemplateRepository with IRepository<EmailTemplate> in EmailTemplateController. Removes unused ILogger dependency and updates the Get method to use the new repository interface. Cleans up obsolete attributes and using directives.
2026-01-28 13:13:37 +01:00
30d13b1ffb Add MediatR query handler for reading receiver details
Introduced a CQRS-style ReadReceiverQueryHandler using MediatR to enable flexible querying of receivers by Id, EmailAddress, or Signature. Integrated AutoMapper for DTO mapping and updated ReadReceiverQuery to support MediatR's request/response pipeline.
2026-01-28 13:09:51 +01:00
814df63306 Add MediatR query/handler for reading envelope types
Introduced ReadEnvelopeTypesQuery and its handler to fetch all
envelope types from the repository, map them to DTOs, and
return the result via MediatR. This enables clean, decoupled
retrieval of envelope types in the application.
2026-01-28 12:55:44 +01:00
830d1af44a Add ReadUserEnvelopesQuery and handler with filtering
Implemented ReadUserEnvelopesQuery and its handler to fetch user envelopes with support for filtering by user ID, status (range, include, ignore), envelope ID, and UUID. Utilizes repository and AutoMapper to return EnvelopeDto results.
2026-01-28 12:54:22 +01:00
94018d2a36 Add query handler to fetch receiver's latest used name
Introduced ReadReceiverNameQueryHandler to retrieve the most recently used name ("Anrede") for a receiver, supporting envelope generation. Updated ReadReceiverNameQuery to use MediatR and CQRS patterns, and implemented repository-based lookups for receiver identification and name retrieval. Added necessary using directives for repository and MediatR support.
2026-01-28 12:51:40 +01:00
cf5a724bf2 Add username filter to ReadEnvelopeReceiverQuery handler
Extended ReadEnvelopeReceiverQuery to support optional username-based filtering. Refactored the handler to apply this filter, updated repository access for consistency, and improved code clarity and null-safety. Cleaned up comments and formatting.
2026-01-28 12:42:21 +01:00
172f2e27d7 Bump version to 3.9.0 in EnvelopeGenerator.Web.csproj
Updated the project, assembly, and file versions from 3.8.2 to 3.9.0 in the EnvelopeGenerator.Web.csproj file. This prepares the project for the next release.
2026-01-27 12:07:02 +01:00