From d786396356dfca5de8a8ef194580e88cfacc807e Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 19 Apr 2020 01:19:15 +0200 Subject: [PATCH] Indicate which plugin provides an UnprotectedRootAction --- .../LegacySecurityRealm/config.groovy | 31 ++++++++++++++++ .../security/LegacySecurityRealm/config.jelly | 36 ------------------- .../LegacySecurityRealm/config.properties | 2 ++ 3 files changed, 33 insertions(+), 36 deletions(-) create mode 100644 core/src/main/resources/hudson/security/LegacySecurityRealm/config.groovy delete mode 100644 core/src/main/resources/hudson/security/LegacySecurityRealm/config.jelly diff --git a/core/src/main/resources/hudson/security/LegacySecurityRealm/config.groovy b/core/src/main/resources/hudson/security/LegacySecurityRealm/config.groovy new file mode 100644 index 0000000000..f0018ae90f --- /dev/null +++ b/core/src/main/resources/hudson/security/LegacySecurityRealm/config.groovy @@ -0,0 +1,31 @@ +package hudson.security.LegacySecurityRealm + +import hudson.PluginWrapper +import hudson.model.UnprotectedRootAction +import jenkins.model.Jenkins + +def f = namespace(lib.FormTagLib) + +f.entry(title: _('Unprotected URLs')) { + p(_('blurb')) + ul { + for (def action : Jenkins.get().getActions().sort { x, y -> x.getUrlName() <=> y.getUrlName() }) { + if (action instanceof UnprotectedRootAction) { + li { + a(href: '../' + action.getUrlName(), target: '_blank') { + code { + text(action.getUrlName()) + } + } + br() + PluginWrapper whichPlugin = Jenkins.get().getPluginManager().whichPlugin(action.getClass()) + if (whichPlugin == null) { + text(_("byCore")) + } else { + raw(_("byPlugin", whichPlugin.getDisplayName(), whichPlugin.getUrl())) + } + } + } + } + } +} diff --git a/core/src/main/resources/hudson/security/LegacySecurityRealm/config.jelly b/core/src/main/resources/hudson/security/LegacySecurityRealm/config.jelly deleted file mode 100644 index 4f922828be..0000000000 --- a/core/src/main/resources/hudson/security/LegacySecurityRealm/config.jelly +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - -

${%blurb}

- -
-
diff --git a/core/src/main/resources/hudson/security/LegacySecurityRealm/config.properties b/core/src/main/resources/hudson/security/LegacySecurityRealm/config.properties index 036c412b21..575f71f75d 100644 --- a/core/src/main/resources/hudson/security/LegacySecurityRealm/config.properties +++ b/core/src/main/resources/hudson/security/LegacySecurityRealm/config.properties @@ -23,3 +23,5 @@ blurb=\ These URLs (and URLs starting with these prefixes plus a /) should require no authentication. \ If possible, configure your container to pass these requests straight to Jenkins without requiring login. +byCore=(provided by Jenkins core) +byPlugin=(provided by {0})