TypedAuthEndpointDescriptor<TContext, TRequest, TResponse> class final

Typed endpoint descriptor that owns request decoding and response encoding.

Implemented types

Constructors

TypedAuthEndpointDescriptor({required String id, required AuthOperationMethod method, required AuthRoutePath path, required AuthOperationCodec<TRequest> requestCodec, required AuthOperationCodec<TResponse> responseCodec, required FutureOr<TResponse> handler(AuthOperationInvocation<TContext> invocation, TRequest request), required AuthOperationSemantics semantics, AuthOperationAuthentication authentication = AuthOperationAuthentication.session, AuthOperationOriginPolicy originPolicy = AuthOperationOriginPolicy.browser, AuthOperationCsrfPolicy csrfPolicy = AuthOperationCsrfPolicy.none, AuthRateLimitOperation? rateLimitOperation, AuthEndpointRateLimitIdentifierResolver<TRequest>? rateLimitIdentifier, bool requiresRecentAuthentication = false, Iterable<AuthEndpointResponseContract> responseContracts = const <AuthEndpointResponseContract>[], AuthEndpointPublicErrorResponseFactory? publicErrorResponse, bool serverOnly = false, AuthEndpointMount mount = AuthEndpointMount.auth})
Creates a typed endpoint descriptor.
const

Properties

authentication AuthOperationAuthentication
Authentication boundary required by the endpoint.
final
csrfPolicy AuthOperationCsrfPolicy
CSRF policy required by the endpoint.
final
handler FutureOr<TResponse> Function(AuthOperationInvocation<TContext> invocation, TRequest request)
Handler invoked with the decoded request.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Stable endpoint identifier.
final
method AuthOperationMethod
HTTP method used by the endpoint.
final
mount AuthEndpointMount
Mount location selected by the endpoint.
final
originPolicy AuthOperationOriginPolicy
Browser-origin policy required by the endpoint.
final
path AuthRoutePath
Canonical route path used by the endpoint.
final
publicErrorResponse AuthEndpointPublicErrorResponseFactory?
Optional factory for protocol-specific public errors.
final
rateLimitIdentifier AuthEndpointRateLimitIdentifierResolver<TRequest>?
Resolves a private rate-limit identifier from a decoded request.
final
rateLimitOperation AuthRateLimitOperation?
Rate-limit operation applied by the host, when configured.
final
requestCodec AuthOperationCodec<TRequest>
Request codec used before handler runs.
final
requiresRecentAuthentication bool
Whether recent original authentication is required.
final
responseCodec AuthOperationCodec<TResponse>
Response codec used after handler completes.
final
responseContracts Iterable<AuthEndpointResponseContract>
Explicit success responses advertised by the endpoint.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semantics AuthOperationSemantics
Persistence and replay semantics declared by the endpoint.
final
serverOnly bool
Whether the endpoint is available only to server-side callers.
final

Methods

createPublicErrorResponse(AuthEndpointPublicErrorKind kind) AuthEndpointHttpResponse?
Creates the endpoint's public error response for kind.
override
invoke(AuthOperationInvocation<TContext> invocation, AuthEndpointRequest request) Future<Object?>
Decodes, invokes, and encodes one endpoint request.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveRateLimitIdentifier(AuthEndpointRequest request) String?
Resolves a private limiter identifier from request.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited