Skip to content

Commit

Permalink
Add service configuration to block prohibited teachers (#743)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Oct 17, 2023
1 parent 2b8fa63 commit a361df8
Show file tree
Hide file tree
Showing 17 changed files with 1,127 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public record Client
public required string? ServiceUrl { get; init; }
public required TrnRequirementType TrnRequirementType { get; init; }
public required TrnMatchPolicy TrnMatchPolicy { get; set; }
public required bool BlockProhibitedTeachers { get; set; }
public required bool RaiseTrnResolutionSupportTickets { get; init; }
public required string[] RedirectUris { get; init; }
public required string[] PostLogoutRedirectUris { get; init; }
Expand All @@ -23,6 +24,7 @@ public record Client
ServiceUrl = descriptor.ServiceUrl,
TrnRequirementType = descriptor.TrnRequirementType,
TrnMatchPolicy = descriptor.TrnMatchPolicy,
BlockProhibitedTeachers = descriptor.BlockProhibitedTeachers,
RaiseTrnResolutionSupportTickets = descriptor.RaiseTrnResolutionSupportTickets,
RedirectUris = descriptor.RedirectUris.Select(u => u.ToString()).ToArray(),
PostLogoutRedirectUris = descriptor.PostLogoutRedirectUris.Select(u => u.ToString()).ToArray(),
Expand All @@ -32,18 +34,19 @@ public record Client
.ToArray()
};

public static Client FromModel(Models.Application model) => new()
public static Client FromModel(Application model) => new()
{
ClientId = model.ClientId!,
DisplayName = model.DisplayName,
ServiceUrl = model.ServiceUrl,
TrnRequirementType = model.TrnRequirementType,
TrnMatchPolicy = model.TrnMatchPolicy,
BlockProhibitedTeachers = model.BlockProhibitedTeachers,
RaiseTrnResolutionSupportTickets = model.RaiseTrnResolutionSupportTickets,
RedirectUris = model.GetRedirectUris(),
PostLogoutRedirectUris = model.GetPostLogoutRedirectUris(),
Scopes = model.GetScopes()
};

public static implicit operator Client(Models.Application model) => FromModel(model);
public static implicit operator Client(Application model) => FromModel(model);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ public enum ClientUpdatedEventChanges
GrantTypes = 1 << 6,
TrnRequirementType = 1 << 7,
RaiseTrnResolutionSupportTickets = 1 << 8,
TrnMatchPolicy = 1 << 9
TrnMatchPolicy = 1 << 9,
BlockProhibitedTeachers = 1 << 10,
}
Loading

0 comments on commit a361df8

Please sign in to comment.