Fix remove unsupported hash algs for file digest#154
Closed
Fix remove unsupported hash algs for file digest#154
Conversation
There was a problem hiding this comment.
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
Collaborator
Author
|
Cherry-picked in #162 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #153