Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An in-memory implementation of the `AuthClient` interface for the Flutter News App Toolkit.

License

flutter-news-app-full-source-code/auth-inmemory

Repository files navigation

Flutter News App Toolkit Logo

Auth In-Memory

An in-memory implementation of the `AuthClient` interface for the Flutter News App Toolkit.

coverage Live Docs: View Main Project: Browse

This auth_inmemory package provides an in-memory implementation of the AuthClient interface within the Flutter News App Full Source Code Toolkit. It offers a mock authentication client that operates entirely on in-memory data, making it suitable for demonstration purposes, local development, and testing without requiring a live backend. This package simulates various authentication flows, ensuring consistent behavior and robust error handling based on the auth_client contract.

⭐ Feature Showcase: Simplified Authentication Testing & Development

This package offers a comprehensive set of features for managing authentication operations in a simulated environment.

🧱 Core Functionality

πŸš€ AuthClient Implementation

  • AuthInmemory Class: A concrete in-memory implementation of the AuthClient interface, providing a standardized way to simulate authentication.
  • Simulated Authentication Flows: Implements requestSignInCode, verifySignInCode, signInAnonymously, and signOut to simulate various authentication processes.
  • Reactive State Changes: Provides authStateChanges (a stream that emits the current authenticated User or null on state changes) and getCurrentUser to retrieve the current user.

🌐 Debugging & Validation

  • Privileged Flow Simulation: Supports an isDashboardLogin flag in requestSignInCode and verifySignInCode to simulate privileged flows, allowing testing of admin-specific authentication logic (e.g., only admin@example.com is allowed).
  • Token Retrieval: Includes a currentToken getter to retrieve the simulated authentication token for inspection during development.

πŸ›‘οΈ Standardized Error Handling

  • HttpException Propagation: Throws standard HttpException subtypes (e.g., UnauthorizedException, NotFoundException, AuthenticationException, InvalidInputException) from core on simulated failures, ensuring consistent error handling in a testing context.

πŸ’‘ Your Advantage: This package provides a reliable, in-memory authentication client that simplifies testing and development of authentication-related features. It eliminates the need for external backend dependencies during development, offering immediate feedback and consistent behavior for your authentication logic, especially for complex scenarios like privileged logins.

πŸ”‘ Licensing

This auth_inmemory package is an integral part of the Flutter News App Full Source Code Toolkit. For comprehensive details regarding licensing, including trial and commercial options for the entire toolkit, please refer to the main toolkit organization page.

About

An in-memory implementation of the `AuthClient` interface for the Flutter News App Toolkit.

Resources

License

Stars

Watchers

Forks

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /