Skip to content

Commit dbb41e0

Browse files
easymaceseidel
andauthored
feat(shorebird_code_push_protocol): Add shorebird AuthProvider (#3618)
Co-authored-by: Eric Seidel <eric@shorebird.dev>
1 parent 6a3e2ef commit dbb41e0

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

packages/shorebird_cli/lib/src/auth/auth.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ extension OauthValues on AuthProvider {
429429
oauth2.AuthEndpoints get authEndpoints => switch (this) {
430430
(AuthProvider.google) => const oauth2.GoogleAuthEndpoints(),
431431
(AuthProvider.microsoft) => MicrosoftAuthEndpoints(),
432+
(AuthProvider.shorebird) => throw UnsupportedError(
433+
'Shorebird auth is not yet supported in the CLI',
434+
),
432435
};
433436

434437
/// The OAuth 2.0 client ID for the provider.
@@ -456,6 +459,10 @@ extension OauthValues on AuthProvider {
456459
/// Shorebird CLI's OAuth 2.0 identifier for Azure/Entra.
457460
'4fc38981-4ec4-4bd9-a755-e6ad9a413054',
458461
);
462+
case AuthProvider.shorebird:
463+
throw UnsupportedError(
464+
'Shorebird auth is not yet supported in the CLI',
465+
);
459466
}
460467
}
461468

@@ -471,5 +478,8 @@ extension OauthValues on AuthProvider {
471478
// Required to get refresh tokens.
472479
'offline_access',
473480
],
481+
(AuthProvider.shorebird) => throw UnsupportedError(
482+
'Shorebird auth is not yet supported in the CLI',
483+
),
474484
};
475485
}

packages/shorebird_cli/lib/src/auth/ci_token.g.dart

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/shorebird_code_push_protocol/lib/src/models/auth_provider.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ enum AuthProvider {
44
google('Google'),
55

66
/// The user authenticated with their Azure/Entra account.
7-
microsoft('Microsoft');
7+
microsoft('Microsoft'),
8+
9+
/// The user authenticated via Shorebird's own auth service.
10+
shorebird('Shorebird');
811

912
const AuthProvider(this.displayName);
1013

0 commit comments

Comments
 (0)