Commit Graph

2252 Commits

Author SHA1 Message Date
28df3f4ec1 Refactor document handling and improve file response
Refactored the handling of `senderDoc.ByteData` by replacing
the ternary operator with an explicit `if` statement for better
readability. Added a `Content-Disposition` header to ensure
the file is displayed inline with a proper filename. Updated
the MIME type of the file response from `application/octet-stream`
to `application/pdf` to reflect the expected content type.
2026-05-29 14:09:31 +02:00
b6e63841cd Disable automatic database migrations in appsettings.json
The `UseDbMigration` setting in the `appsettings.json` file was updated from `true` to `false`. This change disables automatic application of database migrations, potentially requiring manual intervention or an alternative approach for managing schema updates.
2026-05-29 13:47:11 +02:00
f051896296 Add API endpoint to retrieve envelope receiver by key
Added a new `GetEnvelopeReceiverOfReceiver` method in the
`EnvelopeReceiverController` to retrieve an envelope receiver
based on the provided `envelopeKey`. The method is secured
with the `Receiver` authorization policy and uses the
`_mediator.Send` method to process a `ReadEnvelopeReceiverQuery`.

Included the `Microsoft.Extensions.Options` namespace to
support potential configuration needs. Added XML documentation
placeholders for the new method.
2026-05-29 13:46:06 +02:00
92b93e862e Add GetDocumentOfReceiver endpoint and logging support
Updated DocumentController to include a new GetDocumentOfReceiver
endpoint for retrieving envelope documents. Added authorization
based on the Receiver policy and implemented error handling for
invalid or missing EnvelopeId claims. Integrated ILogger to log
errors and provide detailed diagnostics. Included necessary
namespace imports to support the new functionality.
2026-05-29 13:37:51 +02:00
8876f5c286 Add token validation for envelope key in request path
Enhanced token validation logic by introducing an `OnTokenValidated` event handler. This ensures the `envelopeKey` in the request path matches the token's subject (`sub` claim). Added `return Task.CompletedTask;` to complete asynchronous operations. These changes improve security by preventing mismatches or unauthorized access.
2026-05-29 13:10:42 +02:00
e93c7e8bc1 Add envelope-receiver login endpoint support
Added `AddEnvelopeReceiverLoginOperation` to `AuthProxyDocumentFilter` to define a new Swagger operation for the `/api/Auth/envelope-receiver/{key}` endpoint. Introduced the `EnvelopeReceiverLogin` record for the request body. Updated `yarp.json` to configure routing for the new endpoint, ensuring the `cookie` query parameter is always set to `true`. Modified `Apply` to include the new operation in Swagger documentation.
2026-05-29 12:44:51 +02:00
16493b4594 Add endpoints for envelope receiver logout functionality
Added two new endpoints to `AuthController`: `LogoutEnvelopeReceiver` for removing a specific per-envelope receiver cookie and `LogoutAllEnvelopeReceivers` for clearing all such cookies. Updated `DigitalData.Auth.Claims` package to version 1.0.3. Introduced new `using` directives to support the added functionality. Included XML documentation for the new endpoints to improve code clarity.
2026-05-29 12:44:26 +02:00
938504b2d1 Add per-envelope JWT authentication and validation
Introduced a new `EnvelopeReceiverJwt` authentication scheme to support per-envelope JWT validation using cookies specific to envelope keys. Added the `CheckEnvelopeReceiver` endpoint in `AuthController.cs` to validate these tokens, protected by the `AuthPolicy.Receiver` policy.

Configured the `EnvelopeReceiverJwt` scheme to dynamically resolve issuer signing keys and validate tokens. Enhanced `JwtBearerEvents.OnMessageReceived` to extract envelope keys from the request path and retrieve tokens from corresponding cookies.

Updated the `AuthPolicy.Receiver` policy to use the `EnvelopeReceiverJwt` scheme, ensuring isolated authentication for per-envelope scenarios. Added XML documentation for the `CheckEnvelopeReceiver` method.
2026-05-29 11:47:12 +02:00
3eb718f6ac Add CheckReceiver endpoint to AuthController
Introduce a new `CheckReceiver` action method in `AuthController`.
This method is protected by the `Receiver` authorization policy
and handles GET requests to the `check-receiver/{envelopeKey}` route.
It accepts an `envelopeKey` parameter from the route and currently
returns an HTTP 200 OK response.
2026-05-29 10:23:34 +02:00
99781aeb8a Enhance authentication and database configuration
- Added `using DigitalData.Auth.Claims` to support claims handling.
- Improved EF Core DbContext comment for better clarity.
- Added logic to dynamically select connection strings based on
  `MIGRATION_TEST_MODE` or `UseDbMigration` configuration.
- Updated `AuthPolicy.Receiver` to include the `"receiver"` role.
2026-05-29 10:02:25 +02:00
ffcd41f4dc Add DigitalData.Auth.Claims package dependency
Added a reference to the `DigitalData.Auth.Claims` package (version 1.0.1) in the `EnvelopeGenerator.API.csproj` file. This introduces functionality related to handling authentication claims in the project.
2026-05-29 10:02:11 +02:00
a7ed9be1de Update version and improve build process for packaging
Updated project version to 1.2.0.3 in `EnvelopeGenerator.DependencyInjection.csproj`.
Replaced line endings in `_DepDlls` for consistency. Added a new
`RebuildDependenciesBeforePack` target to ensure all dependencies
are rebuilt for `net7.0`, `net8.0`, and `net9.0` before packaging.
Improved formatting in `BundleReferencedDlls` for better readability.
2026-05-29 08:45:56 +02:00
32fbf782fa Update project version to 1.2.0
Bump the project version from 1.1.1 to 1.2.0 in the `EnvelopeGenerator.DependencyInjection.csproj` file. Updated the `<Version>`, `<AssemblyVersion>`, and `<FileVersion>` properties to reflect the new version.
2026-05-28 23:47:02 +02:00
bfae72529c Add query for sensitive envelope receiver data
Introduced `ReadEnvelopeReceiverSecretQuery` to fetch sensitive
fields (e.g., access code, phone number) for envelope receivers.
Added extension methods for dispatching the query via `IMediator`
and implemented `ReadEnvelopeReceiverSecretQueryHandler` to
process the query using repositories and AutoMapper.

Updated `EnvelopeController` with a new HTTP GET endpoint
`EnvelopeReceiverWithSecretByMediatr` to expose the query
functionality. This endpoint returns sensitive data as
`EnvelopeReceiverSecretDto` or a 404 response if no match is found.

These changes improve modularity, testability, and separation of
concerns by leveraging MediatR and CQRS patterns.
2026-05-28 23:46:31 +02:00
67e6f288eb Bump version to 1.1.1
Updated project version from 1.1.0 to 1.1.1 in `EnvelopeGenerator.DependencyInjection.csproj`. This includes changes to `<Version>`, `<AssemblyVersion>`, and `<FileVersion>` properties. The update reflects minor improvements or bug fixes while maintaining backward compatibility.
2026-05-28 22:52:40 +02:00
823bafeeb9 Refactor project dependencies and add TFM-specific packages
Restructured `EnvelopeGenerator.DependencyInjection.csproj` to:
- Add multiple `PackageReference` entries for application services, ORM/Database, security/identity, utilities, and DI abstractions.
- Introduce conditional `ItemGroup` sections for `net7.0`, `net8.0`, and `net9.0` with framework-specific package versions.
- Move `UserManager` package reference to align with the updated dependency structure.
- Update comments for clarity, including replacing a Turkish comment with an English one.
- Add a comment explaining the rationale for centralizing `PackageReference` declarations to ensure correct `.nuspec` generation and simplify consumption.
2026-05-28 22:50:45 +02:00
750b9f1b57 Bump project version to 1.1.0
Updated the project version from 1.0.1 to 1.1.0 in the `EnvelopeGenerator.DependencyInjection.csproj` file. This includes changes to the `<Version>`, `<AssemblyVersion>`, and `<FileVersion>` properties, reflecting the addition of new features or improvements.
2026-05-28 21:57:19 +02:00
0a4daccc0f Refactor service registration for modularity
Introduced `EnvelopeGeneratorOptions` and `SqlCacheOptions` to enable fine-grained control over optional service registrations in `AddEnvelopeGenerator`. Updated `AddEnvelopeGenerator` to conditionally register services like `HttpContextAccessor`, `DistributedSqlServerCache`, `Dispatcher`, `MemoryCache`, and `UserManager` based on these options.

Updated `DependencyInjection.csproj` to include necessary framework references and package dependencies. Simplified `Program.cs` by consolidating service registrations into `AddEnvelopeGenerator`, reducing boilerplate and improving maintainability.

Improved extensibility by centralizing service registration logic, allowing consuming projects to customize configurations without modifying the core library. Updated documentation and removed unused directives.
2026-05-28 21:57:03 +02:00
bc4905d2f4 Refactor DI setup and simplify service registration
Centralized dependency injection setup by adding a reference to
`EnvelopeGenerator.DependencyInjection` in the project file and
replacing multiple `using` directives with a single one.

Replaced obsolete `AddEnvelopeGeneratorInfrastructureServices`
and `AddEnvelopeGeneratorServices` methods with the new
`AddEnvelopeGenerator` method, consolidating service and
infrastructure setup.

Encapsulated `EGDbContext` configuration within
`AddEnvelopeGenerator` and removed obsolete `#pragma` directives.

Simplified mail service registration by replacing manual
`IEnvelopeMailService` setup with `AddEnvelopeMailService`.

These changes improve maintainability, reduce redundancy, and
modernize the codebase.
2026-05-28 20:23:14 +02:00
7c737ee6ad Update project versioning and dependency handling
Updated project version to 1.0.1, including `<Version>`, `<AssemblyVersion>`, and `<FileVersion>`. Added `<PrivateAssets>all</PrivateAssets>` to `<ProjectReference>` elements to prevent exposing referenced projects' assets. Introduced `IncludeDependencyDlls` and `BundleReferencedDlls` targets to include and bundle dependent project DLLs for multiple target frameworks (`net7.0`, `net8.0`, `net9.0`). Removed redundant `<ProjectReference>` entries and improved packaging to ensure proper handling of dependencies.
2026-05-28 20:13:51 +02:00
8a796a2eec Support multi-targeting and add NuGet metadata
Updated `EnvelopeGenerator.DependencyInjection.csproj` to support multiple target frameworks (`net7.0`, `net8.0`, `net9.0`) for broader compatibility. Added NuGet package metadata to enable publishing, including details like `PackageId`, `Authors`, and `RepositoryUrl`.

Upgraded `Microsoft.Extensions.Configuration.Abstractions` and `Microsoft.Extensions.DependencyInjection.Abstractions` to version `9.0.6`. Added a project reference to `EnvelopeGenerator.Domain`.

Modified `EnvelopeGenerator.sln` to adjust the build configuration for the project with GUID `{90FE0312-8C38-4347-9EA2-0A719E255D5C}`, setting `Debug` to use the `Release` configuration.
2026-05-28 16:54:59 +02:00
83957d28e9 Add DependencyInjection class for service registration in EnvelopeGenerator 2026-05-28 16:27:30 +02:00
fe3f1347d5 Add EnvelopeGenerator.DependencyInjection project and update solution file 2026-05-28 16:27:21 +02:00
1e35e0447f Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2026-05-28 14:15:19 +02:00
7828ed237d Refactor utility functions for clarity and consistency
Updated `findNearest` for improved readability by renaming
parameters, introducing a helper function for distance
calculation, and using `Infinity` for clarity. Refactored
`getCurrentCulture` to use modern `typeof` syntax. Updated
`B64ToBuff` and `getLocaleDateString` for consistency with
naming conventions and concise syntax. Re-added
`detailedCurrentDate` to ensure consistency.
2026-05-27 16:16:50 +02:00
OlgunR
45377ea61c Merge branch 'master' of https://vcs.digitaldata.works/AppStd/EnvelopeGenerator 2026-03-13 10:44:39 +01:00
OlgunR
b5748550d1 Fix typo in document confirmation message
Corrected "red" to "read" in the DocumentSuccessfullyConfirmed resource string to ensure proper messaging.
2026-03-13 10:44:00 +01:00
64c018b92e Add DbSets for ElementAnnotation and DocumentStatus
Added DocumentReceiverElementAnnotations (ElementAnnotation) and DocumentStatus DbSet properties to EGDbContextBase to support database operations for these entities.
2026-03-12 16:11:50 +01:00
176672d7eb Add interface import and update email sending condition
Added import for EnvelopeGenerator.Domain.Interfaces. Updated logic to send final emails to receivers only if the envelope requires "Read and Sign," adding an extra check to the email dispatch condition.
2026-03-11 17:45:27 +01:00
05d54e87c3 Bump version to 3.12.3 in project file
Updated EnvelopeGenerator.Web.csproj to increment <Version>, <AssemblyVersion>, and <FileVersion> from 3.12.2 to 3.12.3, preparing for a new release. No other changes included.
2026-03-11 14:19:15 +01:00
06c2a07fbc Replace DateTime.UtcNow with DateTime.Now for timestamps
Switched all audit and creation timestamps from UTC to local time
by replacing DateTime.UtcNow with DateTime.Now across the codebase.
This affects audit fields, object creation, and default values for
date/time properties.
2026-03-11 14:11:23 +01:00
7cb1546934 Add Reject endpoint to AnnotationController
Introduced a new Reject endpoint for users with the ReceiverFull role to reject annotations, with optional reason support. Marked the endpoint as obsolete for future exception handling updates. Also standardized the Unauthorized response to remove the custom error message.
2026-03-11 12:09:23 +01:00
60db762bcc Bump project version to 3.12.2
Updated EnvelopeGenerator.Web.csproj to increment <Version>, <AssemblyVersion>, and <FileVersion> from 3.12.1 to 3.12.2, reflecting the new release. No other changes were made.
2026-03-11 12:08:48 +01:00
5e840db04c Refactor envelope rejection logic in EnvelopeController
Clarified and streamlined the handling of rejected envelopes:
- Moved retrieval of rejecting receivers for clarity.
- Signed out users when any rejecting receivers are present.
- Improved determination of "external" users.
- Updated condition for showing the EnvelopeRejected view.
- Temporarily hardcoded ViewBag.IsExt with a TODO for future fix.
- Removed redundant code for better maintainability.
2026-03-11 12:05:20 +01:00
e724a74f9c Bump version to 3.12.1 in project file
Updated <Version>, <AssemblyVersion>, and <FileVersion> in EnvelopeGenerator.Web.csproj from 3.12.0 to 3.12.1 to reflect a new patch release. No other changes were made.
2026-03-11 11:19:17 +01:00
48b7afcdc1 Restrict rejection check to ReadAndSign envelopes
Previously, rejection logic was applied to all envelopes. Now, the check for rejected receivers and the "EnvelopeRejected" view are only executed if the envelope is of the "ReadAndSign" type, preventing unnecessary rejection handling for other envelope types.
2026-03-11 11:16:08 +01:00
717da90c01 Add .NET 7.0 support and update project dependencies
Added net7.0 to TargetFrameworks in EnvelopeGenerator.Web.csproj and introduced a conditional ItemGroup with required package references for .NET 7.0 compatibility. Also removed clipboard2.svg from the list of included static files.
2026-03-11 11:07:33 +01:00
8054bb377d Refine rejection check for read-and-sign envelopes
Only return 423 Locked if envelope is read-and-sign and has a rejection history. Also add missing using for Domain.Interfaces in AnnotationController.
2026-03-11 09:43:35 +01:00
200258ff73 Update EnvelopeDto.ReadOnly to use IsReadAndConfirm()
Refactored the ReadOnly property in EnvelopeDto to use the IsReadAndConfirm() extension method instead of directly checking EnvelopeTypeId. Marked the property as [Obsolete] and advised using EnvelopeExtensions.IsReadAndConfirm.
2026-03-11 09:43:22 +01:00
fa73d939b5 Only check rejection for read-and-sign envelopes
Previously, rejection checks were performed for all envelopes. Now, the code checks for rejecting receivers only if the envelope is of the "read-and-sign" type, avoiding unnecessary queries and logic for other envelope types.
2026-03-11 09:29:24 +01:00
ca9e25abcb Add IsReadAndSign extension method to IEnvelope
Introduced the IsReadAndSign method to IEnvelope extensions, which returns true when EnvelopeTypeId is not 2. This allows clear differentiation between "Read and Sign" and "Read and Confirm" envelope types.
2026-03-11 09:28:40 +01:00
82831991b0 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2026-03-10 13:21:13 +01:00
OlgunR
260e8d53ba Update 'SignatureConfirmed' localization strings
Changed 'SignatureConfirmed' value in English to "Finalization confirmed" and in German to "Abschluss bestätigt". Updated designer file comments to match new wording.
2026-03-10 12:45:56 +01:00
OlgunR
0fd174ee0c Update resource strings and comments for read confirmation in Domain.Resources.Model
Switched Model.Designer.cs comments from German to English and added new resource string properties for read confirmation workflows. Updated Model.resx and Model.en.resx with new and corrected entries, improved translation consistency, and clarified documentation.
2026-03-10 11:55:57 +01:00
OlgunR
ab4cd7c254 Update resources for confirmation workflows & English comments in CommonService.Strings.Model
Replaced German comments/descriptions with English for clarity and internationalization. Added new resource strings for confirmation/read confirmation statuses (e.g., CompletelyConfirmed, Confirmation, DocumentConfirmed, etc.) to support both signing and read confirmation workflows. Corrected and standardized several existing resource values for consistency across languages.
2026-03-10 10:54:52 +01:00
1f5468b1ac Refactor PDF canvas transform to use Save/Restore state
Move Y-axis flip transform inside signature drawing block and
wrap with SaveState/RestoreState to prevent side effects on
other drawing operations and pages. Removes redundant
page-level transformation for better encapsulation.
2026-03-10 04:07:37 +01:00
b20aafe7a5 Fix PDF/A conversion status check in PDFMerger
Previously, the code checked the status of the original document
after converting the merged PDF to PDF/A, which could miss
conversion errors. Now, it correctly checks the status of the
merged PDF to ensure the conversion succeeded.
2026-03-10 04:07:28 +01:00
466d0a3a7a Refactor envelope and annotation data retrieval logic
Add private helper functions ReadEnvelope and LoadAnnotationDataForEnvelope to centralize retrieval of envelope byte data and annotation JSON from the database. Update PDF annotation burning logic to use these helpers, improving code reuse and testability.
2026-03-10 04:07:14 +01:00
7281cb47c3 Remove duplicate ProjectReference in BBTests.vbproj
Eliminated a redundant ProjectReference to EnvelopeGenerator.CommonServices.vbproj from the EnvelopeGenerator.BBTests.vbproj file, ensuring only a single reference remains. This helps prevent potential build issues and maintains project file clarity.
2026-03-10 03:25:38 +01:00
eb5db3d6be Remove StatusChangedWhen from DocumentStatus entity
The StatusChangedWhen property, previously required and mapped
to the "STATUS_CHANGED_WHEN" column, has been removed from
the DocumentStatus entity in the EnvelopeGenerator.Domain.Entities
namespace. This change simplifies the entity and its mapping.
2026-03-10 02:44:12 +01:00