You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
impl: prompt user for allowing unverified binaries to run
This happens in the following cases:
- if the deployment did not have any signatures and user decided to fallback on
releases.coder.com but the fallback did not have any signature or we failed to download it.
- similarly if the user does not want to fallback we still ask him if he wants to run the
unverified cli
// if we could still not download it, ask the user if he accepts the risk
193
+
if (signatureResult.isNotDownloaded()) {
194
+
val acceptsUnsignedBinary = context.ui.showYesNoPopup(
195
+
context.i18n.ptrl("Security Warning"),
196
+
context.i18n.pnotr("Could not fetch any signatures for ${cliResult.source} from releases.coder.com. Would you like to run it anyway?"),
197
+
context.i18n.ptrl("Accept"),
198
+
context.i18n.ptrl("Abort"),
199
+
)
200
+
201
+
if (acceptsUnsignedBinary) {
202
+
downloader.commit()
203
+
returntrue
204
+
} else {
205
+
throwUnsignedBinaryExecutionDeniedException("Running unsigned CLI from ${cliResult.source} was denied by the user")
206
+
}
210
207
} else {
211
-
throwUnsignedBinaryExecutionDeniedException("Running unsigned CLI from ${cliResult.source} was denied by the user")
208
+
// we could not fetch signatures from releases.coder.com
209
+
// so we will ask the user if he wants to continue
210
+
val acceptsUnsignedBinary = context.ui.showYesNoPopup(
211
+
context.i18n.ptrl("Security Warning"),
212
+
context.i18n.pnotr("No signatures were found for ${cliResult.source} and fallback to releases.coder.com is not allowed. Would you like to run it anyway?"),
213
+
context.i18n.ptrl("Accept"),
214
+
context.i18n.ptrl("Abort"),
215
+
)
216
+
217
+
if (acceptsUnsignedBinary) {
218
+
downloader.commit()
219
+
returntrue
220
+
} else {
221
+
throwUnsignedBinaryExecutionDeniedException("Running unsigned CLI from ${cliResult.source} was denied by the user")
0 commit comments