Repository navigation
feat(auth2): Implement "Sign in with Apple" account package - #3787
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 update introduces core business logic and data models for Apple account authentication in the Serverpod environment. It adds new configuration and authentication classes, a database model for Apple accounts, and updates exports and dependencies. Linting configurations are unified, and a utility class is removed. Dependency on Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant Apple
participant Database
Client->>Server: Request Apple sign-in (identityToken, authorizationCode, etc.)
Server->>Apple: Verify identityToken
Apple-->>Server: Verification result
alt No existing AppleAccount
Server->>Apple: Exchange authorizationCode for refreshToken
Apple-->>Server: refreshToken
Server->>Database: Create AuthUser and AppleAccount (with details)
else Existing AppleAccount found
Server->>Database: Fetch AppleAccount and AuthUser
end
Server-->>Client: Return AppleAuthSuccess (account IDs, details, new user flag)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (3)
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/config.dart (2)
18-19: Consider security implications of storing the private key in memory.The private key is sensitive data. Consider adding a security note in the documentation about:
- Secure storage recommendations (e.g., environment variables, secrets management)
- Memory safety considerations
- Key rotation best practices
22-29: Consider adding validation for configuration parameters.The constructor accepts all parameters without validation. Consider validating:
- Non-empty strings for all parameters
- URL format for
redirectUri- Valid key format for the private key
/// Creates a new Sign in with Apple configuration. AppleAccountConfig({ required this.serviceIdentifier, required this.bundleIdentifier, required this.redirectUri, required this.teamId, required this.keyId, required this.key, - }); + }) { + if (serviceIdentifier.isEmpty || + bundleIdentifier.isEmpty || + redirectUri.isEmpty || + teamId.isEmpty || + keyId.isEmpty || + key.isEmpty) { + throw ArgumentError('All configuration parameters must be non-empty'); + } + + // Validate redirectUri is a valid URL + try { + Uri.parse(redirectUri); + } catch (e) { + throw ArgumentError('redirectUri must be a valid URL'); + } + }modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/models/apple_account.spy.yaml (1)
11-14: Consider the implications of storing refresh tokens.The comment mentions "Only the first one is stored per user", but this isn't enforced at the model level. Additionally, storing refresh tokens has security implications - ensure they are properly protected and consider token rotation strategies.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
modules/new_serverpod_auth/serverpod_auth_apple/serverpod_auth_apple_server/analysis_options.yaml(1 hunks)modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/analysis_options.yaml(1 hunks)modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/config/generator.yaml(1 hunks)modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/serverpod_auth_apple_account_server.dart(1 hunks)modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/apple_accounts.dart(1 hunks)modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/config.dart(1 hunks)modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/models/apple_account.spy.yaml(1 hunks)modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/module_util.dart(0 hunks)modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/pubspec.yaml(1 hunks)templates/pubspecs/modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/pubspec.yaml(1 hunks)
💤 Files with no reviewable changes (1)
- modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/module_util.dart
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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".
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: exaby73
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/pubspec.yaml (9)
Learnt from: tp
PR: serverpod/serverpod#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".
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: exaby73
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client/CHANGELOG.md:1-7
Timestamp: 2025-06-17T11:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client/CHANGELOG.md:1-7
Timestamp: 2025-06-17T11:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
Learnt from: tp
PR: serverpod/serverpod#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.
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/analysis_options.yaml (4)
Learnt from: exaby73
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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".
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
modules/new_serverpod_auth/serverpod_auth_apple/serverpod_auth_apple_server/analysis_options.yaml (7)
Learnt from: exaby73
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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".
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client/CHANGELOG.md:1-7
Timestamp: 2025-06-17T11:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client/CHANGELOG.md:1-7
Timestamp: 2025-06-17T11:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
Learnt from: tp
PR: serverpod/serverpod#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.
templates/pubspecs/modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/pubspec.yaml (10)
Learnt from: tp
PR: serverpod/serverpod#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".
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: exaby73
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client/CHANGELOG.md:1-7
Timestamp: 2025-06-17T11:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client/CHANGELOG.md:1-7
Timestamp: 2025-06-17T11:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
Learnt from: tp
PR: serverpod/serverpod#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.
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/config/generator.yaml (10)
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: exaby73
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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".
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#3651
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart:1-1
Timestamp: 2025-06-19T11:00:17.085Z
Learning: In Serverpod applications, methods that rely on public asset storage (like setUserImage/removeUserImage) should be tested in E2E tests rather than withServerpod integration tests, as they require a full server environment with asset storage infrastructure to properly test image upload/download functionality.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/serverpod_auth_apple_account_server.dart (7)
Learnt from: tp
PR: serverpod/serverpod#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".
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: exaby73
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/config.dart (1)
Learnt from: tp
PR: serverpod/serverpod#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".
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/models/apple_account.spy.yaml (5)
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/apple_accounts.dart (3)
Learnt from: tp
PR: serverpod/serverpod#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".
Learnt from: tp
PR: serverpod/serverpod#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.
Learnt from: tp
PR: serverpod/serverpod#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.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (37)
- GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.32.1
- GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.24.0
- GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.32.1
- GitHub Check: Migration e2e tests (3.32.1)
- GitHub Check: Bootstrap tests (3.24.0, ubuntu-latest, tests/bootstrap_project)
- GitHub Check: Migration e2e tests (3.24.0)
- GitHub Check: Bootstrap tests (3.32.1, ubuntu-latest, tests/bootstrap_project)
- GitHub Check: Bootstrap tests (3.32.1, windows-latest, tests/bootstrap_project)
- GitHub Check: Serverpod E2E web tests (3.32.1)
- GitHub Check: Version change test
- GitHub Check: Serverpod concurrent integration tests (server) (3.32.1)
- GitHub Check: Serverpod concurrent integration tests (server) (3.24.0)
- GitHub Check: Serverpod E2E web tests (3.24.0)
- GitHub Check: Bootstrap tests (3.24.0, windows-latest, tests/bootstrap_project)
- GitHub Check: Serverpod E2E IO tests (3.32.1)
- GitHub Check: Serverpod E2E IO tests (3.24.0)
- GitHub Check: CLI e2e tests (3.24.0, ubuntu-latest, tests/serverpod_cli_e2e_test)
- GitHub Check: CLI e2e tests (3.32.1, ubuntu-latest, tests/serverpod_cli_e2e_test)
- GitHub Check: Serverpod integration tests (server) (3.32.1)
- GitHub Check: Serverpod integration tests (flutter)
- GitHub Check: Serverpod integration tests (server) (3.24.0)
- GitHub Check: dart analyze latest (3.32.1, windows-latest)
- GitHub Check: dart analyze latest (3.32.1, ubuntu-latest)
- GitHub Check: Unit tests Web (3.32.1, windows-latest)
- GitHub Check: dart analyze downgrade (3.32.1, windows-latest)
- GitHub Check: Unit tests Web (3.24.0, windows-latest)
- GitHub Check: dart analyze (3.24.0, windows-latest)
- GitHub Check: dart analyze downgrade (3.32.1, ubuntu-latest)
- GitHub Check: dart analyze downgrade (3.24.0, windows-latest)
- GitHub Check: dart analyze downgrade (3.24.0, ubuntu-latest)
- GitHub Check: Unit tests IO (3.32.1, ubuntu-latest)
- GitHub Check: Flutter unit tests (3.32.1, windows-latest, packages/serverpod_flutter)
- GitHub Check: Unit tests IO (3.32.1, windows-latest)
- GitHub Check: Unit tests IO (3.24.0, ubuntu-latest)
- GitHub Check: Unit tests IO (3.24.0, windows-latest)
- GitHub Check: serverpod generate (3.32.1)
- GitHub Check: serverpod generate (3.24.0)
🔇 Additional comments (6)
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/config/generator.yaml (1)
4-7: Module reference added correctly
Themodulessection now advertises the dependency onserverpod_auth_userwith the aliasauth_user, matching the pattern used across the other new-auth packages. Indentation and key names conform to the expectedgenerator.yamlschema, so code-gen should pick this up without issues.modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/analysis_options.yaml (1)
1-1: LGTM: Standardization to Serverpod lint rules.The switch from Dart recommended lints to Serverpod-specific lints aligns with the project's standardization efforts and is consistent with other modules in the codebase.
templates/pubspecs/modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/pubspec.yaml (1)
17-17: LGTM: Template consistency maintained.The dependency addition in the template file is consistent with the generated pubspec.yaml file, ensuring proper dependency management across the codebase.
modules/new_serverpod_auth/serverpod_auth_apple/serverpod_auth_apple_server/analysis_options.yaml (1)
1-1: LGTM: Consistent standardization across Apple auth modules.The switch to Serverpod-specific lints is consistent with the similar change in the apple_account module and maintains uniform code quality standards across related modules.
modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/serverpod_auth_apple_account_server.dart (1)
1-2: LGTM: Appropriate public API exposure.The export additions for
apple_accounts.dartandconfig.dartproperly expose the new Apple account authentication functionality through the module's public API, following standard Serverpod patterns.modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/apple_accounts.dart (1)
8-9: No thread-safety concerns for static_siwa
Dart code in Serverpod runs on a single-threaded event loop per isolate, and theconfigsetter is invoked once at startup—before any incoming requests—so there are no concurrent reads/writes of_siwa. Each isolate has its own static state, and Serverpod doesn’t spawn additional threads that share memory, making this pattern safe as is.Likely an incorrect or invalid review comment.
d6a2783 to
931619e
Compare
Implements the core sign Sign in with Apple account module, verifying and matching the incoming credentials to an existing user or creating a new one.
Relates to #3453
Base endpoint to follow separately.
Summary by CodeRabbit
New Features
Chores
Refactor