Skip to content
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

Allow review from unauthorized users #15

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

lukaszgarstecki
Copy link
Member

@lukaszgarstecki lukaszgarstecki commented Oct 14, 2024

There is a new requirement, that forces us to reconfigure most of the storage part of the rating feature. I'm not sure how we want to approach the data migration to the new backend version (do we care at all?).

Decisions made on the fly:

  • Unauthorized user is unable to check if they already submitted the review.
  • We don't want to use prefixed id for AppRatingId - this would require yet another configuration on the package user side.
  • For unauthorized users the default value for UserId will be provided (this is especially important when used with structs).

Tests for unauthorized user are missing...

Copy link

github-actions bot commented Oct 14, 2024

Test Results

3 files  3 suites   16s ⏱️
8 tests 8 ✅ 0 💤 0 ❌
9 runs  9 ✅ 0 💤 0 ❌

Results for commit 828be09.

♻️ This comment has been updated with latest results.

@lukaszgarstecki lukaszgarstecki force-pushed the feature/allow-review-from-unauthorized-users branch from b6feb42 to 5467faa Compare October 14, 2024 14:58
@@ -4,5 +4,5 @@ namespace LeanCode.AppRating;

public interface IUserIdExtractor<TUserId>
{
public TUserId Extract(HttpContext httpContext);
public bool TryExtract(HttpContext httpContext, out TUserId? userId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest having both, one that throws, and one that doesn't. The one can be implemented (w/ default interface implementation) using the other.

@@ -1,10 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed that so that I could check the type internals, but I guess we don't need that in repository

@lukaszgarstecki lukaszgarstecki merged commit c50c245 into main Oct 15, 2024
3 checks passed
@lukaszgarstecki lukaszgarstecki deleted the feature/allow-review-from-unauthorized-users branch October 15, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants