summaryrefslogtreecommitdiffstats
path: root/lib/core
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2023-11-16 07:24:08 +0900
committerScott Murray <scott.murray@konsulko.com>2023-11-16 07:33:36 +0900
commit94b78fd369c318baf1a98d4f510d791ea9f17017 (patch)
treec1f520aa7bb6510bb41124af91d69f55b0afe6b3 /lib/core
parentca2ba809446f2184e50e4b8ebfe607a059c02de6 (diff)
Update Kuksa databroker configuration scheme
Rework Kuksa databroker configuration to also read a configuration yaml file from /etc/xdg/AGL/ics-homescreen.yaml at runtime to allow overriding the built-in default configuration. The latter is left as is with the addition of an explicit disabling of TLS, to still match the internal test setup at ICS. The AGL build will supply a runtime configuration that enables TLS and an authorization token. Additionally: - the ValClientHelper constructor has been changed to take the stub and authorization token as arguments to allow authorization with the VAL API requests. The channel argument has been removed since it is not used, only the stub is. - the apparently unused vss_provider.dart source file has been removed to avoid potential confusion. Bug-AGL: SPEC-4969 Change-Id: Ic7b867eaf565ef22f2e70df0afe7b5272b604d04 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'lib/core')
-rw-r--r--lib/core/constants/val_client_helper.dart10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/core/constants/val_client_helper.dart b/lib/core/constants/val_client_helper.dart
index 0d7a284..02912b0 100644
--- a/lib/core/constants/val_client_helper.dart
+++ b/lib/core/constants/val_client_helper.dart
@@ -1,10 +1,10 @@
import 'package:protos/protos.dart';
class ValClientHelper {
- final ClientChannel channel;
final VALClient stub;
+ final String authorization;
- ValClientHelper({required this.channel, required this.stub});
+ ValClientHelper({required this.stub, required this.authorization});
void setUint32(String path, int value, [bool actuator = true]) async {
var dp = Datapoint()..uint32 = value;
@@ -50,9 +50,9 @@ class ValClientHelper {
var request = SetRequest();
request.updates.add(update);
Map<String, String> metadata = {};
- // if (config.authorization.isNotEmpty) {
- // metadata = {'authorization': "Bearer ${config.authorization}"};
- // }
+ if (authorization.isNotEmpty) {
+ metadata = {'authorization': "Bearer ${authorization}"};
+ }
await stub.set(request, options: CallOptions(metadata: metadata));
}
}