Repository navigation
refactor!: Rename AuthConfig to AuthServices and initialize all IDP from there. - #4140
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis PR refactors the authentication configuration system from Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes Areas requiring extra attention:
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
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. Comment |
aab9cfe to
c14c708
Compare
c14c708 to
a8dcc18
Compare
a8dcc18 to
2031ff0
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
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
Protocolclass (aSerializationManagerServerimplementation detail), which causes naming conflicts. Domain models and exceptions in the file are appropriate for the public API, but theProtocolclass 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 factoriesPlease make the base ctor
constso 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 ofcore.dartare present. If the non-aliased import is solely forAuthServiceson 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
📒 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 usingdart 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.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/email_identity_provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/google_identity_provider_factory.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartexamples/auth/auth_server/lib/server.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/fakes/fake_identity_provider.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dartmodules/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.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/email_identity_provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/google_identity_provider_factory.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartexamples/auth/auth_server/lib/server.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dartmodules/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.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dartmodules/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.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartexamples/auth/auth_server/lib/server.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dartmodules/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.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/lib/src/endpoints/session_migration_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/fakes/fake_identity_provider.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/integrations/provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/server.dartmodules/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.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartexamples/auth/auth_server/lib/server.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.darttests/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.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/email_account_backwards_compatibility_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.darttests/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.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/test/email/test_utils/email_idp_test_fixture.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/jwt/endpoints/jwt_tokens_endpoint.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_account_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartexamples/auth/auth_server/lib/server.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.darttests/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.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/business/auth_services.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.darttests/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.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/email.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/google.dartmodules/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.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/src/common/endpoints/status_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/google/endpoints/google_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/integrations/apple_identity_provider_factory.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartexamples/auth/auth_server/lib/server.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/core.dartmodules/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.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartmodules/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.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/providers/apple.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartmodules/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.dartmodules/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.dartmodules/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.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migrations.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/lib/serverpod_auth_core_server.dartmodules/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.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/lib/src/endpoints/auth_test_endpoint.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/contract_tests/provider_factory_contract_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/email_backwards_compatibility_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_migration_test.darttests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dartmodules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/test/integration/password_backwards_compatibility_test.dartexamples/auth/auth_server/lib/server.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/auth_services_test.dartmodules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server/test/common/business/fakes/fake_identity_provider.dartmodules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server/test/integration/backwards_compatibility_test.darttests/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.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/email/endpoints/email_idp_base_endpoint.dartmodules/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.dartmodules/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
2031ff0 to
bcc18ae
Compare
bcc18ae to
a11a9bc
Compare
marcelomendoncasoares
left a comment
There was a problem hiding this comment.
Just a two minor code style discussions!
In order to close #3856 we need to implement the passkey identity provider to follow the same pattern.
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.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