Skip to content

Commit c616c48

Browse files
authored
Hardening Tests (#51)
* Hardening Tests * Refresh Tests * Service Tests * Endpoint Tests * User Tests * User Tests 2 * Credential Tests * Authorization Tests * Authorization Store Tests * Authentication Store Tests * Session Store Tests * Token Store Tests * Credential Store Tests * User Store Tests * Client Blazor Tests * Regression Fix * Client Blazor Tests 2 * Client Blazor Tests 3
1 parent 997e21c commit c616c48

167 files changed

Lines changed: 29446 additions & 290 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub.EFCore/Components/Layout/MainLayout.razor‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@inherits UAuthHubLayoutComponentBase
1+
@inherits UAuthHubLayoutBase
22
@inject IUAuthClient UAuthClient
33
@inject ISnackbar Snackbar
44
@inject NavigationManager Nav
55

6-
@if (!IsHubAuthorized)
6+
@if (!IsHubActive)
77
{
88
<MudAppBar Class="uauth-blur" Color="Color.Transparent" Dense="true" Elevation="0">
99
<UAuthLogo />

‎samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub.EFCore/Components/Layout/MainLayout.razor.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private void HandleSignInClick()
5252

5353
if (uri.AbsolutePath.EndsWith("/login", StringComparison.OrdinalIgnoreCase))
5454
{
55-
Nav.NavigateTo("/login?focus=1", replace: true, forceLoad: true);
55+
Nav.NavigateTo("/login?uauth_focus=1", replace: true, forceLoad: true);
5656
return;
5757
}
5858

‎samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub.EFCore/Components/Pages/Home.razor.cs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using CodeBeam.UltimateAuth.Client.Blazor;
33
using CodeBeam.UltimateAuth.Client.Runtime;
44
using CodeBeam.UltimateAuth.Core.Contracts;
5+
using CodeBeam.UltimateAuth.Core.Defaults;
56
using CodeBeam.UltimateAuth.Core.Domain;
67
using CodeBeam.UltimateAuth.Server.Stores;
78
using MudBlazor;
@@ -56,7 +57,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
5657

5758
if (HubSessionId.TryParse(HubKey, out var hubSessionId))
5859
{
59-
await ReloadState();
60+
await ReloadStateAsync();
6061
}
6162

6263
await _loginForm.ReloadAsync();
@@ -143,10 +144,10 @@ private async Task<string> ResolveReturnUrlAsync()
143144
var uri = Nav.ToAbsoluteUri(Nav.Uri);
144145
var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query);
145146

146-
if (query.TryGetValue("return_url", out var ru) && !string.IsNullOrWhiteSpace(ru))
147+
if (query.TryGetValue(UAuthConstants.Query.ReturnUrl, out var ru) && !string.IsNullOrWhiteSpace(ru))
147148
return ru!;
148149

149-
if (query.TryGetValue("hub", out var hubKey) && !string.IsNullOrWhiteSpace(hubKey))
150+
if (query.TryGetValue(UAuthConstants.Query.Hub, out var hubKey) && !string.IsNullOrWhiteSpace(hubKey))
150151
{
151152
var artifact = await AuthStore.GetAsync(new AuthArtifactKey(hubKey!));
152153
if (artifact is HubFlowArtifact flow && !string.IsNullOrWhiteSpace(flow.ReturnUrl))

‎samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Components/Layout/MainLayout.razor‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@inherits UAuthHubLayoutComponentBase
1+
@inherits UAuthHubLayoutBase
22
@inject IUAuthClient UAuthClient
33
@inject ISnackbar Snackbar
44
@inject NavigationManager Nav
55

6-
@if (!IsHubAuthorized)
6+
@if (!IsHubActive)
77
{
88
<MudAppBar Class="uauth-blur" Color="Color.Transparent" Dense="true" Elevation="0">
99
<UAuthLogo />

‎samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Components/Layout/MainLayout.razor.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private void HandleSignInClick()
5252

5353
if (uri.AbsolutePath.EndsWith("/login", StringComparison.OrdinalIgnoreCase))
5454
{
55-
Nav.NavigateTo("/login?focus=1", replace: true, forceLoad: true);
55+
Nav.NavigateTo("/login?uauth_focus=1", replace: true, forceLoad: true);
5656
return;
5757
}
5858

‎samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Components/Pages/Home.razor.cs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using CodeBeam.UltimateAuth.Client.Blazor;
33
using CodeBeam.UltimateAuth.Client.Runtime;
44
using CodeBeam.UltimateAuth.Core.Contracts;
5+
using CodeBeam.UltimateAuth.Core.Defaults;
56
using CodeBeam.UltimateAuth.Core.Domain;
67
using CodeBeam.UltimateAuth.Server.Stores;
78
using MudBlazor;
@@ -56,7 +57,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
5657

5758
if (HubSessionId.TryParse(HubKey, out var hubSessionId))
5859
{
59-
await ReloadState();
60+
await ReloadStateAsync();
6061
}
6162

6263
await _loginForm.ReloadAsync();
@@ -143,10 +144,10 @@ private async Task<string> ResolveReturnUrlAsync()
143144
var uri = Nav.ToAbsoluteUri(Nav.Uri);
144145
var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query);
145146

146-
if (query.TryGetValue("return_url", out var ru) && !string.IsNullOrWhiteSpace(ru))
147+
if (query.TryGetValue(UAuthConstants.Query.ReturnUrl, out var ru) && !string.IsNullOrWhiteSpace(ru))
147148
return ru!;
148149

149-
if (query.TryGetValue("hub", out var hubKey) && !string.IsNullOrWhiteSpace(hubKey))
150+
if (query.TryGetValue(UAuthConstants.Query.Hub, out var hubKey) && !string.IsNullOrWhiteSpace(hubKey))
150151
{
151152
var artifact = await AuthStore.GetAsync(new AuthArtifactKey(hubKey!));
152153
if (artifact is HubFlowArtifact flow && !string.IsNullOrWhiteSpace(flow.ReturnUrl))

‎samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Pages/AuthorizedTestPage.razor‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/authorized-test"
22
@attribute [UAuthAuthorize]
3-
@inherits UAuthFlowPageBase
3+
@inherits UAuthPageBase
44

55
<MudPage Class="d-flex align-center justify-center" FullScreen="FullScreen.FullWithoutAppbar" Column="1" Row="1">
66
<MudPaper Class="pa-8" Style="max-width: 520px; width: 100%;" Elevation="0" Outlined="true">

‎samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Pages/Home.razor‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/home"
22
@attribute [UAuthAuthorize]
3-
@inherits UAuthFlowPageBase
3+
@inherits UAuthPageBase
44

55
@inject IUAuthClient UAuthClient
66
@inject UAuthClientDiagnostics Diagnostics

‎samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Pages/Home.razor.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore.Components.Pages;
1414

15-
public partial class Home : UAuthFlowPageBase
15+
public partial class Home : UAuthPageBase
1616
{
1717
private string _selectedAuthState = "UAuthState";
1818
private ClaimsPrincipal? _aspNetCoreState;

‎samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Pages/Login.razor‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/login"
22
@attribute [UAuthLoginPage]
3-
@inherits UAuthFlowPageBase
3+
@inherits UAuthPageBase
44

55
@implements IDisposable
66
@inject IUAuthClient UAuthClient

0 commit comments

Comments
 (0)