Skip to content

Commit

Permalink
chore(shorebird_cli): remove legacy auth token fallback (#2522)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Oct 9, 2024
1 parent c6f72bd commit 729a95d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
14 changes: 1 addition & 13 deletions packages/shorebird_cli/lib/src/auth/auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,7 @@ class Auth {
void _loadCredentials() {
final envToken = platform.environment[shorebirdTokenEnvVar];
if (envToken != null) {
try {
_token = CiToken.fromBase64(envToken);
} catch (_) {
// TODO(bryanoltman): Remove this legacy behavior after July 2024 or
// next major release.
logger.warn('''
$shorebirdTokenEnvVar needs to be updated before the next major release.
Run `shorebird login:ci` to obtain a new token.''');
_token = CiToken(
refreshToken: envToken,
authProvider: AuthProvider.google,
);
}
_token = CiToken.fromBase64(envToken);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ OperatingSystemInterface get osInterface => read(osInterfaceRef);
/// {@template operating_system_interface}
/// A wrapper around operating system specific functionality.
/// {@endtemplate}
// ignore: one_member_abstracts
abstract class OperatingSystemInterface {
/// {@macro operating_system_interface}
factory OperatingSystemInterface() {
Expand Down
10 changes: 2 additions & 8 deletions packages/shorebird_cli/test/src/auth/auth_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,8 @@ void main() {
);
});

test('prints warning message when token string is not valid base64',
() async {
auth = buildAuth();
verify(
() => logger.warn('''
SHOREBIRD_TOKEN needs to be updated before the next major release.
Run `shorebird login:ci` to obtain a new token.'''),
).called(1);
test('throws error when token string is not valid base64', () async {
expect(buildAuth, throwsA(isFormatException));
});
});

Expand Down

0 comments on commit 729a95d

Please sign in to comment.