diff options
author | Joel Winarske <joel.winarske@gmail.com> | 2024-09-05 15:42:22 -0700 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2024-09-09 15:37:02 +0000 |
commit | 03dd111dd026cefaf5cfada39e3342d31b71848d (patch) | |
tree | 0c605fa704bdad31385006a17a4792eb7333e603 /lib/config.dart | |
parent | e39bf6a1e3657542a56f21b3afa6a65ea0a194e2 (diff) |
Flutter SDK 3.24.1ricefish
-update packages
-format files
-fix analyze issues
Change-Id: I9eb84f1bca7623ce676695904f172aff127c8ced
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
(cherry picked from commit 15093ee4880d535c65faed929801c2d79d1a212c)
Diffstat (limited to 'lib/config.dart')
-rw-r--r-- | lib/config.dart | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/lib/config.dart b/lib/config.dart index aac3af8..b8a3d05 100644 --- a/lib/config.dart +++ b/lib/config.dart @@ -17,8 +17,13 @@ class KuksaConfig { static int defaultPort = 55555; static String defaultCaCertPath = '/etc/kuksa-val/CA.pem'; - KuksaConfig({required this.hostname, required this.port, required this.authorization, - required this.use_tls, required this.ca_certificate, required this.tls_server_name}); + KuksaConfig( + {required this.hostname, + required this.port, + required this.authorization, + required this.use_tls, + required this.ca_certificate, + required this.tls_server_name}); } // NOTE: This may need to be changed to a FutureProvider to avoid slowing @@ -49,7 +54,7 @@ final kuksaConfigProvider = Provider((ref) { debugPrint("Reading authorization token $s"); try { token = File(s).readAsStringSync(); - } on Exception catch(_) { + } on Exception catch (_) { print("ERROR: Could not read authorization token file $token"); token = ""; } @@ -63,8 +68,7 @@ final kuksaConfigProvider = Provider((ref) { bool use_tls = false; if (yamlMap.containsKey('use-tls')) { var value = yamlMap['use-tls']; - if (value is bool) - use_tls = value; + if (value is bool) use_tls = value; } //debugPrint("Use TLS = $use_tls"); @@ -75,7 +79,7 @@ final kuksaConfigProvider = Provider((ref) { } try { ca_cert = File(ca_path).readAsBytesSync(); - } on Exception catch(_) { + } on Exception catch (_) { print("ERROR: Could not read CA certificate file $ca_path"); ca_cert = []; } @@ -87,22 +91,19 @@ final kuksaConfigProvider = Provider((ref) { } return KuksaConfig( - hostname: hostname, - port: port, - authorization: token, - use_tls: use_tls, - ca_certificate: ca_cert, - tls_server_name: tls_server_name - ); - } on Exception catch(_) { + hostname: hostname, + port: port, + authorization: token, + use_tls: use_tls, + ca_certificate: ca_cert, + tls_server_name: tls_server_name); + } on Exception catch (_) { return KuksaConfig( - hostname: KuksaConfig.defaultHostname, - port: KuksaConfig.defaultPort, - authorization: "", - use_tls: false, - ca_certificate: [], - tls_server_name: "" - ); + hostname: KuksaConfig.defaultHostname, + port: KuksaConfig.defaultPort, + authorization: "", + use_tls: false, + ca_certificate: [], + tls_server_name: ""); } }); - |