Skip to content

Release v2.4.0

Choose a tag to compare

@github-actions github-actions released this 01 Jun 06:09
e4fce94

Adds a dedicated Aspire hosting integration library so any Aspire AppHost can add and configure AuthProxy with a fluent, idiomatic API — either as a container resource (external consumers) or layered on top of a ProjectResource (in-repo development).

Added

  • Source/Aspire class library (Aspire.Hosting 9.5.2) with AuthProxyResource : ContainerResource pointing at cratis/authproxy and a full set of fluent extension methods on IResourceBuilder<T> where T : IResourceWithEnvironment — works on both container and project resources

    // Container-based (external consumers)
    builder.AddAuthProxy("authproxy", tag: "1.2.3")
        .WithHttpEndpoint(port: 8080)
        .WithBackend("main", apiResource)
        .WithFrontend("main", webResource)
        .WithOidcProvider("Microsoft", OidcProviderType.Microsoft, authority, clientId, secret)
        .WithHostTenantResolution()
        .WithTenantVerification(platformApi, "/api/tenants/{tenantId}")
        .WithSelectionTenantResolution(platformApi, "/api/tenants/selectable")
        .WithInvite(publicKeyPem, studioApi, "/internal/invites/exchange", issuer: "https://studio.example.com")
        .WithInviteClaimForwarding("organization_id", toClaimType: "organization")
        .WithLobbyFrontend(lobbyResource);
    
    // Project-based (in-repo dev — same extension methods apply)
    builder.AddProject("authproxy")
        .WithBackend("main", testApp)
        .WithFrontend("main", web);

    Available methods: AddAuthProxy, WithBackend, WithFrontend, WithOidcProvider, WithOAuthProvider, WithHostTenantResolution, WithSubHostTenantResolution, WithClaimTenantResolution, WithRouteTenantResolution, WithSpecifiedTenantResolution, WithDefaultTenantResolution, WithSelectionTenantResolution, WithTenantVerification, WithInvite, WithInviteClaimForwarding, WithLobbyFrontend, WithLobbyBackend

  • OidcProviderType enum (Custom, Microsoft, Google, GitHub, Apple) in the Aspire library — standalone, no dependency on the AuthProxy web project

  • Documentation/aspire/index.md — how-to guide covering container vs project resource setup, all With* extension methods, the OidcProviderType enum, tenant selection, invites & lobby, identity details resolution, resource-based endpoint references, and cross-links to the existing configuration reference

  • publish-nuget job in .github/workflows/publish.yml using OIDC trusted publishing (NuGet/login@v1) — packs and pushes only Source/Aspire/Aspire.csproj as Cratis.AuthProxy.Aspire to NuGet.org; runs independently of the Docker pipeline

Changed

  • Composition/AppHost.cs updated to use WithBackend / WithFrontend instead of bare WithReference, and now wires up the frontend (web) service as well

  • Source/Aspire/Aspire.csproj updated with full NuGet package metadata (PackageId, Title, Description, Authors, PackageLicenseExpression, RepositoryUrl, PackageTags, IsPackable)

  • WithSelectionTenantResolution updated to accept an optional tenantsEndpoint parameter that maps to TenantResolutions[n].Options.TenantsEndpoint, and a new resource-based overload that accepts an IResourceBuilder<IResourceWithEndpoints> + route so Aspire resolves the base URL automatically

  • WithTenantVerification gains a resource-based overload — pass an Aspire service resource and a route template instead of a full URL

  • WithInvite gains a resource-based overload — pass the exchange service resource and route instead of a hardcoded exchange URL

  • WithBackend gains an optional resolveIdentityDetails parameter (bool?) that maps to Services[name].ResolveIdentityDetails, controlling whether AuthProxy calls /.cratis/me on that service's backend to enrich the identity cookie