AppSurface Search
API Reference

Auth

Namespaces

Type

AppSurfaceAuthAuditEvent

Source

Describes a passive AppSurface auth audit event.

Remarks

This value does not write logs, traces, metrics, or persistent audit records. Host applications own audit transport, retention, redaction, and access control. Metadata should remain non-sensitive and diagnostic.

Property

Name

string Name { get; } Source

Gets the stable event name.

Property

Timestamp

DateTimeOffset Timestamp { get; } Source

Gets the timestamp supplied by the host.

Property

Outcome

AppSurfaceAuthOutcome Outcome { get; } Source

Gets the high-level auth outcome associated with the event.

Property

Reason

AppSurfaceAuthReason Reason { get; } Source

Gets the concrete auth reason associated with the event.

Property

UserId

string? UserId { get; } Source

Gets the optional user identifier associated with the event.

Property

SessionId

string? SessionId { get; } Source

Gets the optional session identifier associated with the event.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help adapters or diagnostics preserve host-specific context.

Type

AppSurfaceUser

Source

Represents the surface-neutral identity information AppSurface modules can share about a user.

Remarks

AppSurfaceUser is not a claims principal, identity-provider user, or authorization policy result. Host adapters should map their security system into this passive value only after authenticating the subject. Metadata is copied with ordinal keys and should be treated as context, not as authority for authorization decisions.

Property

Id

string Id { get; } Source

Gets the stable host-owned user identifier.

Property

DisplayName

string? DisplayName { get; } Source

Gets the optional display name for UI or diagnostics.

Property

Email

string? Email { get; } Source

Gets the optional email address for UI or diagnostics.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help adapters or diagnostics preserve host-specific context.

Type

AppSurfaceSession

Source

Represents surface-neutral session information associated with an AppSurface auth context.

Remarks

Session timestamps use DateTimeOffset so host adapters can preserve their original offset. AppSurface does not convert, refresh, revoke, store, or validate the backing host session.

Property

Id

string Id { get; } Source

Gets the stable host-owned session identifier.

Property

StartedAt

DateTimeOffset? StartedAt { get; } Source

Gets the optional timestamp when the host session began.

Property

ExpiresAt

DateTimeOffset? ExpiresAt { get; } Source

Gets the optional timestamp when the host session expires.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help adapters or diagnostics preserve host-specific context.

Type

AppSurfaceLoginPrompt

Source

Describes a possible host-owned login prompt without executing sign-in or redirects.

Remarks

The prompt is passive. It never writes cookies, challenges a caller, redirects a response, or invokes an identity provider. Host UI or host adapters decide whether and how to act on it.

Property

TargetPath

string? TargetPath { get; } Source

Gets the optional app-relative target for host-owned login UI.

Property

DisplayText

string? DisplayText { get; } Source

Gets optional display text for host-owned login UI.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help adapters or diagnostics preserve host-specific context.

Type

AppSurfaceLogoutPrompt

Source

Describes a possible host-owned logout prompt without executing sign-out or redirects.

Remarks

The prompt is passive. It never clears cookies, signs out a caller, redirects a response, or invokes an identity provider. Host UI or host adapters decide whether and how to act on it.

Property

TargetPath

string? TargetPath { get; } Source

Gets the optional app-relative target for host-owned logout UI.

Property

DisplayText

string? DisplayText { get; } Source

Gets optional display text for host-owned logout UI.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help adapters or diagnostics preserve host-specific context.

Type

AppSurfaceAuthContext

Source

Captures the passive user and session context available to AppSurface auth-aware modules.

Remarks

A context with no User is a valid anonymous context. The context does not evaluate policies, read the current request, or wrap ASP.NET Core ClaimsPrincipal ; host-specific adapters own those mappings.

Property

Anonymous

AppSurfaceAuthContext Anonymous { get; } Source

Gets an anonymous auth context with no user, no session, and no metadata.

Property

User

AppSurfaceUser? User { get; } Source

Gets the optional authenticated user description.

Property

Session

AppSurfaceSession? Session { get; } Source

Gets the optional session description.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help adapters or diagnostics preserve host-specific context.

Property

IsAuthenticated

bool IsAuthenticated { get; } Source

Gets a value indicating whether the context contains a user description.

Type

AppSurfaceAuthMetadataKeys

Source

Defines reserved metadata keys used by AppSurface auth contracts.

Remarks

Metadata is context for diagnostics, display, and adapter hand-off. It is not an authorization source of truth unless a host-owned adapter validates the value against the host security system. The appsurface. prefix is reserved for AppSurface-owned keys so future typed properties can migrate existing metadata without key collisions.

Type

AgentApprovalDiagnosticCodes

Source

Defines stable diagnostic codes for the delegated-agent authorization lifecycle.

Remarks

Hosts may add a stable subcode to the canonical family for the typed outcome, such as agent-approval.consumption-denied.grant-missing . Do not use display messages as machine-readable branching values, and do not renumber public outcome enums after release.

Type

AgentIdentityReference

Source

Identifies a stable host-local agent or harness identity without exposing credentials.

Remarks

The value belongs to the host's agent namespace. It is not an application-user id, a user permission, a bearer token, or evidence that the agent may act. ToString redacts the raw value by default.

Property

Value

string Value { get; } Source

Gets the stable host-local agent or harness identity.

Type

AgentApproverReference

Source

Identifies the human or host authority that approved an exact action without prescribing an identity provider.

Remarks

A host can derive this reference from ExternalSubject , an app-owned identity, or another validated subject namespace. The reference is not an agent grant or a reusable approval credential. ToString redacts the raw value by default.

Property

Value

string Value { get; } Source

Gets the stable host-local approver identity.

Type

AgentActionBinding

Source

Describes a host-normalized workflow transition that an approval receipt binds.

Remarks

The binding profile and digest are opaque host values. Hosts must use the same profile, normalisation rules, and safe digest representation when issuing and consuming a receipt. This type does not prescribe canonicalisation, cryptography, persistence, or a workflow runtime. ToString intentionally redacts binding values.

Method

Matches

bool Matches(AgentActionBinding? other)

Determines whether another binding has the same ordinal action, workflow, state, transition, profile, and digest values.

Parameters

  • other
    The binding to compare.

Returns

true when every approval-relevant binding field matches.

Property

ActionId

string ActionId { get; } Source

Gets the stable action identifier.

Property

TaskId

string TaskId { get; } Source

Gets the host task or harness run identifier.

Property

WorkflowInstanceId

string WorkflowInstanceId { get; } Source

Gets the host workflow instance identifier.

Property

ExpectedState

string ExpectedState { get; } Source

Gets the expected current workflow state.

Property

ExpectedStateVersion

string ExpectedStateVersion { get; } Source

Gets the expected state version or concurrency stamp.

Property

Transition

string Transition { get; } Source

Gets the requested transition or decision.

Property

BindingProfile

string BindingProfile { get; } Source

Gets the host-defined canonicalisation profile and version in exactly two non-empty, whitespace-free profile/version segments.

Property

SafeIntentDigest

string SafeIntentDigest { get; } Source

Gets the host-derived safe intent digest.

Type

AgentActionMetadata

Source

Declares safe, host-controlled metadata for an action an agent can propose.

Remarks

This metadata aids host policy and confirmation presentation. It does not classify untrusted agent input, grant authority, or replace a host's policy evaluation.

Property

ActionId

string ActionId { get; } Source

Gets the stable action identifier.

Property

DisplayName

string DisplayName { get; } Source

Gets the host-controlled display name.

Property

Risk

AgentActionRisk Risk { get; } Source

Gets the host-declared risk classification.

Property

ConfirmationPosture

AgentConfirmationPosture ConfirmationPosture { get; } Source

Gets the declared confirmation posture.

Property

Redaction

AgentActionRedaction Redaction { get; } Source

Gets display redaction guidance.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied display-safe host metadata.

Type

AgentActionRequest

Source

Describes one action an agent proposes to a host.

Remarks

The request is immutable and contains only host-safe display fields. It does not carry user credentials, bearer tokens, an agent grant, an approval receipt, or permission to execute the action.

Property

Action

AgentActionMetadata Action { get; } Source

Gets host-controlled action metadata.

Property

Binding

AgentActionBinding Binding { get; } Source

Gets the bound workflow transition.

Property

Agent

AgentIdentityReference Agent { get; } Source

Gets the proposing agent or local harness reference.

Property

CorrelationId

string CorrelationId { get; } Source

Gets the host-generated correlation identifier.

Property

RequestedAt

DateTimeOffset RequestedAt { get; } Source

Gets the host-supplied request timestamp.

Property

SafeSummary

string SafeSummary { get; } Source

Gets the display-safe action summary.

Property

Rationale

string? Rationale { get; } Source

Gets the optional display-safe proposal rationale.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied display-safe host metadata.

Type

AgentConfirmationRequest

Source

Describes the exact confirmation a host presents to one approver.

Remarks

This type is passive. Hosts choose how to render a confirmation card, re-evaluate current authority, and issue an opaque receipt after approval. A changed action must be submitted as a new AgentActionRequest ; hosts must not edit an approved request in place.

Property

ActionRequest

AgentActionRequest ActionRequest { get; } Source

Gets the exact action request awaiting confirmation.

Property

Approver

AgentApproverReference Approver { get; } Source

Gets the expected approver reference.

Property

ExpiresAt

DateTimeOffset ExpiresAt { get; } Source

Gets the expiration timestamp.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied display-safe host metadata.

Type

AgentAuthorizationDecision

Source

Describes the host's evaluation of an AgentActionRequest .

Remarks

The decision does not evaluate policy, issue a receipt, or execute an action. The diagnostic code must be the canonical family for Kind or a stable subcode in that family; consumers branch on Kind rather than on a display message or subcode.

Method

Allowed

AgentAuthorizationDecision Allowed(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates an allowed decision with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

An allowed decision.

Method

Denied

AgentAuthorizationDecision Denied(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a denied decision with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

A denied decision.

Method

ConfirmationRequired

AgentAuthorizationDecision ConfirmationRequired(AgentConfirmationRequest confirmationRequest, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a confirmation-required decision with the standard AppSurface diagnostic code.

Parameters

  • confirmationRequest
    The exact confirmation request the host presents.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

A confirmation-required decision.

Property

Kind

AgentAuthorizationDecisionKind Kind { get; } Source

Gets the host evaluation outcome.

Property

Code

string Code { get; } Source

Gets the stable machine-readable diagnostic code.

Property

CorrelationId

string CorrelationId { get; } Source

Gets the host-generated correlation identifier.

Property

Message

string? Message { get; } Source

Gets the optional display-safe diagnostic message.

Property

ConfirmationRequest

AgentConfirmationRequest? ConfirmationRequest { get; } Source

Gets the confirmation request when Kind is AgentAuthorizationDecisionKind.ConfirmationRequired .

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied display-safe host metadata.

Property

IsAllowed

bool IsAllowed { get; } Source

Gets a value indicating whether the host allowed the action without confirmation.

Property

IsDenied

bool IsDenied { get; } Source

Gets a value indicating whether the host denied the action.

Property

RequiresConfirmation

bool RequiresConfirmation { get; } Source

Gets a value indicating whether the host requires a human confirmation.

Type

AgentApprovalReceipt

Source

Describes an opaque host-issued approval proof bound to one action, approver, and expiration.

Remarks

The receipt is not a bearer-token format, signature, database record, or transport message. Hosts own issuance, storage, revocation, atomic one-use consumption, current-authority checks, and execution. Use FromConfirmedRequest to issue a new receipt after durable human approval. Direct construction supports host-owned data reconstruction; it neither proves issuance nor authorizes execution. ToString redacts the opaque receipt reference by default.

Method

FromConfirmedRequest

AgentApprovalReceipt FromConfirmedRequest(string receiptId, AgentConfirmationRequest confirmationRequest, DateTimeOffset issuedAt, DateTimeOffset expiresAt, IReadOnlyDictionary<string, string>? metadata = null)

Creates an approval receipt from the exact confirmation request that a host durably approved.

Parameters

  • receiptId
    Opaque host-issued receipt reference.
  • confirmationRequest
    The exact confirmed request.
  • issuedAt
    Host-supplied issuance timestamp.
  • expiresAt
    Host-supplied receipt expiration timestamp.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

A receipt bound to the confirmation request's action, agent, approver, and correlation identifier.

Remarks

This factory validates structural consistency only. The caller must first perform and durably record the human approval, then persist and later atomically consume the resulting receipt.

Property

ReceiptId

string ReceiptId { get; } Source

Gets the opaque host-issued receipt reference.

Property

Binding

AgentActionBinding Binding { get; } Source

Gets the exact action binding.

Property

Agent

AgentIdentityReference Agent { get; } Source

Gets the proposing agent reference.

Property

Approver

AgentApproverReference Approver { get; } Source

Gets the approving authority reference.

Property

CorrelationId

string CorrelationId { get; } Source

Gets the host-generated correlation identifier.

Property

IssuedAt

DateTimeOffset IssuedAt { get; } Source

Gets the host-supplied issuance timestamp.

Property

ExpiresAt

DateTimeOffset ExpiresAt { get; } Source

Gets the host-supplied expiration timestamp.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied display-safe host metadata.

Type

AgentApprovalConsumptionResult

Source

Describes one terminal host outcome while consuming an approval receipt.

Remarks

This result does not consume a receipt or retry an action. Hosts return it after their atomic claim and current authority, grant, state, expiry, revocation, and binding checks complete.

Method

Consumed

AgentApprovalConsumptionResult Consumed(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a consumed result with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

A consumed result.

Method

AlreadyConsumed

AgentApprovalConsumptionResult AlreadyConsumed(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates an already-consumed result with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

An already-consumed result.

Method

Expired

AgentApprovalConsumptionResult Expired(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates an expired result with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

An expired result.

Method

Revoked

AgentApprovalConsumptionResult Revoked(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a revoked result with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

A revoked result.

Method

Stale

AgentApprovalConsumptionResult Stale(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a stale result with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

A stale result.

Method

BindingMismatch

AgentApprovalConsumptionResult BindingMismatch(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a binding-mismatch result with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

A binding-mismatch result.

Method

Denied

AgentApprovalConsumptionResult Denied(string correlationId, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a denied result with the standard AppSurface diagnostic code.

Parameters

  • correlationId
    Host-generated correlation identifier.
  • message
    Optional display-safe diagnostic message.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

A denied result.

Property

Outcome

AgentApprovalConsumptionOutcome Outcome { get; } Source

Gets the terminal host outcome.

Property

Code

string Code { get; } Source

Gets the stable machine-readable diagnostic code.

Property

CorrelationId

string CorrelationId { get; } Source

Gets the host-generated correlation identifier.

Property

Message

string? Message { get; } Source

Gets the optional display-safe diagnostic message.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied display-safe host metadata.

Property

IsConsumed

bool IsConsumed { get; } Source

Gets a value indicating whether the host consumed the receipt.

Type

AgentAuthorizationAuditEvent

Source

Describes a passive audit event for a delegated-agent authorization lifecycle.

Remarks

Hosts own audit event delivery and should use only display-safe values. This contract must not be treated as proof that an audit sink persisted an event successfully.

Method

FromReceipt

AgentAuthorizationAuditEvent FromReceipt(AgentAuthorizationAuditEventKind kind, DateTimeOffset timestamp, string code, AgentApprovalReceipt receipt, string? safeSummary = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates an audit event from a host-issued receipt so the binding, agent, approver, receipt reference, and correlation identifier stay consistent.

Parameters

  • kind
    Lifecycle event kind.
  • timestamp
    Host-supplied event timestamp.
  • code
    Stable machine-readable diagnostic code.
  • receipt
    Host-issued receipt whose references the event records.
  • safeSummary
    Optional display-safe event summary.
  • metadata
    Optional display-safe host metadata copied with ordinal keys.

Returns

An audit event structurally consistent with receipt .

Remarks

This factory does not prove that the host persisted the event. It removes caller-side copying for receipt-backed events; hosts reconstructing persisted records may use the constructor after validating their stored references.

Property

Kind

AgentAuthorizationAuditEventKind Kind { get; } Source

Gets the lifecycle event kind.

Property

Timestamp

DateTimeOffset Timestamp { get; } Source

Gets the host-supplied event timestamp.

Property

Code

string Code { get; } Source

Gets the stable machine-readable diagnostic code.

Property

CorrelationId

string CorrelationId { get; } Source

Gets the host-generated correlation identifier.

Property

Binding

AgentActionBinding Binding { get; } Source

Gets the bound action representation.

Property

Agent

AgentIdentityReference Agent { get; } Source

Gets the proposing agent reference.

Property

Approver

AgentApproverReference? Approver { get; } Source

Gets the optional approver reference.

Property

ReceiptId

string? ReceiptId { get; } Source

Gets the optional opaque receipt reference.

Property

SafeSummary

string? SafeSummary { get; } Source

Gets the optional display-safe event summary.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied display-safe host metadata.

Type

AppSurfaceUserIdentityResult

Source

Represents the result of resolving an external subject to a durable app-owned user id.

Remarks

This result family is intentionally separate from AppSurfaceAuthResult . Authentication, policy, and navigation outcomes remain host-auth decisions; identity resolution describes the app-owned mapping step that can happen after the host has authenticated a subject. Messages and metadata should be display-safe and avoid raw subjects, emails, tokens, and provider payloads by default.

Method

Resolved

AppSurfaceUserIdentityResult Resolved(AppUserId appUserId, ExternalSubject subject, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a successful identity resolution result.

Parameters

  • appUserId
    The durable app-owned user id.
  • subject
    The external subject tuple that resolved to the app user.
  • message
    Optional display-safe message supplied by the app resolver.
  • metadata
    Optional display or diagnostic metadata copied with ordinal keys.

Returns

A resolved identity result.

Method

MissingSubject

AppSurfaceUserIdentityResult MissingSubject(string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a failure result for a missing external subject.

Parameters

  • message
    Optional display-safe message supplied by the app resolver.
  • metadata
    Optional display or diagnostic metadata copied with ordinal keys.

Returns

A missing-subject identity result.

Method

MalformedSubject

AppSurfaceUserIdentityResult MalformedSubject(string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a failure result for a malformed external subject.

Parameters

  • message
    Optional display-safe message supplied by the app resolver.
  • metadata
    Optional display or diagnostic metadata copied with ordinal keys.

Returns

A malformed-subject identity result.

Method

DisabledAppUser

AppSurfaceUserIdentityResult DisabledAppUser(ExternalSubject? subject = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a failure result for a disabled app user.

Parameters

  • subject
    Optional external subject involved in the failed resolution.
  • message
    Optional display-safe message supplied by the app resolver.
  • metadata
    Optional display or diagnostic metadata copied with ordinal keys.

Returns

A disabled-app-user identity result.

Method

StaleOrUnknownSession

AppSurfaceUserIdentityResult StaleOrUnknownSession(ExternalSubject? subject = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a failure result for a stale or unknown session.

Parameters

  • subject
    Optional external subject involved in the failed resolution.
  • message
    Optional display-safe message supplied by the app resolver.
  • metadata
    Optional display or diagnostic metadata copied with ordinal keys.

Returns

A stale-or-unknown-session identity result.

Method

DuplicateMapping

AppSurfaceUserIdentityResult DuplicateMapping(ExternalSubject? subject = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a failure result for duplicate mappings.

Parameters

  • subject
    Optional external subject involved in the failed resolution.
  • message
    Optional display-safe message supplied by the app resolver.
  • metadata
    Optional display or diagnostic metadata copied with ordinal keys.

Returns

A duplicate-mapping identity result.

Method

StoreUnavailable

AppSurfaceUserIdentityResult StoreUnavailable(ExternalSubject? subject = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a failure result for an unavailable app-owned identity store.

Parameters

  • subject
    Optional external subject involved in the failed resolution.
  • message
    Optional display-safe message supplied by the app resolver.
  • metadata
    Optional display or diagnostic metadata copied with ordinal keys.

Returns

A store-unavailable identity result.

Method

ProvisioningDenied

AppSurfaceUserIdentityResult ProvisioningDenied(ExternalSubject? subject = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a failure result when the app declines provisioning or attachment.

Parameters

  • subject
    Optional external subject involved in the failed resolution.
  • message
    Optional display-safe message supplied by the app resolver.
  • metadata
    Optional display or diagnostic metadata copied with ordinal keys.

Returns

A provisioning-denied identity result.

Property

Status

AppSurfaceUserIdentityStatus Status { get; } Source

Gets the identity resolution status.

Property

AppUserId

AppUserId? AppUserId { get; } Source

Gets the resolved app-owned user id when Succeeded is true .

Property

Subject

ExternalSubject? Subject { get; } Source

Gets the external subject tuple involved in resolution when it was available and valid enough to report safely.

Property

Message

string? Message { get; } Source

Gets an optional display-safe message supplied by the app resolver.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help adapters or diagnostics preserve app-specific context.

Property

Succeeded

bool Succeeded { get; } Source

Gets a value indicating whether the external subject resolved to an app-owned user id.

Type

IAppSurfaceUserIdentityResolver

Source

Resolves authenticated external subjects to durable app-owned user ids.

Remarks

Applications implement this interface with their own persistence, provisioning, disabled-user, and duplicate-mapping policies. Implementations should make successful resolution idempotent for the same ExternalSubject tuple, honor cancellation before starting expensive work and while awaiting I/O, and handle concurrent first-time resolution without creating duplicate app users.

Prefer enforcing uniqueness at the mapping store with a unique constraint over the external subject tuple (issuer, subject, and partition key), then make competing inserts converge on the same app user id through optimistic concurrency or a transaction retry. Stores that cannot enforce uniqueness should use an equivalent first-provisioning guard, such as a short distributed lock scoped to the external subject tuple.

Avoid a check-then-insert flow that reads a missing mapping and blindly creates a new app user. Concurrent sign-ins can otherwise provision duplicate app users before either caller observes the other mapping.

Method

ResolveAsync

ValueTask<AppSurfaceUserIdentityResult> ResolveAsync(ExternalSubject subject, AppSurfaceUserIdentityResolutionContext context, CancellationToken cancellationToken = default)

Resolves an external subject to a durable app-owned user id.

Parameters

  • subject
    The authenticated external subject to resolve.
  • context
    Display-safe resolution context supplied by the host integration.
  • cancellationToken
    Cancellation token for resolver work and awaited I/O.

Returns

An identity resolution result with either an app-owned user id or a typed failure state.

Type

AppSurfaceAuthResult

Source

Represents a passive AppSurface auth decision.

Remarks

AppSurfaceAuthResult describes an auth decision; it does not challenge, forbid, redirect, evaluate policies, sign users in, or sign users out. Host-specific packages map these outcomes to platform behavior.

Method

Allowed

AppSurfaceAuthResult Allowed(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a result that allows the requested operation.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

An allowed auth result.

Method

Challenge

AppSurfaceAuthResult Challenge(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a result indicating that the caller should authenticate before retrying.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

A challenge auth result.

Method

Unauthenticated

AppSurfaceAuthResult Unauthenticated(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a result indicating that the caller is not authenticated.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

A challenge auth result.

Method

Forbid

AppSurfaceAuthResult Forbid(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a result indicating that the authenticated caller is forbidden.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

A forbidden auth result.

Method

Forbidden

AppSurfaceAuthResult Forbidden(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a result indicating that the authenticated caller is forbidden.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

A forbidden auth result.

Method

MissingPolicy

AppSurfaceAuthResult MissingPolicy(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a setup-failure result for a missing host-owned policy.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

A setup-failure auth result.

Method

MissingServices

AppSurfaceAuthResult MissingServices(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a setup-failure result for missing host-owned auth services.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

A setup-failure auth result.

Method

MissingSubject

AppSurfaceAuthResult MissingSubject(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a setup-failure result for an authenticated caller that could not be mapped to a stable subject.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

A setup-failure auth result.

Method

UnsafeReturnUrl

AppSurfaceAuthResult UnsafeReturnUrl(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a result for an unsafe return or navigation target.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

An unsafe-navigation auth result.

Method

StaleOrUnknownSession

AppSurfaceAuthResult StaleOrUnknownSession(AppSurfaceAuthContext? context = null, string? message = null, IReadOnlyDictionary<string, string>? metadata = null)

Creates a result for stale, expired, missing, or unresolved session state.

Parameters

  • context
    Optional auth context that was evaluated.
  • message
    Optional message supplied by the host adapter for its own display contract.
  • metadata
    Optional metadata copied with ordinal keys.

Returns

A stale-or-unknown-session auth result.

Property

Outcome

AppSurfaceAuthOutcome Outcome { get; } Source

Gets the high-level auth outcome.

Property

Reason

AppSurfaceAuthReason Reason { get; } Source

Gets the concrete reason associated with Outcome .

Property

Context

AppSurfaceAuthContext? Context { get; } Source

Gets the optional auth context that was evaluated.

Property

Message

string? Message { get; } Source

Gets an optional message supplied by the host adapter for that adapter's own display contract.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help adapters preserve host-specific context.

Property

IsAllowed

bool IsAllowed { get; } Source

Gets a value indicating whether the outcome allows the requested operation.

Property

RequiresAuthentication

bool RequiresAuthentication { get; } Source

Gets a value indicating whether the caller should authenticate before retrying.

Property

IsConfigurationFailure

bool IsConfigurationFailure { get; } Source

Gets a value indicating whether the outcome represents host setup or configuration failure.

Type

AppSurfaceAuthOptions

Source

Options root for the surface-neutral AppSurface auth composition boundary.

Remarks

This boundary-preview type is intentionally empty. It exists so future AppSurface auth contracts can add settings through a stable options root after those contracts are proven. It does not configure authentication schemes, authorization policies, user or session access, tenant behavior, identity providers, cookies, bearer tokens, challenges, forbids, middleware, endpoint filters, or UI. Host applications must keep those choices in their host-specific security configuration until a later AppSurface package explicitly owns them.

Type

AppSurfaceUserIdentityResolutionContext

Source

Carries display-safe context for resolving an external subject to an app-owned user id.

Remarks

The context is an input to an app-owned resolver. It may carry safe correlation, issuer, tenant, or provisioning policy hints, but those hints are not authority unless the application validates them against its own security and persistence rules. Metadata is copied with ordinal keys.

Property

Empty

AppSurfaceUserIdentityResolutionContext Empty { get; } Source

Gets an empty resolution context.

Property

CorrelationId

string? CorrelationId { get; } Source

Gets the optional display-safe correlation id.

Property

Metadata

IReadOnlyDictionary<string, string> Metadata { get; } Source

Gets copied metadata that can help an app resolver preserve display-safe context.

Type

ExternalSubject

Source

Describes an authenticated external subject before it has been resolved to an app-owned user id.

Remarks

The uniqueness key is the ordinal tuple of Issuer , Subject , and optional PartitionKey . Use PartitionKey only for host-validated realm, tenant, client, or environment context that is part of the subject namespace. AppSurface does not treat the partition as tenant authority or authorization truth. The raw values are intentionally omitted from ToString .

Property

Issuer

string Issuer { get; } Source

Gets the stable issuer or identity-provider namespace.

Property

Subject

string Subject { get; } Source

Gets the stable subject id inside the issuer namespace.

Property

PartitionKey

string? PartitionKey { get; } Source

Gets the optional host-validated partition that participates in the uniqueness key.

Type

AppSurfaceAuthModule

Source

Registers the surface-neutral AppSurface auth composition boundary.

Remarks

AppSurfaceAuthModule is a boundary-preview module. It gives AppSurface packages a stable place to compose future auth contracts without taking a dependency on ASP.NET Core authentication, authorization policies, identity providers, middleware, endpoint filters, cookies, bearer tokens, or UI. Registering this module does not sign users in, inspect requests, challenge callers, forbid callers, or enforce authorization; host applications must continue to configure those behaviors in their host-specific security stack.

Method

ConfigureServices

void ConfigureServices(StartupContext context, IServiceCollection services)

Registers the AppSurface auth boundary options type.

Parameters

  • context
    Startup context for the current AppSurface composition pass.
  • services
    Service collection that receives the boundary-preview options registration.

Remarks

This method registers AppSurfaceAuthOptions with the Microsoft Options pattern so later AppSurface auth contracts have a documented options home. It intentionally adds no runtime auth behavior and performs no request, principal, policy, middleware, or identity-provider configuration.

Method

RegisterDependentModules

void RegisterDependentModules(ModuleDependencyBuilder builder)

Registers modules required by the AppSurface auth boundary.

Parameters

  • builder
    The module dependency builder for the current startup graph.

Remarks

The boundary preview has no dependent modules. Future host-specific auth integrations should declare their own dependencies instead of relying on this module to pull in ASP.NET Core or UI packages.

Type

AppUserId

Source

Identifies a durable app-owned user record after an external authenticated subject has been resolved.

Remarks

AppUserId belongs to the consuming application. AppSurface does not allocate ids, prescribe storage, or treat the id as a permission source. The value is intentionally omitted from ToString so accidental logs and diagnostics do not disclose user identifiers by default.

Property

Value

string Value { get; } Source

Gets the stable app-owned user id value.

Enum

AgentActionRisk

Source

Classifies the host-declared risk of an action an agent proposes.

Remarks

Risk is descriptive metadata for host policy and user-facing confirmation. It is not permission truth and does not allow an agent to execute an action.

Enum

AgentConfirmationPosture

Source

States the confirmation posture declared for an action.

Remarks

The posture is an input to host policy. A host can require confirmation for any action, and only a host-issued AgentAuthorizationDecision determines whether the requested action may proceed.

Enum

AgentActionRedaction

Source

States how a host should treat action arguments in confirmation, audit, and diagnostic displays.

Enum

AgentAuthorizationDecisionKind

Source

Defines the outcome of host evaluation for an agent action request.

Enum

AgentApprovalConsumptionOutcome

Source

Defines terminal outcomes when a host attempts to consume an approval receipt.

Remarks

Hosts own receipt storage and atomicity. A host must return exactly one terminal outcome for a consumption attempt and must not retry execution after AlreadyConsumed . Outcomes such as Stale are terminal for an attempt, not necessarily for the receipt: a host that detects stale state before its atomic claim leaves the receipt unconsumed and may retry after the original state is restored.

Enum

AgentAuthorizationAuditEventKind

Source

Identifies a passive delegated-agent authorization audit description.

Remarks

This enum describes lifecycle events only. AppSurface does not write logs, metrics, traces, or persisted audit records; hosts own transport, retention, redaction, access control, and failure handling.

Enum

AppSurfaceUserIdentityStatus

Source

Defines result states for resolving an external subject to an app-owned user id.

Enum

AppSurfaceAuthOutcome

Source

Defines the high-level auth outcome AppSurface modules can understand without owning host authentication.

Enum

AppSurfaceAuthReason

Source

Defines the concrete reason associated with an AppSurface auth outcome.