chore(shorebird_cli): remove legacy auth token fallback (#2522)

This commit is contained in:
Felix Angelov
2024-10-09 15:28:26 -05:00
committed by GitHub
parent c6f72bd071
commit 729a95de8a
3 changed files with 4 additions and 21 deletions
+1 -13
View File
@@ -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;
}
@@ -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() {
@@ -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));
});
});