Gate the USB kiosk the same way, and make an unreachable setting a test failure
The USB kiosk had a feature flag and nothing else. A flag is a decision, not a credential: with the kiosk on, anyone who could reach the app could move a drive between checked-out and checked-in and sign it with a badge they guessed. Same reasoning that closed the parts kiosk, smaller blast radius - which is why Darkwing did not raise it and why it was worth asking about anyway. Both kiosks now share one mechanism. The device token moved out of the printedparts api wrapper into a request interceptor that attaches X-Kiosk-Token by URL prefix, with one localStorage key per kiosk - they are separate screens in separate rooms, and a shared token would mean provisioning one grants the other. claimKioskToken() is shared too, so both views take the token from a ?token= URL once and strip it from the address bar identically. Then the part that matters more than either fix. I told you to set the new settings in the UI, and that was impossible: every plugin settings page carries a hardcoded key list, and nothing had added them. printedparts_kiosk_enabled, printedparts_kiosk_token and usb_kiosk_token were declared, seeded and read correctly, and rendered by no page - changeable only by writing SQL. tests/test_plugin_settings_reachable.py now fails when any declared setting appears nowhere in its plugin's frontend. It found seven MORE that were already in that state, all pre-existing: collector_corporate_ranges computers_configpolicies_enabled computers_machinelink_alerts computers_quietreporthours geenforce_reportstaleminutes printers_dashboardpercent warranty_expiringdays All seven now have fields. I first parked them in a KNOWN_GAPS ratchet, then fixed them and deleted the ratchet - a backlog list in a new check is a way of agreeing the check does not apply yet. There is no backlog; the check is absolute. Two of my own mistakes on the way, both caught by tests rather than by reading: the blanket rename of the USB guard also rewrote the call inside _kiosk_open, so it called itself until the stack ran out; and the first version of the reachable check skipped all 17 plugins because it looked for get_settings() when the method is get_settings_defaults() - it passed by testing nothing, which is the exact shape it exists to catch. Suite 2336, frontend 316, build clean. Scope: product
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
<template>
|
||||
<div class="geenforce-settings">
|
||||
<h2>Reporting</h2>
|
||||
<p class="muted">
|
||||
How long a bay may go without posting an enforcement report before the
|
||||
fleet view calls it stale.
|
||||
</p>
|
||||
<label class="field-label" for="stale">Stale after (minutes)</label>
|
||||
<input id="stale" type="number" min="1" class="cidr-input"
|
||||
v-model.number="staleminutes" @blur="saveStale">
|
||||
<small class="input-hint">
|
||||
Default 30. A bay enforces on its own cycle, so set this above the cycle
|
||||
length or every bay reads as stale between runs.
|
||||
</small>
|
||||
|
||||
<h2>Client Access</h2>
|
||||
<p class="muted">
|
||||
Fleet PCs on a trusted network can reach the GE-Enforce client endpoints
|
||||
@@ -40,9 +53,12 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '@/api'
|
||||
import api, { settingsApi } from '@/api'
|
||||
|
||||
const cidrs = ref('')
|
||||
// Held here rather than in /geenforce/config: that endpoint owns the CIDR
|
||||
// allowlist, and this is an ordinary site setting.
|
||||
const staleminutes = ref(30)
|
||||
const saving = ref(false)
|
||||
const message = ref('')
|
||||
const ok = ref(false)
|
||||
@@ -57,6 +73,23 @@ async function load() {
|
||||
message.value = 'Could not load config.'
|
||||
ok.value = false
|
||||
}
|
||||
try {
|
||||
const setting = unwrap(await settingsApi.get('geenforce_reportstaleminutes'))
|
||||
staleminutes.value = Number(setting?.value ?? 30) || 30
|
||||
} catch (e) {
|
||||
staleminutes.value = 30
|
||||
}
|
||||
}
|
||||
|
||||
async function saveStale() {
|
||||
try {
|
||||
await settingsApi.update('geenforce_reportstaleminutes', String(staleminutes.value))
|
||||
ok.value = true
|
||||
message.value = 'Saved.'
|
||||
} catch (e) {
|
||||
ok.value = false
|
||||
message.value = e?.response?.data?.data?.error?.message || 'Save failed.'
|
||||
}
|
||||
}
|
||||
|
||||
async function save() {
|
||||
|
||||
Reference in New Issue
Block a user