Skip to content

Commit

Permalink
fix(janitor): Update min auth level on janitor RR sync (#2003)
Browse files Browse the repository at this point in the history
Co-authored-by: Ole Jørgen Skogstad <[email protected]>
  • Loading branch information
MagnusSandgren and oskogstad authored Mar 6, 2025
1 parent f8d232b commit 58a2170
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public async Task<DateTimeOffset> GetLastUpdatedAt(

public async Task<int> Merge(IReadOnlyCollection<ResourcePolicyInformation> resourceMetadata, CancellationToken cancellationToken)
{
// language=sql
const string sql =
$"""
with source as (
Expand All @@ -41,7 +42,9 @@ as s(id, resource, minimumSecurityLevel, createdAt, updatedAt)
using source s
on t."{nameof(ResourcePolicyInformation.Resource)}" = s.resource
when matched then
update set "{nameof(ResourcePolicyInformation.UpdatedAt)}" = s.updatedAt
update set
"{nameof(ResourcePolicyInformation.UpdatedAt)}" = s.updatedAt,
"{nameof(ResourcePolicyInformation.MinimumAuthenticationLevel)}" = s.minimumSecurityLevel
when not matched then
insert ("{nameof(ResourcePolicyInformation.Id)}", "{nameof(ResourcePolicyInformation.Resource)}", "{nameof(ResourcePolicyInformation.MinimumAuthenticationLevel)}", "{nameof(ResourcePolicyInformation.CreatedAt)}", "{nameof(ResourcePolicyInformation.UpdatedAt)}")
values (s.id, s.resource, s.minimumSecurityLevel, s.createdAt, s.updatedAt);
Expand Down

0 comments on commit 58a2170

Please sign in to comment.