Skip to content

chore(#119): defer ESPI resource CRUD writes — delete write/admin controllers#166

Merged
dfcoffin merged 1 commit into
mainfrom
chore/119-defer-resource-crud-writes
Jun 5, 2026
Merged

chore(#119): defer ESPI resource CRUD writes — delete write/admin controllers#166
dfcoffin merged 1 commit into
mainfrom
chore/119-defer-resource-crud-writes

Conversation

@dfcoffin
Copy link
Copy Markdown
Contributor

@dfcoffin dfcoffin commented Jun 5, 2026

Part of the #119 canonical build plan (GET-first resource surface). Per direction, the ESPI resource POST/PUT/DELETE endpoints are admin/sandbox-DB-management APIs — a secondary, separately-scheduled track — so existing resource write controllers are removed and the surface is honestly GET-only until that track is scheduled.

Deleted (write/admin .disabled resource controllers)

AuthorizationRESTController, BatchRESTController, CustomerAccountRESTController, ManageRESTController (DB reset/init), RetailCustomerRESTController, TimeConfigurationRESTController (.java.disabled).

Stripped to GET-only (POST/PUT/DELETE removed + their tests)

ApplicationInformationRESTController, CustomerRESTController, CustomerAccountRESTController. The customer-PII FB-scope gating tests (#157) are retained.

Deliberately KEPT (not ESPI resource CRUD)

SubscriptionProvisioningController (the #150 AS↔DC back-channel), AuthorizeScreenController (customer consent flow), the DC web-portal MVC controllers, and ServiceStatusRESTController.disabled (GET-only status — rebuilt in plan Phase A1).

Note: the custodian portal tools UploadController/AssociateUsagePointController (sandbox-DB upload/associate via MVC, not ESPI REST CRUD) were kept. Say if you want those removed too.

The GET resource surface + subscription scoping is rebuilt on the generic base controller per the #119 canonical build plan.

Verified locally: DC module test-compiles; the three GET-only controller tests pass.

🤖 Generated with Claude Code

…trollers

Per the #119 canonical build plan, the DC ESPI resource surface is GET-first; the
POST/PUT/DELETE endpoints are admin/sandbox-DB-management APIs and are a secondary,
separately-scheduled track. Remove the existing resource write controllers/methods so
the surface is honestly GET-only until that track is scheduled.

Deleted (write/admin .disabled resource controllers):
- AuthorizationRESTController, BatchRESTController, CustomerAccountRESTController,
  ManageRESTController (DB reset/init), RetailCustomerRESTController,
  TimeConfigurationRESTController (.java.disabled)

Stripped POST/PUT/DELETE (now GET-only) + their tests:
- ApplicationInformationRESTController, CustomerRESTController, CustomerAccountRESTController

Kept (NOT ESPI resource CRUD): SubscriptionProvisioningController (#150 back-channel),
AuthorizeScreenController (customer consent flow), the DC web-portal MVC controllers,
and ServiceStatusRESTController.disabled (GET-only, rebuilt in plan Phase A1).

The customer-PII FB-scope gating tests (#157) are retained. GET surface + scoping is
rebuilt on the generic base controller in the #119 build plan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfcoffin dfcoffin merged commit 86b9fc1 into main Jun 5, 2026
4 checks passed
@dfcoffin dfcoffin deleted the chore/119-defer-resource-crud-writes branch June 5, 2026 22:27
dfcoffin added a commit that referenced this pull request Jun 7, 2026
…link fixes (#174)

* fix(#173): re-activate Data Custodian admin portal + fix navbar contrast/links

The custodian dashboard rendered but every action card 404'd, the top menu
bar was unreadable, and post-login flows broke. Root causes and fixes:

UI / navigation
- Navbar contrast: custodianHeader was navbar-dark on light amber (white-on-amber,
  unreadable) -> bg-warning + data-bs-theme="light" (dark-on-amber).
- 404s: dashboard cards + nav links were host-absolute (/custodian/...), bypassing
  the /DataCustodian context path -> converted to context-relative th:href=@{...},
  including the head CSS/favicon links.
- Dashboard cards equal height (h-100 + flex) so "Upload Data" matches the others.
- Removed the dead "My Usage Points" nav item (customer portal not yet migrated).

Re-activated / added controllers (all GET/read-first; CRUD writes still deferred #166)
- HomeController ("/","/home"), CustodianHomeController ("/custodian"+"/custodian/home",
  dashboard stat tiles), UploadController re-enabled, new OAuthTokenController
  (read-only authorization-grant table) and SettingsController (read-only system info,
  no DB-management actions). Normalized RetailCustomerController view names and added
  edit/update/delete (password optional on edit; graceful duplicate/FK handling).
- RetailCustomerService.deleteById.
- Ported legacy portal templates to Thymeleaf + Bootstrap 5.

Security / serving
- WebSecurityCustomizer ignores static resources; explicit /css,/js,/images resource
  handlers (needed because @EnableWebMvc disables Boot's defaults).
- Session/form-login chain now owns the UI surface ("/","/home"); /error permitted so
  controller errors render an error page instead of a misleading 401.
- Role-aware post-login landing: custodians -> /custodian/home, others -> /.
- Logout converted to CSRF POST (Spring Security logout is POST-only).
- Thymeleaf 3.1 forbids dynamic th:on* handlers -> static onsubmit confirms.

Verified end-to-end: login, all dashboard cards/nav (200), retail-customer
create/edit/update/delete, OAuth tokens, upload, settings, customer login landing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(#173): customer self-service authorizations portal + fix landing test

A retail customer (ROLE_USER) logging in now lands on a self-service page
(/customer/authorizations) listing the third-party authorizations granted
against their data, with a Revoke action per authorization, instead of the
generic home page.

- CustomerAuthorizationController: GET /customer[/home|/authorizations] lists the
  current customer's authorizations (resolved by username; @transactional + flat
  view records since OSIV is off); POST /customer/authorizations/{id}/revoke sets
  status=REVOKED, ownership-checked so a customer can only revoke their own.
- Session/form-login chain now owns /customer/**; role-aware landing sends
  customers to /customer/authorizations (custodians still -> /custodian/home).
- customerHeader nav trimmed to the one migrated page (no dead links).
- New template customer/authorizations.html.
- Update CustomerLoginSecurityConfigurationTest: a customer now redirects to
  /customer/authorizations (was the stale hard-coded /custodian/home).

Full openespi-datacustodian suite: 160 tests, 0 failures.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant