Hellmade.HubAuth.ServiceClients 0.5.0
Hellmade.HubAuth.ServiceClients
Typed HTTP clients for Hub coarse authorization and directory/profile integration.
Includes
IPermissionCheckClientIDirectoryClientAddHubAuthServiceClients(...)DI wiring
Behavior
- Calls Hub endpoints:
GET /api/v1/permissions/checkGET /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:
PositionAccountUrl
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:
HubApiBaseUrlServiceSharedSecret(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 |
.NET 10.0
- Hellmade.HubAuth.Contracts (>= 0.5.0)
- Microsoft.Extensions.Caching.Memory (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)