Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0a3b0dd
feat: first implementation of identity server
jeastham1993 May 27, 2025
701e1a3
fix: allow refresh token flow
jeastham1993 May 27, 2025
a72841c
Update user-management/src/Stickerlandia.UserManagement.Agnostic/Migr…
jeastham1993 May 27, 2025
4b6a9fa
Update user-management/src/Stickerlandia.UserManagement.Agnostic/Migr…
jeastham1993 May 27, 2025
3f0adb8
chore: code quality recommendations
jeastham1993 May 27, 2025
527735e
chore: update test code to use OAuth2.0
jeastham1993 May 27, 2025
1469a83
fix: resolve integration test issues
jeastham1993 May 27, 2025
2652292
chore: various changes from PR feedback
jeastham1993 May 28, 2025
d764746
chore: restructure codebase and fix integration tests
jeastham1993 May 28, 2025
decfd1c
chore: add paths to GH triggers
jeastham1993 May 28, 2025
0fc3279
chore: install dotnet dev certs
jeastham1993 May 28, 2025
5b10693
chore: add retries to async test run
jeastham1993 May 28, 2025
629e871
chore: remove build step from workflow
jeastham1993 May 28, 2025
a0c2133
fix: function app updates for test run
jeastham1993 May 28, 2025
019143f
fix: update startup mode for az functions
jeastham1993 May 28, 2025
9a3be7a
fix: updates for azure functions in GH actions
jeastham1993 May 28, 2025
2df41fa
fix: resolve GH actions issues
jeastham1993 May 28, 2025
8ebd819
fix: resolve integration test issues
jeastham1993 May 28, 2025
f421ab0
Merge branch 'main' into feat/identity
jeastham1993 May 28, 2025
d1841f2
feat: add configurable SSL for auth server
jeastham1993 May 28, 2025
6c04c19
chore: add .NET 9 SDK to action and re-enable azure functions
jeastham1993 May 28, 2025
dcd0e7b
Merge branch 'main' into feat/identity
jeastham1993 May 28, 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
33 changes: 13 additions & 20 deletions .github/workflows/user-management-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: User Management Tests
on:
push:
branches: ["main"]
paths:
- user-management/**
pull_request:
branches: ["main"]
paths:
- user-management/**
workflow_dispatch:

jobs:
Expand All @@ -27,8 +31,8 @@ jobs:
strategy:
matrix:
DRIVING:
- ASPNET
#- AZURE_FUNCTIONS
- AGNOSTIC
#- AZURE
fail-fast: false

services:
Expand All @@ -42,13 +46,9 @@ jobs:
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 #4.3.1
with:
dotnet-version: "8.0.x"
- name: Export Cosmos DB Emulator Certificate
- name: Install SSL Certificates
run: |
sudo apt update && sudo apt install -y openssl
openssl s_client -connect localhost:8081 </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > cosmos_emulator.cert

sudo cp cosmos_emulator.cert /usr/local/share/ca-certificates/
sudo update-ca-certificates
dotnet dev-certs https --trust
- name: Install Azure Functions Core Tools
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
Expand All @@ -62,17 +62,11 @@ jobs:
run: |
cd user-management
dotnet restore
- name: .NET Build
shell: bash
run: |
cd user-management
dotnet build
- name: Run Integration Tests
shell: bash
env:
DRIVING: ${{ matrix.DRIVING }}
DRIVEN: AZURE
COSMOSDB_CONNECTION_STRING: ${{ secrets.COSMOSDB_LOCAL_CONNECTION_STRING }}
run: |
func --version
cd user-management/tests/Stickerlandia.UserManagement.IntegrationTest && dotnet test --logger:"console;verbosity=detailed"
Expand All @@ -83,14 +77,18 @@ jobs:
strategy:
matrix:
DRIVING:
- ASPNET
- AGNOSTIC
#- AZURE
fail-fast: false

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 #4.3.1
with:
dotnet-version: "8.0.x"
- name: Install SSL Certificates
run: |
dotnet dev-certs https --trust
- name: Install Azure Functions Core Tools
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
Expand All @@ -104,11 +102,6 @@ jobs:
run: |
cd user-management
dotnet restore
- name: .NET Build
shell: bash
run: |
cd user-management
dotnet build
- name: Run Integration Tests
shell: bash
env:
Expand Down
43 changes: 41 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ services:
user-management:
build:
context: ./user-management
dockerfile: src/Stickerlandia.UserManagement.AspNet/Dockerfile
dockerfile: src/Stickerlandia.UserManagement.Api/Dockerfile
container_name: user-management
depends_on:
user-management-db:
Expand All @@ -163,8 +163,9 @@ services:
condition: service_healthy
environment:
ASPNETCORE_ENVIRONMENT: Development
DRIVING: ASPNET
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
DISABLE_SSL: "true"
ConnectionStrings__messaging: "redpanda:9092"
ConnectionStrings__database: "Host=user-management-db;Port=5432;Database=user_management;Username=user_mgmt_user;Password=user_mgmt_password"
KAFKA__BOOTSTRAPSERVERS: "redpanda:9092"
Expand All @@ -175,6 +176,44 @@ services:
- "traefik.http.routers.user-management.rule=PathPrefix(`/api/users`)"
- "traefik.http.services.user-management.loadbalancer.server.port=8080"

user-management-worker:
build:
context: ./user-management
dockerfile: src/Stickerlandia.UserManagement.Worker/Dockerfile
container_name: user-management-worker
depends_on:
user-management-db:
condition: service_healthy
redpanda:
condition: service_healthy
environment:
ASPNETCORE_ENVIRONMENT: Development
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
ConnectionStrings__messaging: "redpanda:9092"
ConnectionStrings__database: "Host=user-management-db;Port=5432;Database=user_management;Username=user_mgmt_user;Password=user_mgmt_password"
KAFKA__BOOTSTRAPSERVERS: "redpanda:9092"
KAFKA__SCHEMAREGISTRY: "http://redpanda:8082"
KAFKA__GROUPID: "stickerlandia-user-management"

user-management-db-migrations:
build:
context: ./user-management
dockerfile: src/Stickerlandia.UserManagement.MigrationService/Dockerfile
container_name: user-management-migrations
depends_on:
user-management-db:
condition: service_healthy
environment:
ASPNETCORE_ENVIRONMENT: Development
DRIVING: AGNOSTIC
DRIVEN: AGNOSTIC
ConnectionStrings__messaging: "redpanda:9092"
ConnectionStrings__database: "Host=user-management-db;Port=5432;Database=user_management;Username=user_mgmt_user;Password=user_mgmt_password"
KAFKA__BOOTSTRAPSERVERS: "redpanda:9092"
KAFKA__SCHEMAREGISTRY: "http://redpanda:8082"
KAFKA__GROUPID: "stickerlandia-user-management"

volumes:
sticker-award-data:
user-management-data:
Expand Down
35 changes: 28 additions & 7 deletions user-management/Stickerlandia.UserManagement.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagemen
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.UnitTest", "tests\Stickerlandia.UserManagement.UnitTest\Stickerlandia.UserManagement.UnitTest.csproj", "{7BD95F13-FE66-43A0-A48A-8D5903E37F7D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.AspNet", "src\Stickerlandia.UserManagement.AspNet\Stickerlandia.UserManagement.AspNet.csproj", "{488873C6-4BFA-4D6E-9364-D672C15EA2D9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.Api", "src\Stickerlandia.UserManagement.Api\Stickerlandia.UserManagement.Api.csproj", "{488873C6-4BFA-4D6E-9364-D672C15EA2D9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.Core", "src\Stickerlandia.UserManagement.Core\Stickerlandia.UserManagement.Core.csproj", "{A93481EC-FDED-4740-902D-B5D911402CBA}"
EndProject
Expand All @@ -33,7 +33,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Driving", "Driving", "{9247
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Driven", "Driven", "{86CA6782-DAF7-4130-9B10-02DE0680DF78}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.SharedSetup", "src\Stickerlandia.UserManagement.SharedSetup\Stickerlandia.UserManagement.SharedSetup.csproj", "{DE058729-25B8-4F03-BA72-0EF1BCF1A275}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.Auth", "src\Stickerlandia.UserManagement.Auth\Stickerlandia.UserManagement.Auth.csproj", "{408EFE63-AA9C-46BD-ADD5-AB917BB4E9E6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.Worker", "src\Stickerlandia.UserManagement.Worker\Stickerlandia.UserManagement.Worker.csproj", "{ED36763B-8971-4CC9-A4FE-16924F1961C0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.ServiceDefaults", "src\Stickerlandia.UserManagement.ServiceDefaults\Stickerlandia.UserManagement.ServiceDefaults.csproj", "{7C28228C-4B3D-4AAE-95E6-4669413BD06C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stickerlandia.UserManagement.MigrationService", "src\Stickerlandia.UserManagement.MigrationService\Stickerlandia.UserManagement.MigrationService.csproj", "{91536DB3-CBA5-44DE-943C-76F8577793FE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -84,10 +90,22 @@ Global
{5C770F92-B6E7-4270-A041-A32F385DA6C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C770F92-B6E7-4270-A041-A32F385DA6C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C770F92-B6E7-4270-A041-A32F385DA6C4}.Release|Any CPU.Build.0 = Release|Any CPU
{DE058729-25B8-4F03-BA72-0EF1BCF1A275}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE058729-25B8-4F03-BA72-0EF1BCF1A275}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE058729-25B8-4F03-BA72-0EF1BCF1A275}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE058729-25B8-4F03-BA72-0EF1BCF1A275}.Release|Any CPU.Build.0 = Release|Any CPU
{408EFE63-AA9C-46BD-ADD5-AB917BB4E9E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{408EFE63-AA9C-46BD-ADD5-AB917BB4E9E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{408EFE63-AA9C-46BD-ADD5-AB917BB4E9E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{408EFE63-AA9C-46BD-ADD5-AB917BB4E9E6}.Release|Any CPU.Build.0 = Release|Any CPU
{ED36763B-8971-4CC9-A4FE-16924F1961C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED36763B-8971-4CC9-A4FE-16924F1961C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED36763B-8971-4CC9-A4FE-16924F1961C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED36763B-8971-4CC9-A4FE-16924F1961C0}.Release|Any CPU.Build.0 = Release|Any CPU
{7C28228C-4B3D-4AAE-95E6-4669413BD06C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C28228C-4B3D-4AAE-95E6-4669413BD06C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C28228C-4B3D-4AAE-95E6-4669413BD06C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C28228C-4B3D-4AAE-95E6-4669413BD06C}.Release|Any CPU.Build.0 = Release|Any CPU
{91536DB3-CBA5-44DE-943C-76F8577793FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91536DB3-CBA5-44DE-943C-76F8577793FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91536DB3-CBA5-44DE-943C-76F8577793FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91536DB3-CBA5-44DE-943C-76F8577793FE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4DDC795B-2EA4-4123-B631-F0D8CAA99BA6} = {FE220876-2B87-4095-8BD2-039049503C72}
Expand All @@ -102,6 +120,9 @@ Global
{295E8315-2CD2-4CD8-B7F4-21EF587B74A9} = {86CA6782-DAF7-4130-9B10-02DE0680DF78}
{9A175F6D-120D-4AF2-B407-B1499B70BE9E} = {86CA6782-DAF7-4130-9B10-02DE0680DF78}
{1F6841EA-97F0-4079-967A-42F816E4FD1F} = {86CA6782-DAF7-4130-9B10-02DE0680DF78}
{DE058729-25B8-4F03-BA72-0EF1BCF1A275} = {924749FC-98D5-40A6-8F4B-BA9BFDEDDEC3}
{408EFE63-AA9C-46BD-ADD5-AB917BB4E9E6} = {FC9DDF76-8DAC-4498-8926-8883F984709C}
{ED36763B-8971-4CC9-A4FE-16924F1961C0} = {924749FC-98D5-40A6-8F4B-BA9BFDEDDEC3}
{7C28228C-4B3D-4AAE-95E6-4669413BD06C} = {924749FC-98D5-40A6-8F4B-BA9BFDEDDEC3}
{91536DB3-CBA5-44DE-943C-76F8577793FE} = {924749FC-98D5-40A6-8F4B-BA9BFDEDDEC3}
EndGlobalSection
EndGlobal
3 changes: 0 additions & 3 deletions user-management/infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ locals {
app_settings = {
"ConnectionStrings__messaging" = azurerm_servicebus_namespace.stickerlandia_users_service_bus.default_primary_connection_string
"ConnectionStrings__database" = "AccountEndpoint=${azurerm_cosmosdb_account.user_management.endpoint};AccountKey=${azurerm_cosmosdb_account.user_management.primary_key};"
"Auth__Issuer"= "https://stickerlandia.com"
"Auth__Audience"= "https://stickerlandia.com"
"Auth__Key"= "This is a super secret key that should not be used in production'"
}

tags = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public static IServiceCollection AddPostgresUserRepository(this IServiceCollecti
});

// Register repositories
services.AddScoped<IUsers, PostgresUserRepository>();
services.AddScoped<IOutbox, PostgresUserRepository>();


return services;
}
Expand Down
Loading