Skip to content

feat(product): Support SemiHybrid Auth Mode - #185

Merged
mckaragoz merged 14 commits into
CodeBeamOrg:devfrom
mckaragoz:SemiHybridModeSupport
Dec 3, 2026
Merged

mckaragoz merged 14 commits into
CodeBeamOrg:devfrom
mckaragoz:SemiHybridModeSupport

Conversation

@mckaragoz

@mckaragoz mckaragoz commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR introduces SemiHybrid authentication, completing UltimateAuth's four-mode authentication architecture.

SemiHybrid combines local JWT validation with server-managed session lineage, allowing applications to balance performance and centralized security without changing their application-level authentication code.

What's Changed

SemiHybrid Authentication

  • Implemented SemiHybrid across authentication flows, client integration, UAuthHub, and Resource API.
  • Introduced two validation levels:
    • Standard — Local JWT validation without authoritative session validation.
    • HubValidated — JWT validation combined with authoritative session lineage validation.
  • Added configurable endpoint-level validation requirements and framework-enforced security minimums.
  • Introduced RequireUAuthHubValidation() and [UAuthHubValidated] for protected resources.
  • Added remote authoritative validation support for Resource APIs.

Session and Token Lifecycle

  • Introduced metadata-only session identifiers, separating session lineage from bearer authentication credentials.
  • Implemented SemiHybrid refresh-token rotation and logout.
  • Unified JWT-based logout handling for PureJwt and SemiHybrid.
  • Strengthened tenant, user, device, and session lineage binding checks.
  • Enforced a single active session per session chain.
  • Consolidated credential lifetime configuration under UAuthTokenOptions.
  • Deprecated legacy token issuance flags and session lifetime configuration.

Security and Configuration

  • Aligned device mismatch handling across authentication modes.
  • Added validation requirement resolution and configuration validation.
  • Prevented mandatory authoritative validation requirements from being downgraded.
  • Updated effective mode configuration handling.

Tests and Documentation

  • Extended unit test coverage for authentication, validation requirements, session lineage, token rotation, and logout.
  • Refactored the Authentication Modes documentation.
  • Updated configuration, request lifecycle, runtime architecture, security, and authentication flow documentation.
  • Updated migration guidance and removed outdated authentication mode limitations.

Authentication Architecture

UltimateAuth now supports all four authentication modes:

Mode Philosophy
PureOpaque Minimalist authentication
Hybrid General-purpose authentication
SemiHybrid Performance and security tuning
PureJwt Session-independent JWT authentication

All four modes share the same unified APIs, authentication flows, and client abstractions.

Applications can evolve their authentication strategy through configuration without rewriting their shared UltimateAuth integration. Existing credentials may require retirement and reauthentication when switching modes.

One API. Four authentication strategies.

@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.80068% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.68%. Comparing base (4478b51) to head (dd1a8cf).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
...timateAuth.Server/Flows/Login/LoginOrchestrator.cs 66.66% 5 Missing and 4 partials ⚠️
...erver/Infrastructure/Issuers/UAuthSessionIssuer.cs 91.37% 3 Missing and 2 partials ⚠️
....Server/Authentication/UAuthJwtPrincipalFactory.cs 82.60% 2 Missing and 2 partials ⚠️
...uth.Server/Infrastructure/Token/JwtPayloadGuard.cs 20.00% 2 Missing and 2 partials ⚠️
...ons/Validators/UAuthResourceApiOptionsValidator.cs 66.66% 2 Missing and 2 partials ⚠️
....Core/Infrastructure/UAuthRefreshTokenValidator.cs 40.00% 1 Missing and 2 partials ⚠️
...Extensions/UAuthHubValidationEndpointExtensions.cs 0.00% 3 Missing ⚠️
...s/Validators/UAuthServerSessionOptionsValidator.cs 62.50% 0 Missing and 3 partials ⚠️
...h.Server/ResourceApi/RemoteHubValidationService.cs 96.38% 1 Missing and 2 partials ⚠️
...m.UltimateAuth.Core/Domain/Session/UAuthSession.cs 88.23% 1 Missing and 1 partial ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #185      +/-   ##
==========================================
+ Coverage   88.63%   88.68%   +0.04%     
==========================================
  Files         611      621      +10     
  Lines       21548    21970     +422     
  Branches     2597     2673      +76     
==========================================
+ Hits        19099    19484     +385     
- Misses       1539     1556      +17     
- Partials      910      930      +20     
Flag Coverage Δ
framework 88.68% <90.80%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mckaragoz
mckaragoz merged commit 78b4e35 into CodeBeamOrg:dev Dec 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant