AppSurface Search
API Reference

Auth

Namespaces

Type

IRazorWireAuthResultProvider

Source

Provides passive auth results for RazorWire auth projection helpers.

Remarks

Implementations adapt a host-owned auth system into AppSurfaceAuthResult. They must not sign users in, sign users out, mutate cookies, challenge, forbid, redirect, or create authorization policies. RazorWire uses the returned result only to choose server-rendered UI slots.

Method

AuthorizeAsync

Task<AppSurfaceAuthResult> AuthorizeAsync(RazorWireAuthRequest request, CancellationToken cancellationToken = default) Source

Evaluates or retrieves the auth result for a RazorWire auth projection request.

Parameters

  • requestThe requested host-owned policy/resource pair.
  • cancellationTokenToken observed before or during provider work.

Returns

A passive AppSurface auth result for the requested projection.

Type

RazorWireAuthRequest

Source

Describes the host-owned auth decision RazorWire should project.

Remarks

RazorWire treats this record as projection input only. The provider decides how to evaluate the policy; RazorWire only maps the resulting passive auth result into stable HTML states.

Method

Create

RazorWireAuthRequest Create(string policyName, object? resource = null) Source

Creates a request after validating that the policy name is present.

Parameters

  • policyNameThe non-empty host policy name.
  • resourceOptional host-owned authorization resource.

Returns

A validated RazorWire auth request.

Exceptions

  • ArgumentExceptionpolicyName is null, empty, or whitespace.
Property

PolicyName

string PolicyName { get; } Source

Gets the non-empty host policy name to evaluate.

Property

Resource

object? Resource { get; } Source

Gets the optional host-owned authorization resource.

Type

RazorWireAuthDiagnostics

Source

Safe RazorWire auth projection diagnostic metadata keys and codes.

Type

RazorWireAuthProjection

Source

Describes the safe UI projection for a passive AppSurface auth result.

Method

FromResult

RazorWireAuthProjection FromResult(AppSurfaceAuthResult result) Source

Creates a projection from a passive AppSurface auth result.

Parameters

  • resultThe auth result to project.

Returns

A stable UI projection.

Method

Unknown

RazorWireAuthProjection Unknown() Source

Creates the safe not-yet-evaluated projection.

Returns

An unknown-state projection without auth outcome details.

Method

StaticAnonymous

RazorWireAuthProjection StaticAnonymous() Source

Creates the safe static-export anonymous projection without host auth outcome details.

Returns

An anonymous-state projection without auth outcome details.

Property

State

RazorWireAuthProjectionState State { get; } Source

Gets the stable RazorWire UI state token.

Property

Outcome

AppSurfaceAuthOutcome? Outcome { get; } Source

Gets the optional AppSurface auth outcome that produced this state.

Property

Reason

AppSurfaceAuthReason? Reason { get; } Source

Gets the optional AppSurface auth reason that produced this state.

Property

StateToken

string StateToken { get; } Source

Gets the lowercase HTML token for State.

Enum

RazorWireAuthProjectionState

Source

Stable UI states emitted by RazorWire auth projection helpers.