Permalink
Show file tree
Hide file tree
29 changes: 27 additions & 2 deletions
29
hawtio-karaf-terminal/src/main/java/io/hawt/web/plugin/karaf/terminal/TerminalServlet.java
6 changes: 2 additions & 4 deletions
6
hawtio-system/src/main/java/io/hawt/web/AuthenticationFilter.java
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Ensure we secure hawtio-karaf-terminal's /term context
- Loading branch information
Showing
7 changed files
with
123 additions
and
11 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
38 changes: 38 additions & 0 deletions
38
...erminal/src/main/java/io/hawt/web/plugin/karaf/terminal/KarafTerminalContextListener.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,38 @@ | ||
| package io.hawt.web.plugin.karaf.terminal; | ||
|
|
||
| import io.hawt.system.ConfigManager; | ||
|
|
||
| import javax.servlet.ServletContextEvent; | ||
| import javax.servlet.ServletContextListener; | ||
|
|
||
| /** | ||
| * @author Stan Lewis | ||
| */ | ||
| public class KarafTerminalContextListener implements ServletContextListener { | ||
|
|
||
| private ConfigManager configManager = new ConfigManager(); | ||
|
|
||
| @Override | ||
| public void contextInitialized(ServletContextEvent sce) { | ||
| try { | ||
| configManager.init(); | ||
| } catch (Exception e) { | ||
| throw createServletException(e); | ||
| } | ||
| sce.getServletContext().setAttribute("ConfigManager", configManager); | ||
| } | ||
|
|
||
| @Override | ||
| public void contextDestroyed(ServletContextEvent sce) { | ||
| try { | ||
| configManager.destroy(); | ||
| } catch (Exception e) { | ||
| throw createServletException(e); | ||
| } | ||
|
|
||
| } | ||
| protected RuntimeException createServletException(Exception e) { | ||
| return new RuntimeException(e); | ||
| } | ||
|
|
||
| } |
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