Skip to content

refactor!: Rename AuthConfig to AuthServices and initialize all IDP from there. - #4140

Merged
SandPod merged 7 commits into
serverpod:mainfrom
SandPod:3856-move-all-idp-to-shared-auth-config
Nov 2, 2025
Merged

SandPod merged 7 commits into
serverpod:mainfrom
SandPod:3856-move-all-idp-to-shared-auth-config

Conversation

@SandPod

@SandPod SandPod commented Nov 1, 2025 •

Copy link
Copy Markdown
Contributor
  • Removes the old AuthServices
  • Renames AuthConfig to AuthServices
  • Implements IdentityProviderFactory for all supported identity providers.
  • Moves all uses of the old AuthServices to the new AuthServices in the code (migrating to the shared authentication config that should be used in the new auth package)

In order to close #3856 we need to implement the passkey identity provider to follow the same pattern.

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.

Breaking changes

If you have done any breaking changes, make sure to outline them here, so that they can be included in the notes for the next release.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Restructured authentication configuration from a single-point setup to a factory-based pattern for identity providers, enabling more modular configuration.
    • Transitioned from direct identity provider access to a generic retrieval system, improving extensibility and reducing tight coupling to specific provider implementations.

@coderabbitai

coderabbitai Bot commented Nov 1, 2025 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This PR refactors the authentication configuration system from AuthConfig to AuthServices, removing a singleton-based identity provider interface and introducing factory-based provider registration. The IdentityProvider interface is eliminated, provider access shifts from instance properties to a generic getIdentityProvider<T>() method, and IDPs are now registered through factory classes (GoogleIdentityProviderFactory, AppleIdentityProviderFactory, EmailIdentityProviderFactory) during AuthServices.set() initialization.

Changes

Cohort / File(s) Summary
Core Refactoring: AuthConfig → AuthServices
modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart, modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart, modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart
Renamed AuthConfig class to AuthServices; updated factory method from AuthConfig.set() to AuthServices.set(); changed identityProviders parameter type to List<IdentityProviderFactory<Object>>; updated token manager source references across endpoints.
IdentityProviderFactory Generalization
modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dart
Removed IdentityProvider interface; changed generic constraint from T extends IdentityProvider to T extends Object; added public constructor and field tokenManagerOverride: TokenManager?.
IDP Factory Classes (New)
modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/{google,apple,email}\_identity_provider_factory.dart
Introduced factory classes extending IdentityProviderFactory<T>: GoogleIdentityProviderFactory, AppleIdentityProviderFactory, EmailIdentityProviderFactory; each stores a config object and implements construct() to instantiate the corresponding IDP.
Removed Singleton IDP Module
modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/common/auth_services.dart
Deleted entire AuthServices class (singleton manager) and IDPExtension that provided instance property access to GoogleIDP, AppleIDP, EmailIDP.
IDP Endpoint Updates
modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/{google,apple,email}/endpoints/*\_base_endpoint.dart, modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart
Updated getters to retrieve IDPs via AuthServices.getIdentityProvider<T>() instead of instance property access; changed token manager source to AuthServices.instance.tokenManager.
Export Updates
modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart, modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart, modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/{google,apple,email}.dart
Replaced auth_config.dart export with auth_services.dart; re-exported provider factory classes instead of legacy auth_services; added protocol.dart export.
Bridge & Migration Modules
modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart, modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.dart, modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
Updated provider access patterns: AuthServices.instance.googleIDP.admin → AuthServices.getIdentityProvider<GoogleIDP>().admin; AuthConfig.instance → AuthServices.instance; getter implementations now use generic provider retrieval.
Test Infrastructure & Fakes
modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart, modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/fakes/fake_identity_provider.dart, modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart
Updated test setup to use AuthServices.set() with factory-based providers; removed IdentityProvider implementation from FakeIdentityProvider; simplified provider factory contract tests; changed generic constraint to T extends Object.
Integration Tests (Email)
modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart, modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/{email,password}\_backwards_compatibility_test.dart
Replaced AuthBackwardsCompatibility.config setup with AuthServices.set(identityProviders: [EmailIdentityProviderFactory(config)], primaryTokenManager: tokenManager); moved setup to setUpAll with corresponding tearDownAll cleanup.
Example & Test Server Code
examples/auth/auth_server/lib/server.dart, tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/{server.dart,src/endpoints/{auth_test_endpoint,email_account_backwards_compatibility_endpoint}.dart}, tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/{email_account_endpoint_test,email_account_migration_test}.dart
Updated initialization from AuthConfig.set() / AuthServices.initialize() to AuthServices.set(identityProviders: [...], primaryTokenManager: ...); added inline EmailIdentityProviderFactory(config) registration; updated token manager retrieval to AuthServices.getTokenManager<T>() / AuthServices.instance.tokenManager.
Test Fixture
modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.dart
Updated fallback token manager initialization from AuthConfig.instance to AuthServices.set(identityProviders: [], ...).

Sequence Diagram(s)

sequenceDiagram
    participant Setup as Initialization/Setup
    participant AuthServices
    participant ProviderFactory as IdentityProviderFactory
    participant IDP as IDP Instance<br/>(Google/Apple/Email)
    participant Endpoint as Endpoint

    rect rgb(200, 220, 255)
    Note over Setup,Endpoint: New Factory-Based Registration Flow
    Setup->>ProviderFactory: Create factory<br/>(GoogleIdentityProviderFactory, etc.)
    ProviderFactory->>ProviderFactory: Store config
    Setup->>AuthServices: set(identityProviders: [factory], primaryTokenManager)
    AuthServices->>AuthServices: Store factories
    end

    rect rgb(220, 240, 220)
    Note over Endpoint,IDP: Runtime IDP Access Pattern
    Endpoint->>AuthServices: getIdentityProvider<T>()
    AuthServices->>ProviderFactory: construct(tokenManager)
    ProviderFactory->>IDP: Create with config & tokenManager
    IDP-->>AuthServices: Return instance
    AuthServices-->>Endpoint: Return IDP
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Areas requiring extra attention:

  • Provider factory implementation and registration logic (apple_identity_provider_factory.dart, google_identity_provider_factory.dart, email_identity_provider_factory.dart): Verify that construct() methods correctly inject tokenManager and that tokenManagerOverride is properly propagated through the base class.
  • Removal of IdentityProvider interface (provider_factory.dart): Confirm that relaxing the generic constraint from IdentityProvider to Object doesn't break type safety in provider retrieval methods or introduce unintended casting errors.
  • Provider access pattern migration (endpoints: apple_idp_base_endpoint.dart, google_idp_base_endpoint.dart, email_idp_base_endpoint.dart): Ensure getIdentityProvider<T>() correctly retrieves and casts provider instances; verify no null return or type mismatch scenarios exist.
  • Test setup migration to factory-based initialization (integration tests in migration and bridge modules): Confirm setUpAll/tearDownAll patterns properly isolate test state and that AuthServices.set() calls include all required providers and token managers.
  • Export refactoring (core.dart, providers/*.dart): Verify that re-exported symbols correctly map to the new factory classes and don't create circular dependencies or missing imports.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes Check ✅ Passed All code changes in this pull request are directly aligned with the objectives of implementing a shared configuration interface for authentication providers. The refactoring of AuthConfig to AuthServices, implementation of IdentityProviderFactory for all providers, removal of the IdentityProvider interface in favor of Object-based generalization, and comprehensive updates to all related code and tests are all essential components of the unified provider configuration pattern. The structural changes to the provider factory pattern, including the addition of tokenManagerOverride as a constructor parameter, represent necessary modifications to support the new factory-based initialization approach and are clearly within the scope of issue #3856.
Description Check ✅ Passed The pull request description includes a clear explanation of what is being changed (removing old AuthServices, renaming AuthConfig to AuthServices, implementing IdentityProviderFactory for all providers, and migrating existing usage patterns) and explicitly references issue #3856 as the target issue to be closed. The description adequately explains the rationale for the changes and their scope. While the pre-launch checklist items remain unchecked and breaking changes are not documented, the core required information is present and complete for a draft PR in progress.
Title Check ✅ Passed The pull request title "refactor!: Rename AuthConfig to AuthServices and initialize all IDP from there" accurately summarizes the primary changes in the changeset. The raw summary confirms that AuthConfig is renamed to AuthServices throughout the codebase, and the initialization pattern for identity providers is restructured—moving from a singleton-based access pattern (AuthServices.instance.googleIDP, etc.) to a factory-based configuration pattern using AuthServices.set() with IdentityProviderFactory implementations. The title is concise, uses the breaking change indicator (!), and clearly communicates the main architectural shift without excessive detail. A teammate reviewing git history would understand that this refactoring consolidates authentication service configuration under a renamed AuthServices class with a new IDP initialization approach.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SandPod
SandPod force-pushed the 3856-move-all-idp-to-shared-auth-config branch from aab9cfe to c14c708 Compare November 1, 2025 11:47
@SandPod
SandPod force-pushed the 3856-move-all-idp-to-shared-auth-config branch from c14c708 to a8dcc18 Compare November 1, 2025 16:15
@SandPod SandPod changed the title feat: Expose all IDPs in AuthConfig. refactor: Rename AuthConfig to AuthServices and initialize all IDP from there. Nov 1, 2025
@SandPod
SandPod force-pushed the 3856-move-all-idp-to-shared-auth-config branch from a8dcc18 to 2031ff0 Compare November 1, 2025 16:24
@SandPod

SandPod commented Nov 1, 2025

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 1, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart (1)

10-10: Hide the Protocol class in the protocol.dart export.

The export statement exposes the internal Protocol class (a SerializationManagerServer implementation detail), which causes naming conflicts. Domain models and exceptions in the file are appropriate for the public API, but the Protocol class should be hidden. This pattern is already established in the codebase: serverpod_auth_idp_client hides Protocol when re-exporting dependencies.

Change line 10 from:

export 'src/generated/protocol.dart';

to:

export 'src/generated/protocol.dart' hide Protocol;
🧹 Nitpick comments (5)
modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dart (1)

11-19: Keep the base constructor const for downstream factories

Please make the base ctor const so downstream factories can continue to expose const constructors (handy when registering providers in const lists) while still allowing an override when needed.

-  IdentityProviderFactory({
+  const IdentityProviderFactory({
     this.tokenManagerOverride,
   });
modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dart (1)

17-17: Consider eager initialization for early misconfiguration detection.

The lazy getter pattern defers provider resolution until first use, potentially delaying detection of misconfiguration errors. Based on learnings, eager initialization is preferred to surface setup issues at server startup.

If you prefer to detect misconfiguration at startup rather than at first request, consider changing to eager initialization:

-  GoogleIDP get googleIDP => AuthServices.getIdentityProvider<GoogleIDP>();
+  late final GoogleIDP googleIDP = AuthServices.getIdentityProvider<GoogleIDP>();

Based on learnings.

modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart (1)

11-11: Consider eager initialization for early misconfiguration detection.

The lazy getter pattern defers token manager resolution until first use. If you prefer to detect misconfiguration at server startup rather than at first request, consider changing to eager initialization:

-  TokenManager get tokenManager => AuthServices.instance.tokenManager;
+  late final TokenManager tokenManager = AuthServices.instance.tokenManager;

Based on learnings.

modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.dart (1)

12-12: Consider eager initialization for early misconfiguration detection.

The lazy getter pattern defers token manager resolution until first use. If you prefer to detect misconfiguration at server startup rather than at first request, consider changing to eager initialization:

-  TokenManager get tokenManager => AuthServices.instance.tokenManager;
+  late final TokenManager tokenManager = AuthServices.instance.tokenManager;

Based on learnings.

modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart (1)

3-4: Consider consolidating imports.

Both aliased (as new_auth_core) and non-aliased imports of core.dart are present. If the non-aliased import is solely for AuthServices on lines 25, 31, and 36, consider using the alias consistently (e.g., new_auth_core.AuthServices) to improve readability and avoid potential confusion.

Apply this diff if you prefer consistent aliasing:

-import 'package:serverpod_auth_idp_server/core.dart';

Then update references to use the alias:

-    AuthServices.set(
+    new_auth_core.AuthServices.set(
       identityProviders: [
         new_email_idp.EmailIdentityProviderFactory(newEmailIDPConfig),
       ],
       primaryTokenManager: tokenManager,
     );
-    newEmailIDP = AuthServices.getIdentityProvider<new_email_idp.EmailIDP>();
+    newEmailIDP = new_auth_core.AuthServices.getIdentityProvider<new_email_idp.EmailIDP>();

And in tearDownAll:

-    AuthServices.set(
+    new_auth_core.AuthServices.set(
       identityProviders: [],
       primaryTokenManager: tokenManager,
     );
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56e57d2 and 2031ff0.

📒 Files selected for processing (33)
  • examples/auth/auth_server/lib/server.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart (3 hunks)
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart (3 hunks)
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart (14 hunks)
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/fakes/fake_identity_provider.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/common/auth_services.dart (0 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/email_identity_provider_factory.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/google_identity_provider_factory.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart (2 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart (1 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart (2 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart (9 hunks)
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dart (3 hunks)
💤 Files with no reviewable changes (1)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/common/auth_services.dart
🧰 Additional context used
📓 Path-based instructions (3)
**/*.dart

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.dart: Format all Dart code using dart format . before committing
Code must pass Dart analyzer in strict mode (util/run_tests_analyze or melos lint_strict)
Use descriptive variable and function names

Files:

  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/email_identity_provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/google_identity_provider_factory.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • examples/auth/auth_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/fakes/fake_identity_provider.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart
**/lib/**/*.dart

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Remove unnecessary comments from production code

Files:

  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/email_identity_provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/google_identity_provider_factory.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • examples/auth/auth_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart
**/*_test.dart

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*_test.dart: Write test descriptions using the Given/When/Then pattern
Organize tests with passing/success cases first, group related cases using group(), then follow with error cases

Files:

  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart
🧠 Learnings (26)
📓 Common learnings
Learnt from: SandPod
Repo: serverpod/serverpod PR: 4127
File: modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart:11-16
Timestamp: 2025-10-30T10:11:34.781Z
Learning: In Serverpod authentication endpoints, SandPod prefers eager initialization of AuthConfig-dependent fields (e.g., `final TokenManager tokenManager = AuthConfig.instance.tokenManager;`) rather than lazy getters, to detect misconfiguration at server startup rather than deferring errors until the first request to the endpoint.
📚 Learning: 2025-09-17T16:09:20.868Z
Learnt from: nielsenko
Repo: serverpod/serverpod PR: 3980
File: packages/serverpod/lib/src/web_server/web_server.dart:102-115
Timestamp: 2025-09-17T16:09:20.868Z
Learning: In Serverpod's web server authentication handling (packages/serverpod/lib/src/web_server/web_server.dart), query parameter authentication fallback (`authenticationKey ??= queryParameters['auth']`) is intentionally maintained for legacy compatibility reasons, even though it has security implications regarding credential leakage.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • examples/auth/auth_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart
📚 Learning: 2025-07-02T16:07:50.947Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3747
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/migrating_email_endpoint_base.dart:4-4
Timestamp: 2025-07-02T16:07:50.947Z
Learning: In Serverpod, tp prefers importing the full package (e.g., 'package:serverpod_auth_migration_server/serverpod_auth_migration_server.dart') as a baseline rather than using smaller local imports, even within the same package where it might be considered a "self-import".

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/fakes/fake_identity_provider.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart
📚 Learning: 2025-08-26T13:22:33.125Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3829
File: modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/business/passkey_accounts.dart:0-0
Timestamp: 2025-08-26T13:22:33.125Z
Learning: The passkeys_server Dart library evolved from version 0.3.0 to 0.4.0, adding required parameters to verifyRegistration and verifyLogin methods for complete WebAuthn security validation including challenge, clientDataJSON, and attestationObject verification.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • examples/auth/auth_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
📚 Learning: 2025-07-02T16:09:27.702Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3747
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml:37-38
Timestamp: 2025-07-02T16:09:27.702Z
Learning: In Serverpod migration testing, it's appropriate for test servers like serverpod_new_auth_test_server to include dependencies on both legacy packages (e.g., serverpod_auth_server) and new modular packages to enable comprehensive testing of migration paths from old to new authentication systems.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
📚 Learning: 2025-07-10T12:33:42.871Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3777
File: modules/new_serverpod_auth/serverpod_auth_google_account/serverpod_auth_google_account_server/lib/src/business/google_accounts.dart:126-138
Timestamp: 2025-07-10T12:33:42.871Z
Learning: In Serverpod Google authentication, tp prefers a flexible field validation approach: only require user ID always, require email only on first-time sign-ups (and make this configurable), and make other profile fields optional. If apps don't want to collect emails, the system shouldn't rely on the verified_email attribute. This allows apps to have configurable data collection policies.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/business/auth_backwards_compatibility.dart
📚 Learning: 2025-10-30T10:11:34.781Z
Learnt from: SandPod
Repo: serverpod/serverpod PR: 4127
File: modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart:11-16
Timestamp: 2025-10-30T10:11:34.781Z
Learning: In Serverpod authentication endpoints, SandPod prefers eager initialization of AuthConfig-dependent fields (e.g., `final TokenManager tokenManager = AuthConfig.instance.tokenManager;`) rather than lazy getters, to detect misconfiguration at server startup rather than deferring errors until the first request to the endpoint.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • examples/auth/auth_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
📚 Learning: 2025-08-25T19:46:58.073Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3917
File: modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/analysis_options.yaml:3-6
Timestamp: 2025-08-25T19:46:58.073Z
Learning: In Serverpod, test tool paths like `test/integration/test_tools/serverpod_test_tools.dart` are configured per project in the "generator.yaml" file and managed by a generator system, so they don't need to be updated manually across all files at once.

Applied to files:

  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
📚 Learning: 2025-07-24T13:01:52.743Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3826
File: modules/new_serverpod_auth/serverpod_auth_apple/serverpod_auth_apple_client/lib/serverpod_auth_apple_client.dart:1-1
Timestamp: 2025-07-24T13:01:52.743Z
Learning: High-level serverpod_auth_* packages (like serverpod_auth_apple_client) should re-export their serverpod_auth_* dependencies so that consumers only need to import the high-level package and don't get warnings about importing from non-dependency packages. The re-exports should hide conflicting elements like 'Caller' and 'Protocol' to avoid naming conflicts. This pattern prevents users from needing to directly depend on multiple internal implementation packages.

Applied to files:

  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart
📚 Learning: 2025-07-15T13:38:58.183Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3787
File: modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/pubspec.yaml:18-18
Timestamp: 2025-07-15T13:38:58.183Z
Learning: For Sign in with Apple authentication, there are two distinct packages: `sign_in_with_apple` is the client-side package for mobile apps, while `sign_in_with_apple_server` is a server-side utility package for handling Sign in with Apple tokens and validation on Dart servers.

Applied to files:

  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • examples/auth/auth_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart
📚 Learning: 2025-07-01T13:01:27.054Z
Learnt from: exaby73
Repo: serverpod/serverpod PR: 3741
File: modules/serverpod_auth/serverpod_auth_server/analysis_options.yaml:14-16
Timestamp: 2025-07-01T13:01:27.054Z
Learning: In Serverpod, first-party packages like serverpod_auth_server can appropriately use blanket `invalid_use_of_internal_member: ignore` directives in their analysis_options.yaml since they use internal Database methods internally without exposing them in their public APIs to end users.

Applied to files:

  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
📚 Learning: 2025-06-27T07:44:09.048Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3721
File: modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/test/serverpod_auth_session_flutter_test.dart:1-7
Timestamp: 2025-06-27T07:44:09.048Z
Learning: In Serverpod packages, the `uuid` package is re-exported through a chain: `serverpod_auth_session_client` re-exports `serverpod_client`, which re-exports `serverpod_serialization`, which re-exports `uuid`. This means `Uuid` class is available in files that import `serverpod_auth_session_client` without needing a direct `uuid` package import.

Applied to files:

  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
📚 Learning: 2025-06-27T08:39:36.440Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3721
File: util/pub_get_all:0-0
Timestamp: 2025-06-27T08:39:36.440Z
Learning: In the Serverpod project, `dart pub get` commands work fine on Flutter packages both locally and in CI environments, even when the package has `flutter: sdk: flutter` dependencies in pubspec.yaml. The technical constraint of Flutter SDK dependencies causing `dart pub` failures may not apply in all environments or recent Dart versions.

Applied to files:

  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
📚 Learning: 2025-07-14T07:47:16.177Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3783
File: modules/new_serverpod_auth/serverpod_auth_apple/serverpod_auth_apple_server/docker-compose.yaml:4-7
Timestamp: 2025-07-14T07:47:16.177Z
Learning: In Serverpod authentication modules, Docker compose files for different auth modules (like serverpod_auth_apple_server and serverpod_auth_apple_account_server) use the same ports (9090 for Postgres, 9091 for Redis) by design, since only one container/Docker compose setup is intended to run at a time.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
📚 Learning: 2025-06-17T11:40:09.088Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client/CHANGELOG.md:1-7
Timestamp: 2025-06-17T11:40:09.088Z
Learning: CHANGELOG.md files in the serverpod_auth_migration modules (client and server) are auto-generated and cannot be manually modified during the development process.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dart
📚 Learning: 2025-06-18T14:49:11.263Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart
  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dart
  • examples/auth/auth_server/lib/server.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/fakes/fake_identity_provider.dart
  • modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dart
  • tests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dart
📚 Learning: 2025-07-24T13:46:05.689Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3824
File: packages/serverpod/lib/src/authentication/authentication_info.dart:21-34
Timestamp: 2025-07-24T13:46:05.689Z
Learning: In Serverpod's AuthenticationInfo class, the `userId` getter is being kept temporarily for legacy support with packages that use `int` user IDs, but will be removed in a future PR. The `userIdentifier` field now supports UUID strings for new auth modules, representing the planned migration from int-based to UUID-based user identification.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dart
  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dart
📚 Learning: 2025-10-15T11:44:29.873Z
Learnt from: CR
Repo: serverpod/serverpod PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T11:44:29.873Z
Learning: Applies to **/*_test.dart : Organize tests with passing/success cases first, group related cases using group(), then follow with error cases

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dart
📚 Learning: 2025-09-17T16:08:47.035Z
Learnt from: nielsenko
Repo: serverpod/serverpod PR: 3980
File: tests/serverpod_test_server/test_integration/static_files_test.dart:10-10
Timestamp: 2025-09-17T16:08:47.035Z
Learning: In Dart, multiple imports can use the same alias prefix (e.g., `import 'package:http/http.dart' as http;` and `import 'package:http/io_client.dart' as http;`) as long as there are no actual symbol conflicts in the code usage. The compiler resolves symbols correctly even with shared prefixes when the used symbols don't conflict.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dart
📚 Learning: 2025-07-15T13:10:16.490Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3787
File: modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/apple_accounts.dart:65-67
Timestamp: 2025-07-15T13:10:16.490Z
Learning: In Serverpod Apple authentication, tp prefers adding a `lastRefreshed` field to the database model to track when refresh tokens were last validated, enabling periodic refresh token validation strategy for Apple Sign-In accounts.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dart
📚 Learning: 2025-06-17T11:38:13.087Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3666
File: modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts_admin.dart:130-143
Timestamp: 2025-06-17T11:38:13.087Z
Learning: In serverpod_auth_email_account EmailAccountsAdmin, tp prefers relying on database unique constraint exceptions over application-level pre-insert checks for email uniqueness, especially in contexts with longer-running transactions where TOCTOU issues could still occur.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dart
📚 Learning: 2025-06-17T11:34:13.289Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
📚 Learning: 2025-10-15T11:44:29.873Z
Learnt from: CR
Repo: serverpod/serverpod PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T11:44:29.873Z
Learning: Applies to **/lib/**/*.dart : Remove unnecessary comments from production code

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dart
📚 Learning: 2025-06-16T12:07:26.018Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3651
File: modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts.dart:35-39
Timestamp: 2025-06-16T12:07:26.018Z
Learning: The `withServerpod` test helper runs tests within a transaction, which may require adapting database queries to accept transaction parameters for proper snapshot consistency during testing.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dart
📚 Learning: 2025-08-06T06:58:47.019Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3855
File: modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/apple_accounts.dart:143-159
Timestamp: 2025-08-06T06:58:47.019Z
Learning: In the sign_in_with_apple_server package, the `decodeAppleServerNotification` method performs complete JWT signature verification against Apple's published public keys. It fetches keys from https://appleid.apple.com/auth/keys, validates the audience and issuer, and cryptographically verifies the JWT signature. This means webhook handlers using this method already have proper security against spoofed notifications without needing additional signature verification code.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart
📚 Learning: 2025-08-06T06:58:47.019Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3855
File: modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/apple_accounts.dart:143-159
Timestamp: 2025-08-06T06:58:47.019Z
Learning: The `_siwa.decodeAppleServerNotification` method from the sign_in_with_apple_server package automatically performs signature verification against Apple's published keys, including JWT signature verification and certificate chain validation. This means webhook handlers using this method already have built-in security against spoofed notifications.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/endpoints/apple_idp_base_endpoint.dart

@SandPod
SandPod force-pushed the 3856-move-all-idp-to-shared-auth-config branch from 2031ff0 to bcc18ae Compare November 1, 2025 16:40
@SandPod
SandPod force-pushed the 3856-move-all-idp-to-shared-auth-config branch from bcc18ae to a11a9bc Compare November 1, 2025 16:45
@SandPod SandPod changed the title refactor: Rename AuthConfig to AuthServices and initialize all IDP from there. refactor!: Rename AuthConfig to AuthServices and initialize all IDP from there. Nov 1, 2025
@SandPod
SandPod marked this pull request as ready for review November 1, 2025 16:57
@SandPod
SandPod requested a review from a team November 1, 2025 16:57

@marcelomendoncasoares marcelomendoncasoares left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a two minor code style discussions!

@SandPod
SandPod merged commit 048ea0d into serverpod:main Nov 2, 2025
@SandPod
SandPod deleted the 3856-move-all-idp-to-shared-auth-config branch November 2, 2025 16:22
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add shared configuration interface for authentication providers with generalized configuration list

2 participants