Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/LOCAL_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Logs go to `.local-run/<app>.log`. Run the smoke check before testing by hand; i
| AS admin | `admin` / `admin` at http://localhost:9999/login | A passkey is enrolled at first login (`/webauthn/register`), by design. Override with `ESPI_BOOTSTRAP_ADMIN_USERNAME` / `ESPI_BOOTSTRAP_ADMIN_PASSWORD_HASH`. |
| DC admin | `admin` / `admin` | Sandbox custodian user (dev/test profiles only). |
| DC customer | `customer` / `customer` | Owns the sample UsagePoint (see "Sample data"). `local` profile only. |
| TP user | *not yet* | TP username/password login: #249. |
| TP admin | `admin` / `admin` at http://localhost:8082/ThirdParty/login | TP administrator (`ROLE_CUSTODIAN`); also opens the H2 console at `/ThirdParty/h2-console/`. `local` profile only. |
| TP customer | `customer` / `customer` | TP customer (`ROLE_USER`); sees the Data Access Authorization cards. `local` profile only. |

## OAuth clients (AS)

Expand Down
6 changes: 4 additions & 2 deletions openespi-common/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
# Spring Boot 3.5 Default Configuration for OpenESPI-Common
# Copyright (c) 2018-2026 Green Button Alliance, Inc.

# Default Profile Configuration
spring.profiles.active=${SPRING_PROFILES_ACTIVE:dev-mysql}
# No spring.profiles.active here, for the same reason as spring.application.name below: this
# .properties file wins over each application's own application.yml at the same location, so it
# silently overrode the default profile the Data Custodian and Third Party choose (#267: the TP's
# default `local` still started as dev-mysql). Each application sets its default in application.yml.

# No spring.application.name here: this file ships inside the jar and, being .properties, would
# override the name each application sets in its own application.yml (it tagged every DC/TP metric
Expand Down
30 changes: 25 additions & 5 deletions openespi-thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,35 @@ mvn tomcat7:run
Now the application should be available at [http://localhost:9000/](http://localhost:9000/).


## Building
## Building and running (monorepo)
```bash
# for the default test profile
mvn clean install
# From the repository root: build the Third Party and the modules it depends on
mvn clean install -pl openespi-thirdparty -am

# Run it. The Spring profile is chosen at run time, not with mvn -P:
cd openespi-thirdparty
mvn spring-boot:run # local (default): in-memory H2, no database server
mvn spring-boot:run -Dspring-boot.run.profiles=dev-mysql # MySQL on localhost:3306 (database thirdparty, user espi)
mvn spring-boot:run -Dspring-boot.run.profiles=dev-postgresql # PostgreSQL on localhost:5432 (database thirdparty, user espi)
```

In every profile Flyway creates the schema from the openespi-common scripts (`db/migration` plus
`db/vendor/{h2,mysql,postgres}`), and Hibernate only validates it (`ddl-auto: validate`).

**Existing MySQL or PostgreSQL database from before #267:** Hibernate built it, so Flyway refuses it
(or fails on V1's tables). Drop and recreate it once, then start the Third Party:

# or for a specific profile
mvn -P <profile name> -Dmaven.test.skip=true clean install
```bash
# MySQL (the espi user's grants on thirdparty.* survive the drop)
mysql -u root -p -e "DROP DATABASE IF EXISTS thirdparty; CREATE DATABASE thirdparty;"
# PostgreSQL
dropdb --if-exists thirdparty; createdb -O espi thirdparty
```

The `local` profile listens on `127.0.0.1` only: it seeds published DEV ONLY accounts (`admin`/`admin`,
`customer`/`customer`) and enables the H2 console. To reach the Third Party from another machine or
from outside a container, use `dev-mysql` or `dev-postgresql`.


## IDE Setup

Expand Down
Loading
Loading