Hellmade.HubAuth.ServiceClients 0.3.1

Hellmade.HubAuth.ServiceClients

Typed HTTP clients for Hub central auth integration.

Includes

  • IPermissionCheckClient
  • IDirectoryClient
  • AddHubAuthServiceClients(...) DI wiring

Behavior

  • Calls Hub endpoints:
    • GET /api/v1/permissions/check
    • GET /api/v1/directory/users/{userId}
    • POST /api/v1/directory/users/batch
  • Uses short-lived in-memory caching for resilience.
  • Uses structured warning logs when falling back to cached values.
  • Uses stable cache keys for directory batch lookups (order-independent user id sets).

Directory payload additions

Directory responses now expose two additional nullable fields on DirectoryUserProfileResponse:

  • Position
  • AccountUrl

AccountUrl is the full absolute Hub profile link for the exact user (for example https://hub.hellmadegames.com/users/{userId}), so downstream services should use it directly for "Hub Account" links and not build URL templates.

Example usage:

var profile = await directoryClient.GetUserAsync("my-service", userId, bearerToken, cancellationToken);
var hubAccountLink = profile?.AccountUrl;
var profileSubtitle = string.IsNullOrWhiteSpace(profile?.Position)
	? profile?.Email
	: profile.Position;

Configuration

AddHubAuthServiceClients accepts HubAuthServiceClientOptions:

  • HubApiBaseUrl
  • ServiceSharedSecret (optional service-to-service fallback for directory endpoints when no user bearer token is available)
  • PermissionCacheSeconds (default: 120)
  • DirectoryCacheSeconds (default: 600)
  • MaxBatchSize (default: 200)
  • FailOpenWithCachedValue (default: true)

When ServiceSharedSecret is configured and bearerToken is null, the directory client sends:

  • X-Service-Key: <serviceKey>
  • X-Service-Secret: <ServiceSharedSecret>

This enables service-authenticated directory lookups for anonymous/public service routes without requiring an end-user access token.

Scope

  • Coarse service access checks and Hub directory lookups only.
  • No service-local role models or business policy logic.

Showing the top 20 packages that depend on Hellmade.HubAuth.ServiceClients.

Packages Downloads
Hellmade.HubAuth.AspNetCore
ASP.NET Core helpers for integrating services with Hub OIDC central auth.
2
Hellmade.HubAuth.AspNetCore
ASP.NET Core helpers for integrating services with OIDC identity providers such as Zitadel plus Hub coarse authorization.
1
Hellmade.HubAuth.AspNetCore
ASP.NET Core helpers for integrating services with OIDC identity providers such as Zitadel plus Hub coarse authorization.
0

Version Downloads Last updated
0.5.1 11 05/11/2026
0.5.0 2 05/11/2026
0.4.0 0 05/11/2026
0.3.1 6 04/21/2026
0.3.0 3 04/20/2026
0.2.0 2 04/20/2026
0.1.0 4 04/15/2026