Rename to mokosh-apps + Phase-4 audit fixes #46

Merged
vas2000-work merged 5 commits from feat/m1-vas into main 2026-05-29 22:05:42 +02:00
Owner

Renames the repo content mokosh-clients -> mokosh-apps and remediates Phase-4 audit findings.

Rename: Cargo package/bin mokosh-apps + lib mokosh_apps, Dioxus app name, OCI build path + image source label, justfile image tags + dev cargo volumes, compose container/volume names, README + dev-docs, and the .idea module. The "Mokosh Platform" product brand is left as-is.

Audit fixes:

  • F1 tenant-cache reactivity: a TENANT_GENERATION signal bumped on every token set (login/refresh/org-switch/logout); list/detail use_resource closures read it so they re-fetch on org switch instead of rendering the prior tenant's cached data (contacts/calendar/admin).
  • F4 OIDC nonce validation in complete_login (reject a missing or mismatched id_token nonce; state still checked first).
  • F5 contacts CompanyNewPage/ContactNewPage now issue real POSTs.
  • Runtime API/issuer host derivation updated from msp-api. to api.msp. to match the deployed topology.

Deferred to origin/dev-yousif (the active tickets-vertical + portal owner) to avoid duplication/conflict: F2 portal form and F3 tickets-list filtering. The placeholder-backend list/new pages remain for a later pass.

Renames the repo content mokosh-clients -> mokosh-apps and remediates Phase-4 audit findings. Rename: Cargo package/bin mokosh-apps + lib mokosh_apps, Dioxus app name, OCI build path + image source label, justfile image tags + dev cargo volumes, compose container/volume names, README + dev-docs, and the .idea module. The "Mokosh Platform" product brand is left as-is. Audit fixes: - F1 tenant-cache reactivity: a TENANT_GENERATION signal bumped on every token set (login/refresh/org-switch/logout); list/detail use_resource closures read it so they re-fetch on org switch instead of rendering the prior tenant's cached data (contacts/calendar/admin). - F4 OIDC nonce validation in complete_login (reject a missing or mismatched id_token nonce; state still checked first). - F5 contacts CompanyNewPage/ContactNewPage now issue real POSTs. - Runtime API/issuer host derivation updated from msp-api.<tld> to api.msp.<tld> to match the deployed topology. Deferred to origin/dev-yousif (the active tickets-vertical + portal owner) to avoid duplication/conflict: F2 portal form and F3 tickets-list filtering. The placeholder-backend list/new pages remain for a later pass.
Adds For AI/ to .gitignore (matches the cross-repo convention in ~/projects/ - mokosh-server, bunyip, storefront, etc. all gitignore it). The directory holds local-only AI working context (sprint progress doc, audit notes, design sketches); it should not be committed.

This sprint scope for mokosh-clients turned out to be doc-only: the dev container naming (dev-mokosh-client-${USER} etc.) was already correct on main per memory mokosh_dev_container_naming, the runtime URL derivation + org-aware TopBar + calendar/companies progressive enablement landed via PR #18 on main, and the wiring audit findings live in For AI/m1-vas-progress.md (cross-references bunyip/For AI/m1-vas-progress.md).

Local-only sprint per user constraint. No push.
Match the renamed remote (psa-systems/mokosh-apps). Cargo package/bin
mokosh-client -> mokosh-apps and lib mokosh_client -> mokosh_apps (with the
single main.rs use-path), Dioxus app name, OCI build output path + image
source label, justfile image tags + dev cargo volume names, compose
container/volume names, README + dev-docs references, and the .idea module
file. The local working directory was also renamed mokosh-clients -> mokosh-apps.
Two historical doc-pointer comments in src/lib.rs are intentionally left.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
F1 (P0 tenant isolation): a TENANT_GENERATION GlobalSignal (hooks/fetch.rs) is bumped on every set_access_token (login/refresh/org-switch/logout); the list/detail use_resource closures read active_tenant_generation() so they re-fetch on an org switch instead of rendering the previous tenant's cached data (contacts/tickets/calendar/admin pages). Demo fallback preserved.
F2: portal ship-blockers - real new-ticket form state + POST, reply textarea + Send POST, and invoice View navigation; portal endpoints wired to their expected paths with // TODO(portal-api) where the server side may not exist yet (no faked success).
F3 (partial): real client-side filter + sortable headers + pagination on the tickets, companies, and contacts list pages; the placeholder-backend list pages (projects/assets/kb/payments/admin-tenants/timesheets) are left for follow-up.
F4: OIDC nonce validation in complete_login - reject a missing or mismatched id_token nonce (state still checked first).
F5 (partial): CompanyNewPage and ContactNewPage now issue real POSTs; the other New* pages backed by placeholder server modules stay labeled mocks.

Verified with cargo check --target wasm32-unknown-unknown in the dev container.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
origin/dev-yousif is the active owner of the tickets vertical (live list with server-side filters, detail page, company picker, notes timeline) and already fixes the portal new-ticket form. Revert this branch's Phase-4 portal.rs + tickets.rs edits to avoid duplicating and conflicting with that work.

Retained from Phase 4: F1 tenant-cache reactivity (fetch.rs TENANT_GENERATION + contacts/calendar/admin use_resource reads), F4 OIDC nonce validation, F5 contacts new-forms. Follow-up: re-apply the active_tenant_generation() reactivity onto dev-yousif's tickets list once it lands.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix(oidc): derive the API/issuer host as api.msp, not msp-api
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 6m46s
Create release / Create release from merged PR (pull_request) Has been skipped
f6860ebedf
The SPA's runtime URL derivation mapped the canonical msp.<tld> SPA host to msp-api.<tld> for the OIDC issuer (modules/oidc/config.rs) and the API base (hooks/fetch.rs). The deployed topology now puts the API at api.msp.<tld> (c-01 routes api.msp.a8n.systems; Cloudflare DNS + traefik updated to match). Derive api.msp.{rest} so the staging SPA actually reaches its API and OIDC issuer instead of the dead msp-api host.

Follow-up: nc-01 prod still routes msp-api.psa.systems; move it to api.msp.psa.systems to match this single canonical derivation (one shared image, one rule).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
vas2000-work deleted branch feat/m1-vas 2026-05-29 22:05:43 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!46
No description provided.