Skip to content

Commit c30cdef

Browse files
committed
Push Before Going Complex
1 parent 7623ce3 commit c30cdef

File tree

97 files changed

+1657
-1349
lines changed

Some content is hidden

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

97 files changed

+1657
-1349
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@using CodeBeam.UltimateAuth.Server.Abstractions
88
@using CodeBeam.UltimateAuth.Server.Cookies
99
@using CodeBeam.UltimateAuth.Server.Infrastructure
10+
@using CodeBeam.UltimateAuth.Server.Services
1011
@inject IUAuthFlowService<UserId> Flow
1112
@inject ISnackbar Snackbar
1213
@inject ISessionQueryService<UserId> SessionQuery

src/CodeBeam.UltimateAuth.Client/Components/UALoginForm.razor

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
@* TODO: Optional double-submit prevention for native form submit *@
22
@namespace CodeBeam.UltimateAuth.Client
33
@using CodeBeam.UltimateAuth.Client.Options
4+
@using CodeBeam.UltimateAuth.Core.Options
45
@using Microsoft.Extensions.Options
56
@inject IJSRuntime JS
7+
@inject IOptions<UAuthOptions> CoreOptions
68
@inject IOptions<UAuthClientOptions> Options
79
@inject NavigationManager Navigation
810

911
<form @ref="_form" method="post" action="@ResolvedEndpoint">
1012
<input type="hidden" name="Identifier" value="@Identifier" />
1113
<input type="hidden" name="Secret" value="@Secret" autocomplete="off" />
14+
<input type="hidden" name="__uauth_client_profile" value="@ClientProfileValue" />
1215

1316
@ChildContent
1417

src/CodeBeam.UltimateAuth.Client/Components/UALoginForm.razor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using CodeBeam.UltimateAuth.Client.Infrastructure;
2+
using CodeBeam.UltimateAuth.Core.Options;
23
using Microsoft.AspNetCore.Components;
34
using Microsoft.JSInterop;
45

@@ -34,7 +35,7 @@ public async Task SubmitAsync()
3435
await JS.InvokeVoidAsync("uauth.submitForm", _form);
3536
}
3637

37-
//private string ResolvedEndpoint => string.IsNullOrWhiteSpace(Endpoint) ? UAuthUrlBuilder.Combine(Options.Value.Endpoints.Authority, "/auth/login") : UAuthUrlBuilder.Combine(Options.Value.Endpoints.Authority, Endpoint);
38+
private string ClientProfileValue => CoreOptions.Value.ClientProfile.ToString();
3839

3940
private string ResolvedEndpoint
4041
{

src/CodeBeam.UltimateAuth.Core/Abstractions/Infrastructure/IRefreshTokenResolver.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/CodeBeam.UltimateAuth.Core/Abstractions/Services/IUAuthService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
/// </summary>
88
public interface IUAuthService<TUserId>
99
{
10-
IUAuthFlowService<TUserId> Flow { get; }
10+
//IUAuthFlowService<TUserId> Flow { get; }
1111
IUAuthSessionService<TUserId> Sessions { get; }
12-
IUAuthTokenService<TUserId> Tokens { get; }
12+
//IUAuthTokenService<TUserId> Tokens { get; }
1313
IUAuthUserService<TUserId> Users { get; }
1414
}
1515
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace CodeBeam.UltimateAuth.Core.Abstractions
2+
{
3+
/// <summary>
4+
/// Optional persistence for access token identifiers (jti).
5+
/// Used for revocation and replay protection.
6+
/// </summary>
7+
public interface IAccessTokenIdStore
8+
{
9+
Task StoreAsync(
10+
string? tenantId,
11+
string jti,
12+
DateTimeOffset expiresAt,
13+
CancellationToken ct = default);
14+
15+
Task<bool> IsRevokedAsync(
16+
string? tenantId,
17+
string jti,
18+
CancellationToken ct = default);
19+
20+
Task RevokeAsync(
21+
string? tenantId,
22+
string jti,
23+
DateTimeOffset revokedAt,
24+
CancellationToken ct = default);
25+
}
26+
}

src/CodeBeam.UltimateAuth.Core/Abstractions/Stores/IOpaqueTokenStore.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using CodeBeam.UltimateAuth.Core.Domain;
2+
3+
namespace CodeBeam.UltimateAuth.Core.Abstractions;
4+
5+
/// <summary>
6+
/// Low-level persistence abstraction for refresh tokens.
7+
/// NO validation logic. NO business rules.
8+
/// </summary>
9+
public interface IRefreshTokenStore<TUserId>
10+
{
11+
Task StoreAsync(string? tenantId,
12+
StoredRefreshToken<TUserId> token,
13+
CancellationToken ct = default);
14+
15+
Task<StoredRefreshToken<TUserId>?> FindByHashAsync(string? tenantId,
16+
string tokenHash,
17+
CancellationToken ct = default);
18+
19+
Task RevokeAsync(string? tenantId,
20+
string tokenHash,
21+
DateTimeOffset revokedAt,
22+
CancellationToken ct = default);
23+
24+
Task RevokeBySessionAsync(string? tenantId,
25+
AuthSessionId sessionId,
26+
DateTimeOffset revokedAt,
27+
CancellationToken ct = default);
28+
29+
Task RevokeByChainAsync(string? tenantId,
30+
ChainId chainId,
31+
DateTimeOffset revokedAt,
32+
CancellationToken ct = default);
33+
34+
Task RevokeAllForUserAsync(string? tenantId,
35+
TUserId userId,
36+
DateTimeOffset revokedAt,
37+
CancellationToken ct = default);
38+
}

src/CodeBeam.UltimateAuth.Core/Abstractions/Stores/ITokenStore.cs

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/CodeBeam.UltimateAuth.Core/Abstractions/Stores/ITokenStoreFactory.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)