Add inline security warnings to installed plugins list

This commit is contained in:
Daniel Beck committed 2020-03-07 19:15:27 +01:00
1 parent 4a30dddd58
commit 665bc4deea
3 files changed
+16

No files matched your search

@@ -36,6 +36,7 @@ import hudson.util.VersionNumber;
import io.jenkins.lib.versionnumber.JavaSpecificationVersion;
import jenkins.YesNoMaybe;
import jenkins.model.Jenkins;
import jenkins.security.UpdateSiteWarningsMonitor;
import jenkins.util.java.JavaUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.LogFactory;
@@ -1263,6 +1264,10 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
return HttpResponses.redirectViaContextPath("/pluginManager/installed"); // send back to plugin manager
}
@Restricted(DoNotUse.class) // Jelly
public List<UpdateSite.Warning> getActiveWarnings() {
return ExtensionList.lookupSingleton(UpdateSiteWarningsMonitor.class).getActivePluginWarningsByPlugin().getOrDefault(this, Collections.emptyList());
}
private static final Logger LOGGER = Logger.getLogger(PluginWrapper.class.getName());