From edb2e3feccc3d656ec3716c2a9940979ed6eb49b Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Tue, 9 Nov 2021 19:47:54 -0800 Subject: [PATCH] config: Add simple device config schema --- src/config/device.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/config/device.ts diff --git a/src/config/device.ts b/src/config/device.ts new file mode 100644 index 0000000..eb2370b --- /dev/null +++ b/src/config/device.ts @@ -0,0 +1,18 @@ +import * as YAML from 'yaml' + +export interface DeviceInfo { + name: string + vendor: string +} + +export interface DeviceConfig { + device: DeviceInfo + namespaces?: Array + sepolicy_dirs: Array + includes: Array + filters: { [name: string]: Array } +} + +export function parseDeviceConfig(config: string) { + return YAML.parse(config) as DeviceConfig +}