From dbb41e02b9f060dc7a3245437114c9662723394e Mon Sep 17 00:00:00 2001 From: Mac Date: Thu, 19 Feb 2026 17:29:05 -0700 Subject: [PATCH] feat(shorebird_code_push_protocol): Add shorebird AuthProvider (#3618) Co-authored-by: Eric Seidel --- packages/shorebird_cli/lib/src/auth/auth.dart | 10 ++++++++++ packages/shorebird_cli/lib/src/auth/ci_token.g.dart | 1 + .../lib/src/models/auth_provider.dart | 5 ++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/shorebird_cli/lib/src/auth/auth.dart b/packages/shorebird_cli/lib/src/auth/auth.dart index 0bcf0d72..100c7e0e 100644 --- a/packages/shorebird_cli/lib/src/auth/auth.dart +++ b/packages/shorebird_cli/lib/src/auth/auth.dart @@ -429,6 +429,9 @@ extension OauthValues on AuthProvider { oauth2.AuthEndpoints get authEndpoints => switch (this) { (AuthProvider.google) => const oauth2.GoogleAuthEndpoints(), (AuthProvider.microsoft) => MicrosoftAuthEndpoints(), + (AuthProvider.shorebird) => throw UnsupportedError( + 'Shorebird auth is not yet supported in the CLI', + ), }; /// The OAuth 2.0 client ID for the provider. @@ -456,6 +459,10 @@ extension OauthValues on AuthProvider { /// Shorebird CLI's OAuth 2.0 identifier for Azure/Entra. '4fc38981-4ec4-4bd9-a755-e6ad9a413054', ); + case AuthProvider.shorebird: + throw UnsupportedError( + 'Shorebird auth is not yet supported in the CLI', + ); } } @@ -471,5 +478,8 @@ extension OauthValues on AuthProvider { // Required to get refresh tokens. 'offline_access', ], + (AuthProvider.shorebird) => throw UnsupportedError( + 'Shorebird auth is not yet supported in the CLI', + ), }; } diff --git a/packages/shorebird_cli/lib/src/auth/ci_token.g.dart b/packages/shorebird_cli/lib/src/auth/ci_token.g.dart index 7d86738b..794321fb 100644 --- a/packages/shorebird_cli/lib/src/auth/ci_token.g.dart +++ b/packages/shorebird_cli/lib/src/auth/ci_token.g.dart @@ -35,4 +35,5 @@ Map _$CiTokenToJson(CiToken instance) => { const _$AuthProviderEnumMap = { AuthProvider.google: 'google', AuthProvider.microsoft: 'microsoft', + AuthProvider.shorebird: 'shorebird', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/models/auth_provider.dart b/packages/shorebird_code_push_protocol/lib/src/models/auth_provider.dart index 0d421f8f..e07bb67c 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/auth_provider.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/auth_provider.dart @@ -4,7 +4,10 @@ enum AuthProvider { google('Google'), /// The user authenticated with their Azure/Entra account. - microsoft('Microsoft'); + microsoft('Microsoft'), + + /// The user authenticated via Shorebird's own auth service. + shorebird('Shorebird'); const AuthProvider(this.displayName);