-
Notifications
You must be signed in to change notification settings - Fork 14
Fix remove unsupported hash algs for file digest #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix remove unsupported hash algs for file digest #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes support for unsupported hash algorithms for file digest functionality, limiting the available algorithms to SHA-256 and SHA-512 while migrating from string-based to enum-based algorithm specification.
- Changed the target framework from .NET Standard 1.4 to .NET 8.0
- Replaced string-based hash algorithm specification with a strongly-typed enum
- Removed support for SHA-1 and SHA-384 algorithms, keeping only SHA-256 and SHA-512
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/signhost.ruleset | Added rule to disable StyleCop warning for closing parenthesis spacing |
| src/SignhostAPIClient/SignhostAPIClient.csproj | Updated target frameworks and removed .NET Standard 1.4 dependencies |
| src/SignhostAPIClient/Rest/StreamContentDigestOptionsExtensions.cs | Refactored to use enum-based algorithm selection and simplified hash creation |
| src/SignhostAPIClient/Rest/FileDigestOptions.cs | Changed DigestHashAlgorithm property from string to enum type |
| src/SignhostAPIClient/Rest/DigestHashAlgorithmNames.cs | Added new enum defining supported hash algorithms |
| src/SignhostAPIClient.Tests/SignhostApiClientTests.cs | Updated tests to use new enum values instead of string literals |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/SignhostAPIClient/Rest/StreamContentDigestOptionsExtensions.cs
Outdated
Show resolved
Hide resolved
Modernizes the codebase by upgrading to .NET 10, enabling use of newer language features and APIs. Removes legacy netstandard1.4 support and related conditional logic to simplify maintenance. Improves compatibility with future .NET releases.
- Replaced Newtonsoft.Json with System.Text.Json for JSON serialization and deserialization across the API client. - Updated interfaces and classes to reflect consistent naming conventions (e.g., ISignHostApiClient to ISignhostApiClient). - Removed obsolete JsonConverter classes that were specific to Newtonsoft.Json. - Introduced centralized JSON serializer options in SignhostJsonSerializerOptions for consistent serialization behavior. - Added new JSON test resources for various transaction scenarios to ensure compatibility with the updated serialization logic.
Also refactor file digest options to use enum for hash algorithms and update related tests
664c4d5 to
0789abb
Compare
|
Cherry-picked in #162 |
Based on #153