Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3343656
TD-5700-fix
AnjuJose011 Jul 3, 2025
20ca42e
TD-5727
AnjuJose011 Jul 10, 2025
19d6cfc
TD-5727
AnjuJose011 Jul 10, 2025
247ef8f
TD-5829: Introduced Shared Project refactored code shared with Blazor…
Phil-NHS Jul 18, 2025
2db7358
Merge pull request #1283 from TechnologyEnhancedLearning/TD-5727-Cont…
AnjuJose011 Jul 30, 2025
a8c26db
Merge pull request #1286 from TechnologyEnhancedLearning/TD-5700-Reso…
AnjuJose011 Jul 30, 2025
aa9a1a5
TD-5862 Squash following merging RC changes
Phil-NHS Jul 30, 2025
bcd5659
bit of moodle refactoring and reload the moodle user
Jul 30, 2025
60f1317
Rolling back Models to 48 to fix the build
Jul 30, 2025
230a260
TD-5862 restoring interface
Phil-NHS Jul 30, 2025
78709c7
TD-5862 reopen pull request
Phil-NHS Jul 30, 2025
dcca696
TD-5862 Merge in to new branch
Phil-NHS Jul 30, 2025
99fc2b6
TD-5829 was missing configuration of bff
Phil-NHS Jul 30, 2025
6242cfd
Merge pull request #1289 from TechnologyEnhancedLearning/Develop/Fixe…
binon Jul 31, 2025
c800d32
TD-5829 Ivory updated
Phil-NHS Jul 31, 2025
3279ef6
TD-5829 Updating to accomodate changes to Ivory
Phil-NHS Jul 31, 2025
bcdff4b
TD-5888 adding blazor serverside and TELBlazor package ref
Phil-NHS Aug 1, 2025
ce07ada
TD-5888 Builds, requires httpclient and comments tidying
Phil-NHS Aug 1, 2025
8167a97
TD-5888 Working when not using shared project
Phil-NHS Aug 6, 2025
edd96ee
TD-5888 tidy up client registration
Phil-NHS Aug 6, 2025
f06621f
TD-5888 NOT FOR PRODUCTION UNTIL SQUASHED AND REVISED PR FOR REVIEW D…
Phil-NHS Aug 8, 2025
e8943a6
TD-5888 Adding in WebUI Shared because its quick and its the one chan…
Phil-NHS Aug 11, 2025
5505e8d
TD-5888 Just adding middleware for completeness
Phil-NHS Aug 12, 2025
1217fba
TD-5888 implementing some PR renaming publicconfig
Phil-NHS Aug 13, 2025
15f02cf
Merge pull request #1314 from TechnologyEnhancedLearning/Develop/Feat…
Phil-NHS Aug 13, 2025
b707c97
TD-5924 Infastructure only not supporting httpclient and config but w…
Phil-NHS Aug 13, 2025
11ef2fa
TD-5924 Required HttpClient we did want to review first but will be c…
Phil-NHS Aug 14, 2025
4f1792b
TD-5924 Use production TELBlazor package added a config that can be u…
Phil-NHS Aug 14, 2025
db4a186
TD-5924 Test with component see logs on click
Phil-NHS Aug 14, 2025
a88ba06
TD-5924 Tidy up
Phil-NHS Aug 14, 2025
da16382
TD-5924 wwwroot clientside appsetting are exposed and should be sourc…
Phil-NHS Aug 14, 2025
4920772
TD-5924 Appsettings
Phil-NHS Aug 14, 2025
48955d1
TD-5924 appsetting corrections
Phil-NHS Aug 14, 2025
87f3f5c
Merge pull request #1327 from TechnologyEnhancedLearning/Develop/Feat…
Phil-NHS Aug 21, 2025
7087371
refactor(nuget): nuget position to solution level
Phil-NHS Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,10 @@ obj
/AdminUI/LearningHub.Nhs.AdminUI/web.config
/LearningHub.Nhs.WebUI/web.config
/WebAPI/LearningHub.Nhs.API/web.config
/LearningHub.Nhs.WebUI/nuget.config
/LearningHub.Nhs.WebUI.BlazorClient/Properties/launchSettings.json
/LearningHub.Nhs.WebUI.BlazorClient/wwwroot/appsettings.json
/LearningHub.Nhs.WebUI.BlazorClient/wwwroot/appsettings.Development.json
/LearningHub.Nhs.WebUI.BlazorClient/nuget.config
/LearningHub.Nhs.WebUI.BlazorClient/LearningHub.Nhs.WebUI.BlazorClient.csproj.user
/nuget.config
29 changes: 29 additions & 0 deletions LearningHub.Nhs.Shared/Configuration/ExposableFindwiseSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace LearningHub.Nhs.Shared.Configuration
{
using LearningHub.Nhs.Shared.Interfaces.Configuration;
/// <summary>
/// Represents a public-facing set of configuration values for Findwise search,
/// intended to be safely exposed to client-side applications or public APIs.
///
/// <para>
/// Contains only non-sensitive data such as page sizes for various search types.
/// </para>
/// </summary>
public class ExposableFindwiseSettings : IExposableFindwiseSettings
{
/// <summary>
/// Gets or sets the ResourceSearchPageSize.
/// </summary>
public int ResourceSearchPageSize { get; set; }

/// <summary>
/// Gets or sets the CatalogueSearchPageSize.
/// </summary>
public int CatalogueSearchPageSize { get; set; }

/// <summary>
/// Gets or sets the AllCatalogueSearchPageSize.
/// </summary>
public int AllCatalogueSearchPageSize { get; set; }
}
}
36 changes: 36 additions & 0 deletions LearningHub.Nhs.Shared/Configuration/ExposableSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
namespace LearningHub.Nhs.Shared.Configuration
{
using LearningHub.Nhs.Shared.Interfaces.Configuration;
/// <summary>
/// Represents configuration values that are safe to expose to clientside frontend applications
/// (such as Blazor WebAssembly) or public-facing APIs.
///
/// <para>
/// Implements <see cref="IExposableSettings"/> and contains only non-sensitive, non-secret
/// values such as public API endpoints and pagination settings. This separation ensures
/// that secure or private configuration data is not inadvertently exposed to clients.
/// </para>
/// </summary>
public class ExposableSettings : IExposableSettings
{
/// <inheritdoc/>
public string LearningHubApiUrl { get; set; }

/// <summary>
/// Gets or sets the UserApiUrl.
/// </summary>
public string UserApiUrl { get; set; }

/// <summary>
/// Gets or sets the OpenApiUrl.
/// </summary>
public string OpenApiUrl { get; set; }
/// <summary>
/// Backend for Frontend (BFF) URL for the Learning Hub API accessed by samesite cookie and uses httpclients with bearers to access external apis.
/// </summary>
public string LearningHubApiBFFUrl { get; set; }
/// <inheritdoc/>
public IExposableFindwiseSettings FindwiseSettings { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace LearningHub.Nhs.Shared.Interfaces.Configuration
{
/// <summary>
/// Represents configuration values related to Findwise search that are safe to expose
/// to client-side applications or public-facing APIs.
///
/// <para>
/// This includes non-sensitive values such as page sizes for different types of search results.
/// It does not contain any secure credentials or internal service configuration.
/// </para>
/// </summary>
public interface IExposableFindwiseSettings
{
/// <summary>
/// Gets or sets the page size for resource search results.
/// </summary>
public int ResourceSearchPageSize { get; set; }

/// <summary>
/// Gets or sets the CatalogueSearchPageSize.
/// </summary>
public int CatalogueSearchPageSize { get; set; }

/// <summary>
/// Gets or sets the AllCatalogueSearchPageSize.
/// </summary>
public int AllCatalogueSearchPageSize { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
namespace LearningHub.Nhs.Shared.Interfaces.Configuration
{
/// <summary>
/// Defines a contract for configuration data that is non-sensitive and safe to expose publicly
///
/// <para>
/// This interface exposes only data that is safe to be publicly consumed or shared,
/// such as API endpoint URLs or non-sensitive configuration values.
/// It explicitly excludes any private or sensitive information (e.g., authentication tokens,
/// credentials, or secret keys), which should be handled via separate interfaces or services.
/// </para>
///
/// <para>
/// The data provided by this interface can be safely used in frontend technologies,
/// such as Blazor WebAssembly, JavaScript frameworks, or other client-side applications,
/// without risking exposure of sensitive information.
/// </para>
/// </summary>
public interface IExposableSettings
{
/// <summary>
/// Gets or sets the LearningHubApiUrl.
/// </summary>
public string LearningHubApiUrl { get; set; }

/// <summary>
/// Gets or sets the UserApiUrl.
/// </summary>
public string UserApiUrl { get; set; }

/// <summary>
/// Gets or sets the OpenApiUrl.
/// </summary>
public string OpenApiUrl { get; set; }
/// <summary>
/// Gets or sets the LearningHubApiBFFUrl used to proxy via same domain cookie to the BFF LearningHubAPI calls.
/// </summary>
public string LearningHubApiBFFUrl { get; set; }

public IExposableFindwiseSettings FindwiseSettings { get; set; }
}
}
18 changes: 18 additions & 0 deletions LearningHub.Nhs.Shared/Interfaces/Http/IAPIHttpClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace LearningHub.Nhs.Shared.Interfaces.Http
{
/// <summary>
/// Represents an HTTP client for a specific API.
/// </summary>
public interface IAPIHttpClient
{
/// <summary>
/// Gets the configured <see cref="HttpClient"/> for the API.
/// </summary>
Task<HttpClient> GetClientAsync();

/// <summary>
/// Gets the base URL of the API.
/// </summary>
string ApiUrl { get; }
}
}
22 changes: 22 additions & 0 deletions LearningHub.Nhs.Shared/Interfaces/Http/ILearningHubHttpClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace LearningHub.Nhs.Shared.Interfaces.Http
{
/// <summary>
/// Marker interface for the LearningHub API HttpClient.
///
/// <para>
/// Inherits from <see cref="IAPIHttpClient"/> to enable
/// dependency injection of a specific implementation configured with
/// different API endpoints or settings specific to LH API.
/// </para>
///
/// <para>
/// Currently, this interface is empty and used solely to differentiate implementations
/// that connect to different endpoints via configuration, but it may be extended in the future
/// with LearningHub-specific functionality or properties.
/// </para>
/// </summary>
public interface ILearningHubHttpClient : IAPIHttpClient
{

}
}
28 changes: 28 additions & 0 deletions LearningHub.Nhs.Shared/Interfaces/Http/IOpenAPIHttpClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LearningHub.Nhs.Shared.Interfaces.Http
{
/// <summary>
/// Marker interface for the IOpenAPIHttpClient API HttpClient.
///
/// <para>
/// Inherits from <see cref="IAPIHttpClient"/> to enable
/// dependency injection of a specific implementation configured with
/// a openapi-related API endpoint or settings.
/// </para>
///
/// <para>
/// This interface is currently empty and used solely to differentiate
/// implementations that connect to different endpoints via configuration.
/// It may be extended in the future with user-specific functionality or properties.
/// </para>
/// </summary>
public interface IOpenApiHttpClient : IAPIHttpClient
{

}
}
22 changes: 22 additions & 0 deletions LearningHub.Nhs.Shared/Interfaces/Http/IUserAPIHttpClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace LearningHub.Nhs.Shared.Interfaces.Http
{
/// <summary>
/// Marker interface for the User API HttpClient.
///
/// <para>
/// Inherits from <see cref="IAPIHttpClient"/> to enable
/// dependency injection of a specific implementation configured with
/// a user-related API endpoint or settings.
/// </para>
///
/// <para>
/// This interface is currently empty and used solely to differentiate
/// implementations that connect to different endpoints via configuration.
/// It may be extended in the future with user-specific functionality or properties.
/// </para>
/// </summary>
public interface IUserApiHttpClient : IAPIHttpClient
{

}
}
16 changes: 16 additions & 0 deletions LearningHub.Nhs.Shared/LearningHub.Nhs.Shared.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Folder Include="Models\Contribute\" />
<Folder Include="Models\Paging\" />
</ItemGroup>

</Project>


Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

30 changes: 30 additions & 0 deletions LearningHub.Nhs.WebUI.BlazorClient/DI/DI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Microsoft.Extensions.Options;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using LearningHub.Nhs.Shared.Configuration;


namespace LearningHub.Nhs.WebUI.BlazorClient.DI
{
public static class DI
{
public static IHttpClientBuilder AddBffHttpClient<TInterface, TImplementation>(this IServiceCollection services, Func<ExposableSettings, string> getApiUrl)
where TInterface : class
where TImplementation : class, TInterface
{
return services.AddHttpClient<TInterface, TImplementation>((serviceProvider, client) =>
{
var ExposableSettings = serviceProvider.GetRequiredService<IOptions<ExposableSettings>>().Value;
var apiUrl = getApiUrl(ExposableSettings);
var apiUri = new Uri(apiUrl);
var apiHost = apiUri.Host;
string forwardSlash = "/";
// Using the Uri class for robust path joining
client.BaseAddress = new Uri($"{ExposableSettings.LearningHubApiBFFUrl}{apiHost}{forwardSlash}");
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<!-- Debug settings only for development -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<BlazorWebAssemblyEnableDebugging>true</BlazorWebAssemblyEnableDebugging>
<DebugType>full</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />

<!--Configuration http -->
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />

<!-- Logging -->
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.BrowserConsole" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Http" Version="8.0.0" />

<!-- Utilities -->
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageReference Include="TELBlazor.Components" Version="1.10.0" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LearningHub.Nhs.Shared\LearningHub.Nhs.Shared.csproj" />
<ProjectReference Include="..\LearningHub.Nhs.WebUI.Shared\LearningHub.Nhs.WebUI.Shared.csproj" />
</ItemGroup>
</Project>

Loading
Loading