Letieri
How to Implement Automatic Versioning for NuGet Package Using GitHub Actions?
Hello everyone,
I’m currently working on automating the release process for my NuGet package and would like to implement automatic versioning using GitHub Actions. I've managed to set up a workflow that builds and publishes the package to both GitHub Packages and NuGet.org, but I'm struggling to add the automatic version increment functionality.
Here's my current workflow:
`
2 replies
Issue with unit test for Argon2-based password hash service
I'm encountering an issue with the implementation of a password hash service using the Argon2 algorithm. I've created a PasswordHasherService class that utilizes Argon2 to generate secure password hashes, along with a method to verify passwords.
The implementation of the class seems to be correct, but I'm facing difficulties with a specific unit test. The unit test aims to verify if the VerifyPassword() method returns false when an incorrect salt is provided.
Here's an overview of the problem:
The PasswordHasherService class has three main methods:
HashPassword(): generates a secure password hash using Argon2 and returns the hash along with the salt used.
VerifyPassword(): checks if a provided password matches a provided password hash, taking into account the salt used during hash generation.
GenerateSalt(): generates a random salt.
The unit test in question, named VerifyPassword_ReturnsFalseForIncorrectSalt, checks if the VerifyPassword() method returns false when an incorrect salt is provided.
However, even when intentionally providing an incorrect salt in the unit test, the returned result is true, indicating that the test is failing.
I've reviewed the code multiple times and ensured that the implementation of the PasswordHasherService class is correct. I've also confirmed that the salt is being generated correctly using the GenerateSalt() method. However, I haven't been able to pinpoint the root cause of this issue.
I'm reaching out to the community for assistance in understanding what might be causing this unexpected behavior and how I can fix my unit test to ensure it functions as expected.
Any guidance or suggestions would be greatly appreciated. Thank you in advance for your help!
25 replies
Retrieving Roles with Empty Permission Arrays in Entity Framework Core Repository
When I use this repository it returns the records correctly, except for the records where the Permissions array is empty, it should also return these cases.
When I use instead of it returns me those in which Permissions is empty but it does not return the roles in which I deleted any RolePermissions records.
6 replies
Many-to-many with class for join entity EF
I'm facing an issue with implementing soft deletes in a custom many-to-many relationship class. I've created a custom class to handle the relationship, but I'm struggling to figure out how to modify the repository's get method to only fetch entities where the relationship's DeletedAt is not null.
20 replies