Settings for the server are now combined with the settings from the SDK. This introduces a large breaking change and a migration should be created. This refactor utilizes .NET Configuration and the Options pattern. This will allow for the overriding of any setting using envionment variables. It also means that Settings.yml can be used to override any .NET configuration. A SettingsProvider implementation was created, and any updating of settings was changed from SettingsService.SaveSettings() to SettingsProvider.Update(s => { ... })
26 lines
No EOL
967 B
C#
26 lines
No EOL
967 B
C#
using LANCommander.Server.Settings.Enums;
|
|
|
|
namespace LANCommander.Server.Settings.Models;
|
|
|
|
public class AuthenticationProvider
|
|
{
|
|
public string Name { get; set; }
|
|
public string Slug { get; set; }
|
|
public AuthenticationProviderType Type { get; set; } = AuthenticationProviderType.OAuth2;
|
|
public string Color { get; set; }
|
|
public string Icon { get; set; }
|
|
public string Documentation { get; set; }
|
|
public string ClientId { get; set; }
|
|
public string ClientSecret { get; set; }
|
|
public string AuthorizationEndpoint { get; set; }
|
|
public string TokenEndpoint { get; set; }
|
|
public string UserInfoEndpoint { get; set; }
|
|
public string ConfigurationUrl { get; set; }
|
|
public IEnumerable<string> Scopes { get; set; } = new List<string>();
|
|
public IEnumerable<ClaimMapping> ClaimMappings { get; set; } = new List<ClaimMapping>();
|
|
|
|
public string GetCustomFieldName()
|
|
{
|
|
return $"ExternalId/{Slug}";
|
|
}
|
|
} |