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

[PM-14439] Add PolicyRequirementQuery for enforcement logic #5336

Merged
merged 43 commits into from
Feb 14, 2025
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8701e20
Add requirements
eliykat Jan 27, 2025
d0bcb2b
Add draft sql query
eliykat Jan 27, 2025
010d6b8
Simple query without generics
eliykat Jan 27, 2025
9fa1096
Build out query
eliykat Jan 28, 2025
b3977d4
Use delegate, wire up
eliykat Jan 28, 2025
a6d4680
Merge remote-tracking branch 'origin/main' into policy-requirements-rโ€ฆ
eliykat Jan 29, 2025
983eb70
Tweak naming, use extension methods
eliykat Jan 29, 2025
6f5df04
Wrap dict in separate class
eliykat Jan 29, 2025
205dde2
Remove duplicate comment
eliykat Jan 29, 2025
e335e30
fix linting and style
eliykat Jan 29, 2025
9fc08b4
Merge remote-tracking branch 'origin/main' into policy-requirements-rโ€ฆ
eliykat Feb 7, 2025
3f7de0f
Revert other policy requirements for MVP, tweak single org
eliykat Feb 7, 2025
2049cc8
Call new query in accept org user flow
eliykat Feb 7, 2025
377cc82
Add to signup command
eliykat Feb 7, 2025
e479c1d
Move error strings to requirement class
eliykat Feb 7, 2025
0968774
revert singleorg req
eliykat Feb 10, 2025
f756366
remove unused helper
eliykat Feb 10, 2025
db4bed4
Use new data class
eliykat Feb 11, 2025
6d7330b
Add EF implementation and tests
eliykat Feb 11, 2025
473341e
Tweak tests
eliykat Feb 11, 2025
8812084
Enable nullable, add xmldoc
eliykat Feb 11, 2025
950715a
Add tests
eliykat Feb 11, 2025
0bb72ca
Simplify implementation to use standard DI
eliykat Feb 11, 2025
59cdaa1
dotnet format
eliykat Feb 11, 2025
a55e39e
Revert "dotnet format"
eliykat Feb 11, 2025
d09c62a
dotnet format
eliykat Feb 11, 2025
22f0f07
Use pattern matching per Rui feedback
eliykat Feb 11, 2025
56cdfe2
Merge branch 'main' into policy-requirements-refactor
eliykat Feb 11, 2025
46d9a01
Address feedback re helpers
eliykat Feb 11, 2025
3265439
Rename delegate
eliykat Feb 11, 2025
0e7f726
Merge branch 'policy-requirements-refactor' of https://github.com/bitโ€ฆ
eliykat Feb 11, 2025
e955261
Enable nullable
eliykat Feb 11, 2025
57afa9f
Add xmldoc
eliykat Feb 11, 2025
fb3ab3c
Tweak comment
eliykat Feb 11, 2025
91753f5
bump migration date
eliykat Feb 12, 2025
41563b0
revert obsolete attributes
eliykat Feb 12, 2025
c33395d
Add xmldoc
eliykat Feb 12, 2025
71eb8d7
Merge remote-tracking branch 'origin/main' into policy-requirements-rโ€ฆ
eliykat Feb 13, 2025
b59495d
Bump migration script date
eliykat Feb 13, 2025
650b01c
Add tests and comments around revoked invited users
eliykat Feb 13, 2025
1d83d11
Merge branch 'main' into policy-requirements-refactor
eliykat Feb 13, 2025
32e17d4
Merge remote-tracking branch 'origin/main' into policy-requirements-rโ€ฆ
eliykat Feb 14, 2025
3e4317b
bump date
eliykat Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove duplicate comment
eliykat committed Jan 29, 2025
commit 205dde293011d261504b48b96a42fddff5c237d6
Copy link
Member Author

Choose a reason for hiding this comment

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

There is an intentional split of responsibilities here: all business logic is in the policy requirements, which are written in a functional style. The query is agnostic about what policies are being handled - its only job is to connect policy requirements to dependencies.

Original file line number Diff line number Diff line change
@@ -32,9 +32,6 @@ private Task<IEnumerable<OrganizationUserPolicyDetails>> GetPolicyDetails(Guid u
/// </summary>
private class PolicyRequirementRegistry
{
/// <summary>
/// A dictionary associating a Policy Requirement's type with its factory function.
/// </summary>
private readonly Dictionary<Type, CreateRequirement<IPolicyRequirement>> _registry = new();

public void Add<T>(CreateRequirement<T> factory) where T : IPolicyRequirement
Loading