[PR #1680] [MERGED] Restore hostable auth parity #5208

Closed
opened 2026-10-22 04:14:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1680
Author: @cha1latte
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @cha1latte

Base: refactor ← Head: codex/refactor-hostable-auth


📝 Commits (2)

  • 70a7616 Restore hostable auth parity
  • 220e4ef Address authenticated remote asset review

📊 Changes

17 files changed (+479 additions, -84 deletions)

View changed files

📝 custom_components/marinara_engine/__init__.py (+7 -1)
📝 custom_components/marinara_engine/config_flow.py (+63 -6)
📝 custom_components/marinara_engine/const.py (+2 -0)
📝 custom_components/marinara_engine/coordinator.py (+32 -3)
📝 custom_components/marinara_engine/strings.json (+3 -1)
📝 custom_components/marinara_engine/translations/en.json (+3 -1)
📝 src-tauri/src/http_dispatch.rs (+25 -9)
📝 src/app/App.tsx (+10 -6)
📝 src/app/shell/ChatSidebar.tsx (+31 -3)
📝 src/features/catalog/characters/components/CharacterAvatarImage.tsx (+21 -2)
📝 src/features/modes/game-assets/components/AssetGrid.tsx (+33 -13)
📝 src/features/modes/game-assets/components/ImagePreviewModal.tsx (+18 -2)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+12 -2)
📝 src/shared/api/local-file-api.test.ts (+82 -15)
📝 src/shared/api/local-file-api.ts (+68 -9)
📝 src/shared/api/remote-runtime.test.ts (+47 -7)
📝 src/shared/api/remote-runtime.ts (+22 -4)

📄 Description



Linked issue

N/A - refactor readiness blocker found during hostable/security/integration review.

Why this change

The refactor branch added secured hostable runtime behavior, but Home Assistant and remote asset paths were not fully aligned with that boundary. Secured marinara-server needed an authenticated integration path, and raw server-path commands needed to stay unavailable over HTTP.

What changed

  • Add Home Assistant username/password configuration fields.
  • Send Basic Auth headers from Home Assistant coordinator checks.
  • Verify both hostable health and authenticated API access during setup/update.
  • Keep raw server-path commands out of the remote HTTP command allowlist and dispatch path.
  • Resolve authenticated remote managed asset URLs into blob URLs for async local-file API consumers.
  • Add focused tests for remote runtime auth checks, managed asset blob resolution, and HTTP raw-path rejection.

Refactor impact

Primary owner:

Remote runtime / shared API / Home Assistant integration.

Impact areas reviewed:

  • src/shared/api remote runtime wrappers.
  • src-tauri HTTP dispatch command boundary.
  • Home Assistant config flow and coordinator auth handling.
  • Managed asset URL behavior for remote-capable frontend code.

Boundary notes:

  • Feature code continues to use focused shared API wrappers.
  • Raw file/server-path capabilities remain privileged and are not exposed over hostable HTTP.
  • Auth is enforced in the hostable path rather than being assumed by integration callers.

Pressure points touched:

  • src/shared/api/remote-runtime.ts
  • src/shared/api/local-file-api.ts
  • src-tauri/src/http_dispatch.rs
  • custom_components/marinara_engine/*

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Codex-run proof:

  • pnpm check passed in scratch/refactor-lane-worktrees/hostable.
  • pnpm test src/shared/api/remote-runtime.test.ts src/shared/api/local-file-api.test.ts passed: 21 tests.
  • cargo test --manifest-path src-tauri\Cargo.toml http_dispatch::tests passed: 10 tests.
  • pnpm typecheck passed.
  • cargo check --manifest-path src-tauri\Cargo.toml passed.
  • git diff --check upstream/refactor...HEAD passed.
  • Bunny pre-PR review pass: no blocking findings; remaining risk is live Home Assistant setup verification with a secured hostable server.

Manual verification notes

  • A live Home Assistant instance was not connected during this pass.
  • A secured remote runtime should be smoke-tested manually with real credentials before marking the integration fully proven.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs changes included. This PR updates integration strings/translations for the new auth fields.

UI evidence

N/A - hostable/auth/integration behavior only; no app UI changes.

Summary by CodeRabbit

Release Notes

  • New Features

    • Username and password authentication support for Marinara Engine configuration
    • Authenticated remote asset resolution for game assets, backgrounds, and lorebook images
    • Remote runtime health checks now verify authentication credentials
  • Bug Fixes

    • Removed unsupported raw server path commands from remote dispatch
  • Tests

    • Updated test coverage for authenticated remote assets and health validation
    • Added tests for rejected remote path commands

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1680 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `codex/refactor-hostable-auth` --- ### 📝 Commits (2) - [`70a7616`](https://github.com/Pasta-Devs/Marinara-Engine/commit/70a76166cfa99f14f80808ed6e12402c9b6828ee) Restore hostable auth parity - [`220e4ef`](https://github.com/Pasta-Devs/Marinara-Engine/commit/220e4efa6f444606387ff4ff6b3ae5ef719488dc) Address authenticated remote asset review ### 📊 Changes **17 files changed** (+479 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `custom_components/marinara_engine/__init__.py` (+7 -1) 📝 `custom_components/marinara_engine/config_flow.py` (+63 -6) 📝 `custom_components/marinara_engine/const.py` (+2 -0) 📝 `custom_components/marinara_engine/coordinator.py` (+32 -3) 📝 `custom_components/marinara_engine/strings.json` (+3 -1) 📝 `custom_components/marinara_engine/translations/en.json` (+3 -1) 📝 `src-tauri/src/http_dispatch.rs` (+25 -9) 📝 `src/app/App.tsx` (+10 -6) 📝 `src/app/shell/ChatSidebar.tsx` (+31 -3) 📝 `src/features/catalog/characters/components/CharacterAvatarImage.tsx` (+21 -2) 📝 `src/features/modes/game-assets/components/AssetGrid.tsx` (+33 -13) 📝 `src/features/modes/game-assets/components/ImagePreviewModal.tsx` (+18 -2) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+12 -2) 📝 `src/shared/api/local-file-api.test.ts` (+82 -15) 📝 `src/shared/api/local-file-api.ts` (+68 -9) 📝 `src/shared/api/remote-runtime.test.ts` (+47 -7) 📝 `src/shared/api/remote-runtime.ts` (+22 -4) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue N/A - refactor readiness blocker found during hostable/security/integration review. ## Why this change The refactor branch added secured hostable runtime behavior, but Home Assistant and remote asset paths were not fully aligned with that boundary. Secured `marinara-server` needed an authenticated integration path, and raw server-path commands needed to stay unavailable over HTTP. ## What changed - Add Home Assistant username/password configuration fields. - Send Basic Auth headers from Home Assistant coordinator checks. - Verify both hostable health and authenticated API access during setup/update. - Keep raw server-path commands out of the remote HTTP command allowlist and dispatch path. - Resolve authenticated remote managed asset URLs into blob URLs for async local-file API consumers. - Add focused tests for remote runtime auth checks, managed asset blob resolution, and HTTP raw-path rejection. ## Refactor impact Primary owner: Remote runtime / shared API / Home Assistant integration. Impact areas reviewed: - `src/shared/api` remote runtime wrappers. - `src-tauri` HTTP dispatch command boundary. - Home Assistant config flow and coordinator auth handling. - Managed asset URL behavior for remote-capable frontend code. Boundary notes: - Feature code continues to use focused shared API wrappers. - Raw file/server-path capabilities remain privileged and are not exposed over hostable HTTP. - Auth is enforced in the hostable path rather than being assumed by integration callers. Pressure points touched: - `src/shared/api/remote-runtime.ts` - `src/shared/api/local-file-api.ts` - `src-tauri/src/http_dispatch.rs` - `custom_components/marinara_engine/*` ## Validation - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant Codex-run proof: - `pnpm check` passed in `scratch/refactor-lane-worktrees/hostable`. - `pnpm test src/shared/api/remote-runtime.test.ts src/shared/api/local-file-api.test.ts` passed: 21 tests. - `cargo test --manifest-path src-tauri\Cargo.toml http_dispatch::tests` passed: 10 tests. - `pnpm typecheck` passed. - `cargo check --manifest-path src-tauri\Cargo.toml` passed. - `git diff --check upstream/refactor...HEAD` passed. - Bunny pre-PR review pass: no blocking findings; remaining risk is live Home Assistant setup verification with a secured hostable server. ### Manual verification notes - A live Home Assistant instance was not connected during this pass. - A secured remote runtime should be smoke-tested manually with real credentials before marking the integration fully proven. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No docs changes included. This PR updates integration strings/translations for the new auth fields. ## UI evidence N/A - hostable/auth/integration behavior only; no app UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Username and password authentication support for Marinara Engine configuration * Authenticated remote asset resolution for game assets, backgrounds, and lorebook images * Remote runtime health checks now verify authentication credentials * **Bug Fixes** * Removed unsupported raw server path commands from remote dispatch * **Tests** * Updated test coverage for authenticated remote assets and health validation * Added tests for rejected remote path commands <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1680?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:14 +07:00
Sign in to join this conversation.
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
Pasta-Devs/Marinara-Engine#5208
No description provided.