Skip to content

Commit 55bc07a

Browse files
Lyokonedemolaf
andauthored
feat(auth): add support for tenants (#103)
* feat(auth): add support for tenants * add e2e tests * more * more * fixes * fix conflicts * refactor: update terminology from 'whitelisted' to 'allowed' for consistency --------- Co-authored-by: Ademola Fadumo <demolafadumo@gmail.com>
1 parent 6b3fcce commit 55bc07a

17 files changed

+2620
-26
lines changed

packages/dart_firebase_admin/lib/src/app/exception.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ String _platformErrorCodeMessage(String code) {
3030
case 'PERMISSION_DENIED':
3131
return 'Client does not have sufficient permission. This can happen because the OAuth token does not have the right scopes, the client does not have permission, or the API has not been enabled for the client project.';
3232
case 'NOT_FOUND':
33-
return 'Specified resource not found, or the request is rejected due to undisclosed reasons such as whitelisting.';
33+
return 'Specified resource not found, or the request is rejected due to undisclosed reasons such as allow list restrictions.';
3434
case 'CONFLICT':
3535
return 'Concurrency conflict, such as read-modify-write conflict. Only used by a few legacy services. Most services use ABORTED or ALREADY_EXISTS instead of this. Refer to the service-specific documentation to see which one to handle in your code.';
3636
case 'ABORTED':

packages/dart_firebase_admin/lib/src/auth.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ import 'utils/validator.dart';
2525
part 'auth/action_code_settings_builder.dart';
2626
part 'auth/auth.dart';
2727
part 'auth/auth_config.dart';
28+
part 'auth/auth_config_tenant.dart';
2829
part 'auth/auth_exception.dart';
2930
part 'auth/auth_http_client.dart';
3031
part 'auth/auth_request_handler.dart';
3132
part 'auth/base_auth.dart';
3233
part 'auth/identifier.dart';
34+
part 'auth/tenant.dart';
35+
part 'auth/tenant_manager.dart';
3336
part 'auth/token_generator.dart';
3437
part 'auth/token_verifier.dart';
3538
part 'auth/user.dart';

packages/dart_firebase_admin/lib/src/auth/auth.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ class Auth extends _BaseAuth implements FirebaseService {
3434
}
3535
}
3636

37-
// TODO tenantManager
37+
TenantManager? _tenantManager;
38+
39+
/// The [TenantManager] instance associated with the current project.
40+
///
41+
/// This provides tenant management capabilities for multi-tenant applications.
42+
/// Multi-tenancy support requires Google Cloud's Identity Platform (GCIP).
43+
/// To learn more about GCIP, including pricing and features, see the
44+
/// [GCIP documentation](https://cloud.google.com/identity-platform).
45+
TenantManager get tenantManager {
46+
return _tenantManager ??= TenantManager._(app);
47+
}
48+
3849
// TODO projectConfigManager
3950
}

0 commit comments

Comments
 (0)