Skip to main content

zuraffa_auth_platform 7.3.0 copy "zuraffa_auth_platform: ^7.3.0" to clipboard
zuraffa_auth_platform: ^7.3.0 copied to clipboard

Shared channel-envelope core for the zuraffa_auth platform adapters: decode, typed-error plumbing, and timeout policy over an injected platform channel.

zuraffa_auth_platform #

Shared channel-envelope core for the zuraffa_auth platform adapters (android, ios, macos): decode, typed-error plumbing, and timeout policy over one injected platform channel.

Adapters keep their own exception types — the core builds failures through an adapter-injected factory — and their taxonomies are pure data (a recoverable-code set). A fourth adapter's channel is a constructor plus a set:

class WebAuthChannel {
  static const recoverableCodes = {'user_cancelled', 'timeout'};
  final ChannelInvoke invoke;
  final Duration timeout;
  const WebAuthChannel({required this.invoke, this.timeout = const Duration(seconds: 30)});

  Future<Map<String, Object?>?> call(String method, Map<String, Object?> args) =>
      PlatformAuthEnvelope(
        invoke: invoke,
        timeout: timeout,
        onTyped: WebAuthException.new,
        mapNativeError: (code, message) =>
            WebAuthException(code, message, recoverable: recoverableCodes.contains(code)),
      ).call(method, args);
}

Envelope behavior #

  • Success payloads decode to the returned map (null passes through).
  • Native error payloads ({'error': {'code', 'message'}}): no_credentials → AuthException with code invalid_credentials (core default, native message preserved); the adapter's recoverable set → recoverable typed failure; everything else → non-recoverable, code preserved verbatim.
  • Thrown transport failures → channel_error (non-recoverable); non-map payloads → malformed_response (non-recoverable); already-typed AuthExceptions pass through unmodified.
  • Calls past the timeout window (default 30 s) → recoverable timeout.
0
likes
145
points
88
downloads

Documentation

API reference

Publisher

verified publisherzuraffa.com

Weekly Downloads

Shared channel-envelope core for the zuraffa_auth platform adapters: decode, typed-error plumbing, and timeout policy over an injected platform channel.

Homepage
Repository (GitHub)
View/report issues

Topics

#authentication #zuraffa

License

MIT (license)

Dependencies

zuraffa, zuraffa_auth

More

Packages that depend on zuraffa_auth_platform