Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public enum Permission implements GrantedAuthority {

/** Recoverable, no data egress: chrome.reload, config.refresh. */
BOARD_COMMAND_BENIGN(Authority.BOARD_COMMAND_BENIGN),
/** Takes a physical display down: kiosk.restart, system.reboot. */
/** Takes a physical display down: kiosk.restart, system.reboot, update.install_now. */
BOARD_COMMAND_DISRUPTIVE(Authority.BOARD_COMMAND_DISRUPTIVE),
/** Data egress: chrome.screenshot returns an image of a screen in a prayer space; logs.tail leaks internals. */
BOARD_COMMAND_INSPECT(Authority.BOARD_COMMAND_INSPECT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public enum CommandKind {

KIOSK_RESTART("kiosk.restart", CommandRisk.DISRUPTIVE),
SYSTEM_REBOOT("system.reboot", CommandRisk.DISRUPTIVE),
/** Takes the board off its content for the update screen, and may restart the agent. */
UPDATE_INSTALL_NOW("update.install_now", CommandRisk.DISRUPTIVE),

CHROME_SCREENSHOT("chrome.screenshot", CommandRisk.INSPECT),
LOGS_TAIL("logs.tail", CommandRisk.INSPECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
@JsonSubTypes.Type(value = SystemRebootPayload.class, name = "system.reboot"),
@JsonSubTypes.Type(value = ConfigRefreshPayload.class, name = "config.refresh"),
@JsonSubTypes.Type(value = LogsTailPayload.class, name = "logs.tail"),
@JsonSubTypes.Type(value = UpdateInstallNowPayload.class, name = "update.install_now"),
})
public sealed interface CommandPayload
permits ChromeReloadPayload, ChromeScreenshotPayload, KioskRestartPayload,
SystemRebootPayload, ConfigRefreshPayload, LogsTailPayload {
SystemRebootPayload, ConfigRefreshPayload, LogsTailPayload, UpdateInstallNowPayload {

String kind();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.ibrasoft.lensbridge.model.board.commands;

/**
* Check the release channels and install a new board app or agent now, instead of in the
* board's nightly install window. The board shows its update screen while it installs, and
* an agent update restarts the agent.
*/
public record UpdateInstallNowPayload() implements CommandPayload {
@Override public String kind() { return "update.install_now"; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ void reloadAndConfigRefreshAreBenign() {
}

@Test
void restartAndRebootAreDisruptive() {
void restartRebootAndUpdateNowAreDisruptive() {
assertThat(CommandKind.KIOSK_RESTART.getRisk()).isEqualTo(CommandRisk.DISRUPTIVE);
assertThat(CommandKind.SYSTEM_REBOOT.getRisk()).isEqualTo(CommandRisk.DISRUPTIVE);
assertThat(CommandKind.UPDATE_INSTALL_NOW.getRisk()).isEqualTo(CommandRisk.DISRUPTIVE);
}

/** Both return device-side data to the caller. Neither may ride along with a reboot grant. */
Expand Down
Loading