-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into winstone-with-jetty-12
- Loading branch information
Showing
154 changed files
with
1,832 additions
and
984 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package jenkins; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.Filter; | ||
import javax.servlet.FilterChain; | ||
import javax.servlet.FilterConfig; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
import jenkins.model.Jenkins; | ||
import org.kohsuke.accmod.Restricted; | ||
import org.kohsuke.accmod.restrictions.NoExternalUse; | ||
import org.springframework.security.core.Authentication; | ||
|
||
/** | ||
* Record the current user authentication for later impersonation if the response is 404 Not Found. | ||
* | ||
* @see Jenkins#generateNotFoundResponse(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse) | ||
*/ | ||
@Restricted(NoExternalUse.class) | ||
public class ErrorAttributeFilter implements Filter { | ||
|
||
public static final String USER_ATTRIBUTE = "jenkins.ErrorAttributeFilter.user"; | ||
|
||
@Override | ||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { | ||
final Authentication authentication = Jenkins.getAuthentication2(); | ||
servletRequest.setAttribute(USER_ATTRIBUTE, authentication); | ||
filterChain.doFilter(servletRequest, servletResponse); | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
// Otherwise the PCT fails | ||
} | ||
|
||
@Override | ||
public void init(FilterConfig filterConfig) throws ServletException { | ||
// Otherwise the PCT fails | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
core/src/main/java/jenkins/appearance/AppearanceCategory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2023, Tim Jacomb | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package jenkins.appearance; | ||
|
||
import hudson.Extension; | ||
import jenkins.model.GlobalConfigurationCategory; | ||
|
||
/** | ||
* <p>Global configuration of appearance configuration.</p> | ||
* | ||
* <p>This should be used for Plugins that contribute to the look and feel of Jenkins. | ||
* Theming, header and footer changes, information density are all good examples. | ||
* API plugins for UI components that are used by other plugins also fit into that, e.g. source code display.</p> | ||
* | ||
* <p>Configuration specific to a single plugin that is not related to the overall look and feel of Jenkins may not belong here.</p> | ||
* | ||
* <p>If a plugin has a single global configuration it should separate appearance and general configuration to different classes.</p> | ||
* | ||
*/ | ||
@Extension | ||
public class AppearanceCategory extends GlobalConfigurationCategory { | ||
@Override | ||
public String getShortDescription() { | ||
return Messages.AppearanceCategory_DisplayName(); | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return Messages.AppearanceCategory_Description(); | ||
} | ||
} |
Oops, something went wrong.