Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b4d363e
feat: this commit introduces initial solution and project files for …
https-richardy Mar 28, 2026
9bdbff4
feat: this commit introduces launchSettings and appsettings configura…
https-richardy Mar 28, 2026
f158f30
feat: this commit introduces initial program.cs file for proxy applic…
https-richardy Mar 28, 2026
91f795f
fix: correct target framework version from net10.0 to net9.0 in proje…
https-richardy Mar 28, 2026
26efe76
feat: this commit introduces ocelot package reference for API gateway…
https-richardy Mar 28, 2026
7a8e66e
feat: this commit introduces global usings
https-richardy Mar 28, 2026
3736f8e
fix: remove unnecessary Microsoft.AspNetCore.OpenApi package referenc…
https-richardy Mar 28, 2026
f4b2590
feat: configure ocelot for api gateway functionality in Program.cs
https-richardy Mar 28, 2026
ce769ce
feat: this commit introduces ocelot configuration for identity authen…
https-richardy Mar 28, 2026
358437c
feat: this commit introduces ocelot.provider.polly global using for r…
https-richardy Mar 28, 2026
2b5577c
feat: this commit introduces Ocelot.Provider.Polly package reference …
https-richardy Mar 28, 2026
4c63b85
feat: update ocelot configuration to include global settings and rate…
https-richardy Mar 28, 2026
72d050d
feat: enhance ocelot service registration with Polly for resilience f…
https-richardy Mar 28, 2026
0c2ebe1
feat: update ocelot configuration with fixed downstream scheme and ho…
https-richardy Mar 28, 2026
fbd75f9
feat: remove unused applications directory
https-richardy Mar 28, 2026
8046f07
feat: this commit introduces .env.example configuration for downstrea…
https-richardy Mar 28, 2026
b995e0f
feat: this commit introduces dockerfile and .dockerignore for proxy a…
https-richardy Mar 28, 2026
fd2509e
feat: update Dockerfile and .dockerignore for simplified project stru…
https-richardy Mar 28, 2026
8b785bc
feat: update ocelot configuration to use HTTP scheme and change downs…
https-richardy Mar 28, 2026
08324ad
feat: update .env.example to reflect new routing configuration for pr…
https-richardy Mar 28, 2026
6082cb3
feat: expand ocelot configuration with additional routes and rate lim…
https-richardy Mar 28, 2026
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
Empty file removed Applications/.gitkeep
Empty file.
23 changes: 23 additions & 0 deletions Applications/Proxy/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**/.vs
**/.git

**/bin
**/obj
**/.vscode
**/TestResults

**/appsettings.Development.json

.env
.env.*
.env.example

*.user
*.suo
*.userosscache
*.sln.docstates
.gitattributes

Dockerfile
README.md
LICENSE
3 changes: 3 additions & 0 deletions Applications/Proxy/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Routes__0__DownstreamScheme=http
Routes__0__DownstreamHostAndPorts__0__Host=localhost
Routes__0__DownstreamHostAndPorts__0__Port=5286
42 changes: 42 additions & 0 deletions Applications/Proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# use ASP.NET Core 9.0 runtime image (alpine) as base
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base
WORKDIR /artifacts
EXPOSE 8080

# use SDK image (Alpine) for build
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
WORKDIR /workdir

ARG BUILD_CONFIGURATION=Release
ARG SOLUTION=HttpsRichardy.Federation.Proxy

# copy only csproj and sln to restore as early as possible
COPY ["Source/${SOLUTION}.csproj", "Source/"]
COPY ["${SOLUTION}.sln", "./"]

# restore dependencies
RUN dotnet restore "Source/${SOLUTION}.csproj"

# copy the rest of the source code
COPY Source/ ./Source/

WORKDIR "/workdir/Source"

# build in Release mode
RUN dotnet build "${SOLUTION}.csproj" -c $BUILD_CONFIGURATION -o /artifacts/build

# publish the project for production
RUN dotnet publish "${SOLUTION}.csproj" -c $BUILD_CONFIGURATION -o /artifacts/publish /p:UseAppHost=false

# final image to run the app
FROM base AS final
WORKDIR /artifacts

ENV ASPNETCORE_URLS=http://+:8080
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
ENV DOTNET_RUNNING_IN_CONTAINER=true

# copy published files from the build stage
COPY --from=build /artifacts/publish .

ENTRYPOINT ["dotnet", "HttpsRichardy.Federation.Proxy.dll"]
39 changes: 39 additions & 0 deletions Applications/Proxy/HttpsRichardy.Federation.Proxy.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{B8EFCA5F-814F-285C-A8CB-F00F14650265}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpsRichardy.Federation.Proxy", "Source\HttpsRichardy.Federation.Proxy.csproj", "{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Debug|x64.ActiveCfg = Debug|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Debug|x64.Build.0 = Debug|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Debug|x86.ActiveCfg = Debug|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Debug|x86.Build.0 = Debug|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Release|Any CPU.Build.0 = Release|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Release|x64.ActiveCfg = Release|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Release|x64.Build.0 = Release|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Release|x86.ActiveCfg = Release|Any CPU
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5D5AAD1B-A3F6-46D9-B7A3-A4627DED1E64} = {B8EFCA5F-814F-285C-A8CB-F00F14650265}
EndGlobalSection
EndGlobal
14 changes: 14 additions & 0 deletions Applications/Proxy/Source/HttpsRichardy.Federation.Proxy.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<PackageReference Include="Ocelot" Version="24.1.0" />
<PackageReference Include="Ocelot.Provider.Polly" Version="24.1.0" />
</ItemGroup>

</Project>
23 changes: 23 additions & 0 deletions Applications/Proxy/Source/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace HttpsRichardy.Federation.Proxy;

internal static class Program
{
private static async Task Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);

builder.Configuration.AddJsonFile("ocelot.json", optional: false, reloadOnChange: true);
builder.Configuration.AddEnvironmentVariables();

builder.Services
.AddOcelot(builder.Configuration)
.AddPolly();

var app = builder.Build();

app.UseHttpsRedirection();

await app.UseOcelot();
await app.RunAsync();
}
}
23 changes: 23 additions & 0 deletions Applications/Proxy/Source/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5239",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7292;http://localhost:5239",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
3 changes: 3 additions & 0 deletions Applications/Proxy/Source/Usings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global using Ocelot.DependencyInjection;
global using Ocelot.Middleware;
global using Ocelot.Provider.Polly;
9 changes: 9 additions & 0 deletions Applications/Proxy/Source/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Loading
Loading