feat(shorebird_code_push_protocol): Add shorebird AuthProvider (#3618)

Co-authored-by: Eric Seidel <eric@shorebird.dev>
This commit is contained in:
Mac
2026-02-19 17:29:05 -07:00
committed by GitHub
parent 6a3e2efdb5
commit dbb41e02b9
3 changed files with 15 additions and 1 deletions
@@ -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',
),
};
}
@@ -35,4 +35,5 @@ Map<String, dynamic> _$CiTokenToJson(CiToken instance) => <String, dynamic>{
const _$AuthProviderEnumMap = {
AuthProvider.google: 'google',
AuthProvider.microsoft: 'microsoft',
AuthProvider.shorebird: 'shorebird',
};
@@ -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);