First steps towards adding display variables to config bean
parent
92f5f31dfc
commit
60b679e942
|
@ -34,6 +34,15 @@ public class ConfigurationPropertiesBean {
|
||||||
|
|
||||||
private JWSAlgorithm defaultAlgorithm;
|
private JWSAlgorithm defaultAlgorithm;
|
||||||
|
|
||||||
|
private String adminConsoleTopbarTitle;
|
||||||
|
|
||||||
|
private String logoImageUrl;
|
||||||
|
|
||||||
|
private String adminConsoleCopyrightFooter;
|
||||||
|
|
||||||
|
private String adminConsoleLandingPageText;
|
||||||
|
|
||||||
|
|
||||||
public ConfigurationPropertiesBean() {
|
public ConfigurationPropertiesBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,4 +89,37 @@ public class ConfigurationPropertiesBean {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAdminConsoleTopbarTitle() {
|
||||||
|
return adminConsoleTopbarTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdminConsoleTopbarTitle(String adminConsoleTopbarTitle) {
|
||||||
|
this.adminConsoleTopbarTitle = adminConsoleTopbarTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogoImageUrl() {
|
||||||
|
return logoImageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLogoImageUrl(String logoImageUrl) {
|
||||||
|
this.logoImageUrl = logoImageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAdminConsoleCopyrightFooter() {
|
||||||
|
return adminConsoleCopyrightFooter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdminConsoleCopyrightFooter(String adminConsoleCopyrightFooter) {
|
||||||
|
this.adminConsoleCopyrightFooter = adminConsoleCopyrightFooter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAdminConsoleLandingPageText() {
|
||||||
|
return adminConsoleLandingPageText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdminConsoleLandingPageText(String adminConsoleLandingPageText) {
|
||||||
|
this.adminConsoleLandingPageText = adminConsoleLandingPageText;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ package org.mitre.openid.connect.web;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.mitre.openid.connect.config.ConfigurationPropertiesBean;
|
||||||
import org.mitre.openid.connect.service.StatsService;
|
import org.mitre.openid.connect.service.StatsService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
@ -34,18 +35,31 @@ public class ManagerController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StatsService statsService;
|
private StatsService statsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConfigurationPropertiesBean configBean;
|
||||||
|
|
||||||
@RequestMapping({"", "home", "index"})
|
@RequestMapping({"", "home", "index"})
|
||||||
public String showHomePage(ModelMap m) {
|
public String showHomePage(ModelMap m) {
|
||||||
|
|
||||||
Map<String, Integer> summary = statsService.calculateSummaryStats();
|
Map<String, Integer> summary = statsService.calculateSummaryStats();
|
||||||
|
|
||||||
m.put("statsSummary", summary);
|
m.put("statsSummary", summary);
|
||||||
|
m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle());
|
||||||
|
m.put("landingPageText", configBean.getAdminConsoleLandingPageText());
|
||||||
|
m.put("copyright", configBean.getAdminConsoleCopyrightFooter());
|
||||||
|
m.put("logoUrl", configBean.getLogoImageUrl());
|
||||||
|
|
||||||
return "home";
|
return "home";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping({"about", "about/"})
|
@RequestMapping({"about", "about/"})
|
||||||
public String showAboutPage(ModelMap m) {
|
public String showAboutPage(ModelMap m) {
|
||||||
|
|
||||||
|
m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle());
|
||||||
|
m.put("landingPageText", configBean.getAdminConsoleLandingPageText());
|
||||||
|
m.put("copyright", configBean.getAdminConsoleCopyrightFooter());
|
||||||
|
m.put("logoUrl", configBean.getLogoImageUrl());
|
||||||
|
|
||||||
return "about";
|
return "about";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,20 +69,53 @@ public class ManagerController {
|
||||||
Map<String, Integer> summary = statsService.calculateSummaryStats();
|
Map<String, Integer> summary = statsService.calculateSummaryStats();
|
||||||
|
|
||||||
m.put("statsSummary", summary);
|
m.put("statsSummary", summary);
|
||||||
|
m.put("statsSummary", summary);
|
||||||
|
m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle());
|
||||||
|
m.put("landingPageText", configBean.getAdminConsoleLandingPageText());
|
||||||
|
m.put("copyright", configBean.getAdminConsoleCopyrightFooter());
|
||||||
|
m.put("logoUrl", configBean.getLogoImageUrl());
|
||||||
|
|
||||||
return "stats";
|
return "stats";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping({"contact", "contact/"})
|
@RequestMapping({"contact", "contact/"})
|
||||||
public String showContactPage(ModelMap m) {
|
public String showContactPage(ModelMap m) {
|
||||||
|
|
||||||
|
m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle());
|
||||||
|
m.put("landingPageText", configBean.getAdminConsoleLandingPageText());
|
||||||
|
m.put("copyright", configBean.getAdminConsoleCopyrightFooter());
|
||||||
|
m.put("logoUrl", configBean.getLogoImageUrl());
|
||||||
|
|
||||||
return "contact";
|
return "contact";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasRole('ROLE_USER')") // TODO: this probably shouldn't be here
|
@PreAuthorize("hasRole('ROLE_USER')") // TODO: this probably shouldn't be here
|
||||||
@RequestMapping("manage/**")
|
@RequestMapping("manage/**")
|
||||||
public String showClientManager() {
|
public String showClientManager(ModelMap m) {
|
||||||
// TODO: move view
|
// TODO: move view
|
||||||
|
|
||||||
|
m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle());
|
||||||
|
m.put("landingPageText", configBean.getAdminConsoleLandingPageText());
|
||||||
|
m.put("copyright", configBean.getAdminConsoleCopyrightFooter());
|
||||||
|
m.put("logoUrl", configBean.getLogoImageUrl());
|
||||||
|
|
||||||
return "admin/manage";
|
return "admin/manage";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public StatsService getStatsService() {
|
||||||
|
return statsService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatsService(StatsService statsService) {
|
||||||
|
this.statsService = statsService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfigurationPropertiesBean getConfigBean() {
|
||||||
|
return configBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfigBean(ConfigurationPropertiesBean configBean) {
|
||||||
|
this.configBean = configBean;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,10 @@
|
||||||
<property name="issuer" value="http://localhost/" />
|
<property name="issuer" value="http://localhost/" />
|
||||||
<property name="defaultJwtSigner" value="rsa1"/>
|
<property name="defaultJwtSigner" value="rsa1"/>
|
||||||
<property name="defaultSigningAlgorithmName" value="RS256" />
|
<property name="defaultSigningAlgorithmName" value="RS256" />
|
||||||
|
<property name="adminConsoleCopyrightFooter" value="The MTIRE Corporation" />
|
||||||
|
<property name="adminConsoleLandingPageText" value="Welcome to the MITRE Corporation OpenID Connect Server!" />
|
||||||
|
<property name="logoImageUrl" value="https://id.mitre.org/connect/resources/images/openid_connect_small.png" />
|
||||||
|
<property name="adminConsoleTopbarTitle" value="MITREid Connect" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<%@attribute name="pageName" required="false" %>
|
<%@attribute name="pageName" required="false" %>
|
||||||
|
<%@attribute name="title" required="true" %>
|
||||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||||
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
|
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
|
||||||
<c:choose>
|
<c:choose>
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="brand" href="">OpenID Connect Server</a>
|
<a class="brand" href="">${title}</a>
|
||||||
<div class="nav-collapse collapse">
|
<div class="nav-collapse collapse">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<c:choose>
|
<c:choose>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
|
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
|
||||||
|
|
||||||
<o:header title="welcome"/>
|
<o:header title="welcome"/>
|
||||||
<o:topbar pageName="About"/>
|
<o:topbar title="${topbarTitle}" pageName="About"/>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<o:sidebar/>
|
<o:sidebar/>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
||||||
|
|
||||||
<o:header title="welcome"/>
|
<o:header title="welcome"/>
|
||||||
<o:topbar/>
|
<o:topbar title="${topbarTitle}"/>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<o:sidebar/>
|
<o:sidebar/>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
|
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
|
||||||
|
|
||||||
<o:header title="welcome"/>
|
<o:header title="welcome"/>
|
||||||
<o:topbar pageName="Contact"/>
|
<o:topbar title="${topbarTitle}" pageName="Contact"/>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<o:sidebar/>
|
<o:sidebar/>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
|
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
|
||||||
|
|
||||||
<o:header title="welcome"/>
|
<o:header title="welcome"/>
|
||||||
<o:topbar/>
|
<o:topbar title="${topbarTitle}"/>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<o:sidebar/>
|
<o:sidebar/>
|
||||||
|
|
|
@ -11,7 +11,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
<o:topbar/>
|
<o:topbar title="${topbarTitle}"/>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<h1>Login with Username and Password</h1>
|
<h1>Login with Username and Password</h1>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
||||||
|
|
||||||
<o:header title="Approve Access"/>
|
<o:header title="Approve Access"/>
|
||||||
<o:topbar/>
|
<o:topbar title="${topbarTitle}"/>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<% if (session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) != null && !(session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) instanceof UnapprovedClientAuthenticationException)) { %>
|
<% if (session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) != null && !(session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) instanceof UnapprovedClientAuthenticationException)) { %>
|
||||||
<div class="alert-message error">
|
<div class="alert-message error">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
|
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
|
||||||
|
|
||||||
<o:header title="welcome"/>
|
<o:header title="welcome"/>
|
||||||
<o:topbar pageName="Statistics"/>
|
<o:topbar title="${topbarTitle}" pageName="Statistics"/>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<o:sidebar/>
|
<o:sidebar/>
|
||||||
|
|
Loading…
Reference in New Issue