diff --git a/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/config/CustomerLoginSecurityConfiguration.java b/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/config/CustomerLoginSecurityConfiguration.java index 5c6225279..43ec7ef15 100644 --- a/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/config/CustomerLoginSecurityConfiguration.java +++ b/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/config/CustomerLoginSecurityConfiguration.java @@ -96,6 +96,7 @@ public SecurityFilterChain customerLoginSecurityFilterChain( RequestMatcher matcher = new OrRequestMatcher( pp.matcher("/"), pp.matcher("/home"), + pp.matcher("/about"), pp.matcher("/login"), pp.matcher("/logout"), pp.matcher("/custodian/**"), @@ -111,7 +112,8 @@ public SecurityFilterChain customerLoginSecurityFilterChain( // session-stored token. Right shape for vanilla form login. .csrf(Customizer.withDefaults()) .authorizeHttpRequests(authz -> authz - .requestMatchers(pp.matcher("/"), pp.matcher("/home"), pp.matcher("/login")).permitAll() + .requestMatchers(pp.matcher("/"), pp.matcher("/home"), pp.matcher("/about"), + pp.matcher("/login")).permitAll() .anyRequest().authenticated()) .formLogin(form -> form .loginPage("/login") diff --git a/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/web/AboutController.java b/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/web/AboutController.java new file mode 100644 index 000000000..ce6a34c21 --- /dev/null +++ b/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/web/AboutController.java @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2025 Green Button Alliance, Inc. + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.greenbuttonalliance.espi.datacustodian.web; + +import org.springframework.boot.SpringBootVersion; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Public "About" page (#175). Replaces the legacy about.jsp build-info table with a small, + * non-sensitive summary of the running implementation. Public (footer-linked from every page, + * including the anonymous login page). + */ +@Controller +public class AboutController { + + @GetMapping("/about") + public String about(Model model) { + Map info = new LinkedHashMap<>(); + String version = AboutController.class.getPackage().getImplementationVersion(); + info.put("Implementation", "OpenESPI Green Button Data Custodian"); + info.put("Version", version != null ? version : "(development build)"); + info.put("Java version", System.getProperty("java.version", "—")); + info.put("Spring Boot version", SpringBootVersion.getVersion()); + model.addAttribute("info", info); + return "about"; + } +} diff --git a/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/web/custodian/RetailCustomerController.java b/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/web/custodian/RetailCustomerController.java index f3061d0b1..022eb053f 100644 --- a/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/web/custodian/RetailCustomerController.java +++ b/openespi-datacustodian/src/main/java/org/greenbuttonalliance/espi/datacustodian/web/custodian/RetailCustomerController.java @@ -138,6 +138,12 @@ public String update(@PathVariable Long retailCustomerId, existing.setUsername(form.getUsername()); existing.setFirstName(form.getFirstName()); existing.setLastName(form.getLastName()); + if (form.getRole() != null && !form.getRole().isBlank()) { + existing.setRole(form.getRole()); + } + // Checkbox bound via th:field renders a hidden field, so a non-null value always arrives; + // default to enabled if somehow absent. + existing.setEnabled(form.getEnabled() != null ? form.getEnabled() : Boolean.TRUE); if (form.getPassword() != null && !form.getPassword().isBlank()) { existing.setPassword(customerPasswordEncoder.encode(form.getPassword())); } diff --git a/openespi-datacustodian/src/main/resources/templates/about.html b/openespi-datacustodian/src/main/resources/templates/about.html new file mode 100644 index 000000000..7f95c0116 --- /dev/null +++ b/openespi-datacustodian/src/main/resources/templates/about.html @@ -0,0 +1,34 @@ + + + + About - Green Button Data Custodian + + + + + +
+

About

+

+ A reference implementation of the NAESB ESPI (Green Button) Data Custodian, maintained by the + Green Button Alliance. +

+ +
+
+ + + + + + + +
Keyvalue
+
+
+ +
+
+
+ + diff --git a/openespi-datacustodian/src/main/resources/templates/custodian/home.html b/openespi-datacustodian/src/main/resources/templates/custodian/home.html index ad9252567..4b5703f0e 100644 --- a/openespi-datacustodian/src/main/resources/templates/custodian/home.html +++ b/openespi-datacustodian/src/main/resources/templates/custodian/home.html @@ -131,7 +131,5 @@

0

- - \ No newline at end of file diff --git a/openespi-datacustodian/src/main/resources/templates/custodian/retailcustomers/form.html b/openespi-datacustodian/src/main/resources/templates/custodian/retailcustomers/form.html index 844293aa9..8171c654e 100644 --- a/openespi-datacustodian/src/main/resources/templates/custodian/retailcustomers/form.html +++ b/openespi-datacustodian/src/main/resources/templates/custodian/retailcustomers/form.html @@ -8,7 +8,7 @@
-

Retail Customer

+

User Account

@@ -34,6 +34,18 @@

Last name error

+
+ + +
+
+ + +

Retail Customers

- Add new customer + Add user
diff --git a/openespi-datacustodian/src/main/resources/templates/error.html b/openespi-datacustodian/src/main/resources/templates/error.html index c588b3947..c036dacdf 100644 --- a/openespi-datacustodian/src/main/resources/templates/error.html +++ b/openespi-datacustodian/src/main/resources/templates/error.html @@ -34,7 +34,7 @@
Error Details:
- Go Home + Go Home
@@ -43,11 +43,5 @@
Error Details:
- - - - - - \ No newline at end of file diff --git a/openespi-datacustodian/src/main/resources/templates/error/400.html b/openespi-datacustodian/src/main/resources/templates/error/400.html index e94e2aef9..9da95f400 100644 --- a/openespi-datacustodian/src/main/resources/templates/error/400.html +++ b/openespi-datacustodian/src/main/resources/templates/error/400.html @@ -19,7 +19,7 @@

Bad Request

The request could not be understood by the server due to malformed syntax.

- Go Home + Go Home
@@ -27,11 +27,5 @@

Bad Request

- - - - - - \ No newline at end of file diff --git a/openespi-datacustodian/src/main/resources/templates/error/403.html b/openespi-datacustodian/src/main/resources/templates/error/403.html index 7f460e45a..42ecf2e99 100644 --- a/openespi-datacustodian/src/main/resources/templates/error/403.html +++ b/openespi-datacustodian/src/main/resources/templates/error/403.html @@ -19,8 +19,8 @@

Access Forbidden

You don't have permission to access this resource. Please contact your administrator if you believe this is an error.

- Go Home - Login + Go Home + Login
@@ -28,11 +28,5 @@

Access Forbidden

- - - - - - \ No newline at end of file diff --git a/openespi-datacustodian/src/main/resources/templates/fragments/layout.html b/openespi-datacustodian/src/main/resources/templates/fragments/layout.html index 2552fad5f..05a9510e8 100644 --- a/openespi-datacustodian/src/main/resources/templates/fragments/layout.html +++ b/openespi-datacustodian/src/main/resources/templates/fragments/layout.html @@ -17,6 +17,11 @@ + + + @@ -36,8 +41,11 @@ - + + @@ -76,20 +84,31 @@ @@ -109,6 +128,9 @@ @@ -152,9 +181,7 @@

- About | - Terms of Service | - Usage Policy + About

diff --git a/openespi-datacustodian/src/main/resources/templates/home.html b/openespi-datacustodian/src/main/resources/templates/home.html index c2f5f9a6f..a6816bdd8 100644 --- a/openespi-datacustodian/src/main/resources/templates/home.html +++ b/openespi-datacustodian/src/main/resources/templates/home.html @@ -14,10 +14,10 @@

Welcome to the The Green Button Alliance has, with the support of the open source community, prepared a reference Green Button Data Custodian implementation. This implementation supports a full complement of Green Button facilities and, as an - Open Source project, is freely available for download by any interested parties. + Open Source project, is freely available for download by any interested parties.

@@ -76,7 +76,5 @@

API Reference

- - \ No newline at end of file