This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,75 @@
[
"lep030693",
"lep101433",
"lep203116",
"lep201505",
"lep203249",
"lep202936",
"lep035167",
"lep200313",
"lep201745",
"lep038437",
"lep035261",
"lep034917",
"lep035321",
"lep203162",
"lep038410",
"lep101508",
"lep035464",
"lep203164",
"lep035260",
"lep035273",
"lep029083",
"lep201767",
"lep035100",
"lep035065",
"lep101743",
"lep203393",
"lep201683",
"lep027413",
"lep031110",
"lep038816",
"lep203327",
"lep201609",
"lep032353",
"lep100510",
"lep032630",
"lep037713",
"lep200950",
"lep032392",
"lep037714",
"lep201468",
"lep203317",
"lep203217",
"lep203192",
"lep201188",
"lep200585",
"lep035343",
"lep202925",
"lep102350",
"lep035356",
"lep038071",
"lep035018",
"lep203260",
"lep035357",
"lep035307",
"lep035358",
"lep200667",
"lep038440",
"lep203126",
"lep035016",
"lep200881",
"lep038422",
"lep200696",
"lep034905",
"lep203394",
"lep035010",
"lep203387",
"lep202939",
"lep100565",
"lep035305",
"lep064329",
"lep999997",
"lep999996",
"lep200486"
]

View file

@ -0,0 +1,21 @@
namespace Kreta.Web.Configuration
{
public interface IIdpConfiguration
{
string AuthenticationTokenKey { get; }
string LogoutUrl { get; }
bool LoginEnabled { get; }
bool RequirePkce { get; }
string Authority { get; }
string ClientId { get; }
string RedirectUri { get; }
string PostLogoutRedirectUri { get; }
}
}

View file

@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace Kreta.Web.Configuration
{
public interface IUploadFileValidationConfiguration
{
int ImportMaxAllowedFileSizeInBytes { get; }
IEnumerable<string> ImportAllowedFileExtensions { get; }
IEnumerable<string> AscImportAllowedFileExtensions { get; }
}
}

View file

@ -0,0 +1,34 @@
using System.Configuration;
namespace Kreta.Web.Configuration
{
public class IdpConfiguration : ConfigurationSection, IIdpConfiguration
{
[ConfigurationProperty(nameof(AuthenticationTokenKey), IsRequired = true)]
public string AuthenticationTokenKey => (string)base[nameof(AuthenticationTokenKey)];
[ConfigurationProperty(nameof(LogoutUrl), IsRequired = true)]
public string LogoutUrl => (string)base[nameof(LogoutUrl)];
[ConfigurationProperty(nameof(LoginEnabled), IsRequired = true)]
public bool LoginEnabled => (bool)base[nameof(LoginEnabled)];
[ConfigurationProperty(nameof(RequirePkce), IsRequired = true)]
public bool RequirePkce => (bool)base[nameof(RequirePkce)];
[ConfigurationProperty(nameof(Authority), IsRequired = true)]
public string Authority => (string)base[nameof(Authority)];
[ConfigurationProperty(nameof(ClientId), IsRequired = true)]
public string ClientId => (string)base[nameof(ClientId)];
[ConfigurationProperty(nameof(Scope), IsRequired = true)]
public string Scope => (string)base[nameof(Scope)];
[ConfigurationProperty(nameof(RedirectUri), IsRequired = true)]
public string RedirectUri => (string)base[nameof(RedirectUri)];
[ConfigurationProperty(nameof(PostLogoutRedirectUri), IsRequired = true)]
public string PostLogoutRedirectUri => (string)base[nameof(PostLogoutRedirectUri)];
}
}

View file

@ -0,0 +1,50 @@
using System;
using System.Configuration;
namespace Kreta.Web.Configuration
{
/// <summary>
/// Authorization configuration section for mobile API
/// </summary>
/// <seealso cref="System.Configuration.ConfigurationSection" />
public class MobileApiConfigurationSection : ConfigurationSection
{
const string SectionName = "MobileApiAuthorization";
/// <summary>
/// The instance
/// </summary>
static Lazy<MobileApiConfigurationSection> instance;
/// <summary>
/// Gets the instance.
/// </summary>
/// <value>
/// The instance.
/// </value>
public static MobileApiConfigurationSection Instance
{
get
{
return instance.Value;
}
}
[ConfigurationProperty(nameof(ApiKey), IsRequired = true)]
public string ApiKey
{
get
{
return (string)this[nameof(ApiKey)];
}
}
/// <summary>
/// Initializes the <see cref="MobileApiConfigurationSection"/> class.
/// </summary>
static MobileApiConfigurationSection()
{
instance = new Lazy<MobileApiConfigurationSection>(() => (MobileApiConfigurationSection)ConfigurationManager.GetSection(SectionName));
}
}
}

View file

@ -0,0 +1,28 @@
using System;
using System.Configuration;
using System.IO;
using Kreta.Core.Elearning.Nexius;
namespace Kreta.Web.Configuration
{
public class NexiusCourseServiceConfiguration : ConfigurationSection, INexiusCourseServiceConfiguration
{
[ConfigurationProperty(nameof(ApplicationId))]
public string ApplicationId => (string)base[nameof(ApplicationId)];
[ConfigurationProperty(nameof(ApplicationSecret))]
public string ApplicationSecret => (string)base[nameof(ApplicationSecret)];
[ConfigurationProperty(nameof(ApplicationTokenGeneratorUrl))]
public string ApplicationTokenGeneratorUrl => (string)base[nameof(ApplicationTokenGeneratorUrl)];
[ConfigurationProperty("RequestBaseUrl")]
public Uri RequestBaseUri => (Uri)base["RequestBaseUrl"];
[ConfigurationProperty(nameof(CourseAccessXmlPath))]
public string CourseAccessXmlPath => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, (string)base[nameof(CourseAccessXmlPath)]);
[ConfigurationProperty(nameof(TokenRetryCount))]
public int TokenRetryCount => (int)base[nameof(TokenRetryCount)];
}
}

View file

@ -0,0 +1,21 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Linq;
namespace Kreta.Web.Configuration
{
public class UploadFileValidationConfiguration : ConfigurationSection, IUploadFileValidationConfiguration
{
[ConfigurationProperty(nameof(ImportMaxAllowedFileSizeInBytes), IsRequired = true)]
public int ImportMaxAllowedFileSizeInBytes => (int)this[nameof(ImportMaxAllowedFileSizeInBytes)];
[ConfigurationProperty(nameof(ImportAllowedFileExtensions), IsRequired = true)]
[TypeConverter(typeof(CommaDelimitedStringCollectionConverter))]
public IEnumerable<string> ImportAllowedFileExtensions => ((CommaDelimitedStringCollection)this[nameof(ImportAllowedFileExtensions)]).OfType<string>();
[ConfigurationProperty(nameof(AscImportAllowedFileExtensions), IsRequired = true)]
[TypeConverter(typeof(CommaDelimitedStringCollectionConverter))]
public IEnumerable<string> AscImportAllowedFileExtensions => ((CommaDelimitedStringCollection)this[nameof(AscImportAllowedFileExtensions)]).OfType<string>();
}
}