Skip to content

Auth-provider SPI — plugin-load privilege #31

Closed

Description

@thomas-stegemann

Dependencies


Auth providers need slightly broader access than protocol plugins (they touch IApplicationBuilder, not just IBowireProtocol). Either extend BowirePluginLoadContext with an IsAuthProvider capability flag, or load auth assemblies through a separate load-context. Deferred until the first concrete provider (OIDC plugin) surfaces a real privilege need.

Tracked in ROADMAP.md — the narrative there carries the full design rationale + the per-bullet checkboxes. This issue exists for board-level Status / Area / Track / Milestone tracking.

Activity

  1. added this to the milestone on Jun 1, 2026
  2. moved this to Next up in Bowireon Jun 1, 2026
  3. modified the milestones: , v1.8 on Jun 3, 2026
  4. moved this from Next up to Done in Bowireon Jun 4, 2026
  5. thomas-stegemann commented on Jun 4, 2026

    @thomas-stegemann
    MemberAuthor

    Audit + minimal extension.

    The hypothesis was: auth plugins need broader load-context privilege than protocol plugins. Code review showed:

    • BowirePluginLoadContext.DefaultSharedPrefixes already includes Microsoft.* (line 56), so an auth plugin loaded as a sibling sees the host's real Microsoft.AspNetCore.* -- no type-identity wedge, no sandbox.
    • Auth plugins already get full IServiceCollection access via IBowireAuthProvider.AddAuthentication. They can register schemes, options, and DI services without restriction.
    • The real gap was: no hook for providers that need to insert middleware into the host pipeline (callback URLs outside the Bowire endpoint group, claims-transformation, redirect-on-401).

    Fix shipped in c3bfbb5:

    • IBowireAuthProvider.Configure(IApplicationBuilder) -- default no-op on the interface. Source-compatible for existing OIDC plugin + future SAML / API-key providers.
    • UseBowireAuth() extension method on IApplicationBuilder -- resolves the active provider and calls Configure(app). Safe to call unconditionally.
    • BrowserUiHost wires app.UseBowireAuth() between UseAuthorization() and MapBowire(). Embedded hosts add the call themselves between their own middleware wiring.

    XMLdoc on the new method explicitly notes the privilege boundary: the IApplicationBuilder is the real host pipeline, not a sandbox -- treat it like any other middleware-registration point. Embedded hosts that want a tighter boundary can wrap the auth plugin in a separate load context before AddBowireAuth.

    #32 (OIDC required-claim) and #28 (SCIM Phase B) now have the IApplicationBuilder seam they need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions