-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance authentication and security tests for multi-tenant scenarios #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
530100f
Enhance authentication and security tests for multi-tenant scenarios
aalmada bad734e
refactor: Update comment formatting in ResendVerification_RespectsCoo…
aalmada 21a0ddf
refactor: Enhance AddPasskeyToUserAsync to update security stamp for …
aalmada cd7ab75
chore: Add VSCode configuration files for extensions and launch settings
aalmada fa4c277
refactor: Update DatabaseHelpers and test files to ensure proper disp…
aalmada c6cdcbb
refactor: Simplify User_RegisteredInSourceTenant_CanLoginInSourceTena…
aalmada ab116a1
refactor: Enhance rate limiting configuration to support disabling fo…
aalmada be7bd8c
refactor: Update multi-tenancy handling and improve error responses i…
aalmada 666745b
refactor: Update favorite book tests to wait for projection completion
aalmada f1e31b8
refactor: Enhance JWT security stamp validation and update related tests
aalmada 992133e
refactor: Implement security stamp validation for refresh tokens and …
aalmada 2380645
Refactor tests to improve tenant isolation and security checks
aalmada 8308d5d
refactor: Update security stamp handling in password management and a…
aalmada 368fa98
Refactor JWT authentication events and enhance error handling
aalmada 62ab4ea
refactor: Add missing package references for SkiaSharp and WolverineFx
aalmada 04f0ee2
fix(test): forge JWT without tenant_id claim in Request_WithNoTenantI…
aalmada 2bc09c9
fix(test): verify original account survives re-registration in Regist…
aalmada 592912a
fix(test): assert both pruned tokens are invalid in RefreshToken_Keep…
aalmada d5796ec
fix(test): use real WebAuthn endpoint in Token_AfterAddingPasskey_Bec…
aalmada c4739e6
fix(test): create valid book with dependencies in Admin_CanCreateBook…
aalmada 32e8ef4
fix(test): use WebAuthn to test passkey-only user endpoints (fixes 2 …
aalmada 31ecc63
fix(test): resolve two runtime test failures
aalmada 2b2c271
fix(test): update ETag handling in various tests and improve version …
aalmada c5fbfab
Refactor tests to use version 7 GUIDs for consistency
aalmada 67a8acc
fix(tests): refactor test code to improve readability and maintainabi…
aalmada 93fb63f
fix(tests): update comment for clarity on Admin API GetAuthor behavior
aalmada File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "recommendations": [ | ||
| "microsoft-aspire.aspire-vscode", | ||
| "ms-dotnettools.csdevkit", | ||
| "ms-azuretools.vscode-containers", | ||
| "editorconfig.editorconfig", | ||
| "bits.csharp-test-filter" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Debug TUnit Test", | ||
| "type": "coreclr", | ||
| "request": "launch", | ||
| "preLaunchTask": "build", | ||
| "program": "${input:dllPath}", | ||
| "args": [ | ||
| "--treenode-filter", | ||
| "${input:testFilter}" | ||
| ], | ||
| "cwd": "${workspaceFolder}", | ||
| "console": "integratedTerminal", | ||
| "stopAtEntry": false | ||
| } | ||
| ], | ||
| "inputs": [ | ||
| { | ||
| "id": "dllPath", | ||
| "type": "command", | ||
| "command": "csharp-test-filter.getDllPath" | ||
| }, | ||
| { | ||
| "id": "testFilter", | ||
| "type": "command", | ||
| "command": "csharp-test-filter.getFilter" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,52 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
|
||
| <PropertyGroup> | ||
| <!-- Garbage Collection Optimization for Server Workloads --> | ||
| <!-- Server GC: Uses multiple heaps and threads for better throughput --> | ||
| <ServerGarbageCollection>true</ServerGarbageCollection> | ||
|
|
||
| <!-- Concurrent GC: Reduces pause times by running GC concurrently with application --> | ||
| <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection> | ||
|
|
||
| <!-- Retain VM: Keeps virtual memory allocated for better performance --> | ||
| <RetainVMGarbageCollection>true</RetainVMGarbageCollection> | ||
|
|
||
| <!-- Dynamic PGO: Profile-guided optimization for hot paths --> | ||
| <TieredCompilation>true</TieredCompilation> | ||
| <TieredCompilationQuickJit>true</TieredCompilationQuickJit> | ||
| <NoWarn>$(NoWarn);EXTEXP0018</NoWarn> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\BookStore.ServiceDefaults\BookStore.ServiceDefaults.csproj" /> | ||
| <ProjectReference Include="..\BookStore.ApiService.Analyzers\BookStore.ApiService.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" /> | ||
| <ProjectReference Include="..\BookStore.Shared\BookStore.Shared.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Asp.Versioning.Http" /> | ||
| <PackageReference Include="AspNetCore.HealthChecks.NpgSql" /> | ||
| <PackageReference Include="Aspire.Azure.Storage.Blobs" /> | ||
| <PackageReference Include="Aspire.StackExchange.Redis.DistributedCaching" /> | ||
| <PackageReference Include="Bogus" /> | ||
| <PackageReference Include="JasperFx.Core" /> | ||
| <PackageReference Include="Marten" /> | ||
| <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" /> | ||
| <PackageReference Include="Microsoft.AspNetCore.OpenApi" /> | ||
| <PackageReference Include="Microsoft.Extensions.Caching.Hybrid" /> | ||
| <PackageReference Include="Scalar.AspNetCore" /> | ||
| <PackageReference Include="SkiaSharp" /> | ||
| <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" /> | ||
| <PackageReference Include="SkiaSharp.NativeAssets.macOS" /> | ||
| <PackageReference Include="WolverineFx.Http" /> | ||
| <PackageReference Include="WolverineFx.Marten" /> | ||
| <PackageReference Include="MailKit" /> | ||
| <PackageReference Include="MimeKit" /> | ||
| <PackageReference Include="System.IdentityModel.Tokens.Jwt" /> | ||
| <PackageReference Include="Microsoft.IdentityModel.Tokens" /> | ||
| <PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
|
||
| <PropertyGroup> | ||
| <!-- Garbage Collection Optimization for Server Workloads --> | ||
| <!-- Server GC: Uses multiple heaps and threads for better throughput --> | ||
| <ServerGarbageCollection>true</ServerGarbageCollection> | ||
|
|
||
| <!-- Concurrent GC: Reduces pause times by running GC concurrently with application --> | ||
| <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection> | ||
|
|
||
| <!-- Retain VM: Keeps virtual memory allocated for better performance --> | ||
| <RetainVMGarbageCollection>true</RetainVMGarbageCollection> | ||
|
|
||
| <!-- Dynamic PGO: Profile-guided optimization for hot paths --> | ||
| <TieredCompilation>true</TieredCompilation> | ||
| <TieredCompilationQuickJit>true</TieredCompilationQuickJit> | ||
| <NoWarn>$(NoWarn);EXTEXP0018</NoWarn> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\BookStore.ServiceDefaults\BookStore.ServiceDefaults.csproj" /> | ||
| <ProjectReference Include="..\BookStore.ApiService.Analyzers\BookStore.ApiService.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" /> | ||
| <ProjectReference Include="..\BookStore.Shared\BookStore.Shared.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Npgsql" /> | ||
| <PackageReference Include="Asp.Versioning.Http" /> | ||
| <PackageReference Include="AspNetCore.HealthChecks.NpgSql" /> | ||
| <PackageReference Include="Aspire.Azure.Storage.Blobs" /> | ||
| <PackageReference Include="Aspire.StackExchange.Redis.DistributedCaching" /> | ||
| <PackageReference Include="Bogus" /> | ||
| <PackageReference Include="JasperFx.Core" /> | ||
| <PackageReference Include="Marten" /> | ||
| <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" /> | ||
| <PackageReference Include="Microsoft.AspNetCore.OpenApi" /> | ||
| <PackageReference Include="Microsoft.Extensions.Caching.Hybrid" /> | ||
| <PackageReference Include="Scalar.AspNetCore" /> | ||
| <PackageReference Include="SkiaSharp" /> | ||
| <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" /> | ||
| <PackageReference Include="SkiaSharp.NativeAssets.macOS" /> | ||
| <PackageReference Include="WolverineFx.Http" /> | ||
| <PackageReference Include="WolverineFx.Marten" /> | ||
| <PackageReference Include="MailKit" /> | ||
| <PackageReference Include="MimeKit" /> | ||
| <PackageReference Include="System.IdentityModel.Tokens.Jwt" /> | ||
| <PackageReference Include="Microsoft.IdentityModel.Tokens" /> | ||
| <PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AGENTS.md update suggests using MultiTenancyConstants.* instead of hardcoded values (line 55), but the actual constant name is MultiTenancyConstants.DefaultTenantId, not MultiTenancyConstants.*.
The wildcard notation ".*" is typically used in documentation to mean "any member of", but for a code standard that will be copy-pasted or referenced, it would be clearer to show the actual constant name:
This makes it immediately clear what constant to use rather than requiring developers to look up what members exist.