Add student SGU profile synchronization
This commit is contained in:
@@ -133,9 +133,13 @@ public sealed class NtlmCredentialValidator(BrokerOptions options) : INtlmCreden
|
||||
private Uri GetProfileUri(InstitutionalRole role)
|
||||
{
|
||||
Uri endpoint = new(options.Endpoint, UriKind.Absolute);
|
||||
string path = role == InstitutionalRole.Administrative
|
||||
? options.AdministrativeProfilePath
|
||||
: options.MenuProfilePath;
|
||||
string path = role switch
|
||||
{
|
||||
InstitutionalRole.Administrative => options.AdministrativeProfilePath,
|
||||
InstitutionalRole.Student => options.StudentProfilePath,
|
||||
InstitutionalRole.Professor => options.MenuProfilePath,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(role), role, null)
|
||||
};
|
||||
return new Uri(endpoint, path);
|
||||
}
|
||||
|
||||
@@ -151,10 +155,17 @@ public sealed class NtlmCredentialValidator(BrokerOptions options) : INtlmCreden
|
||||
response.Content,
|
||||
options.MaxProfileBytes,
|
||||
timeoutToken).ConfigureAwait(false);
|
||||
return identity.Role == InstitutionalRole.Administrative
|
||||
? SguProfileParser.ParseAdministrative(html, identity.NumericId) ??
|
||||
SguProfileParser.ParseMenu(html)
|
||||
: SguProfileParser.ParseMenu(html);
|
||||
return identity.Role switch
|
||||
{
|
||||
InstitutionalRole.Administrative =>
|
||||
SguProfileParser.ParseAdministrative(html, identity.NumericId) ??
|
||||
SguProfileParser.ParseMenu(html),
|
||||
InstitutionalRole.Student =>
|
||||
SguProfileParser.ParseStudent(html, identity.NumericId) ??
|
||||
SguProfileParser.ParseMenu(html),
|
||||
InstitutionalRole.Professor => SguProfileParser.ParseMenu(html),
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
catch (OperationCanceledException) when (requestCancellationToken.IsCancellationRequested)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user