File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
core/src/main/resources/hudson/security/csrf/GlobalCrumbIssuerConfiguration Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 11package hudson.security.csrf.GlobalCrumbIssuerConfiguration
22
33import hudson.security.csrf.CrumbIssuer
4+ import hudson.security.csrf.DefaultCrumbIssuer
45
5- def f= namespace(lib.FormTagLib )
6+ def f = namespace(lib.FormTagLib )
67def all = CrumbIssuer . all()
8+ def disableCsrf =
9+ hudson.security.csrf.GlobalCrumbIssuerConfiguration . DISABLE_CSRF_PROTECTION
710
8- if (! all. isEmpty()) {
11+ def onlyDefaultIssuer =
12+ all. size() == 1 && all[0 ]. clazz == DefaultCrumbIssuer
13+
14+ def showCsrfConfig = ! onlyDefaultIssuer || disableCsrf
15+
16+ if (showCsrfConfig) {
917 f. section(title : _(" CSRF Protection" )) {
10- if (hudson.security.csrf.GlobalCrumbIssuerConfiguration . DISABLE_CSRF_PROTECTION ) {
18+ if (disableCsrf ) {
1119 f. entry {
1220 p(raw(_(' disabled' )))
1321 p(_(' unsupported' ))
1422 }
1523 } else {
16- f. dropdownDescriptorSelector(title : _(" Crumb Issuer" ), descriptors : all, field : ' crumbIssuer' )
24+ f. dropdownDescriptorSelector(
25+ title : _(" Crumb Issuer" ),
26+ descriptors : all,
27+ field : ' crumbIssuer'
28+ )
1729 }
1830 }
1931}
You can’t perform that action at this time.
0 commit comments