feat: add connection profiles and remote auth flow#121
Merged
ibourgeois merged 2 commits intomainfrom Mar 25, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a first-class “instance connection” concept to the desktop shell, enabling users to save/switch server connection profiles and authenticate to remote Katra servers in-app while persisting per-connection remote identity + cookie context.
Changes:
- Introduce
InstanceConnectionmodel + persistence (migration/factory) and a manager service for resolving/activating connections. - Add remote in-app server authentication flow (guest + saved-connection) and wire up new connection/profile routes.
- Update desktop shell UI to be connection-aware (switching, editing, deletion) and expand feature/flow test coverage.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Feature/InstanceConnectionManagementTest.php | New end-to-end tests for connection CRUD/activation, shell behavior, and remote auth context persistence. |
| tests/Feature/FortifyAuthenticationTest.php | Extends guest “connect server” coverage to include in-app credential step and remote sign-in behavior. |
| tests/Feature/DesktopUiFeatureFlagTest.php | Ensures DB-backed user records exist for feature-flag scope tests (uses RefreshDatabase + create). |
| tests/Feature/DesktopShellTest.php | Updates shell expectations to reflect connection-aware UI and active connection rendering. |
| routes/web.php | Adds connection/profile/auth routes and moves home/profile into auth group. |
| resources/views/welcome.blade.php | Replaces workspace selector surface with a connections switcher + add/edit/delete connection modals. |
| resources/views/components/desktop/profile-menu.blade.php | Adjusts shell profile menu styling and removes “Manage connections” entry. |
| resources/views/auth/connect-server.blade.php | Converts server connect screen into a 2-step flow (URL → credentials) and supports saved-connection sign-in. |
| resources/css/app.css | Adds hover/transition styling for the shared “connection trigger” surface. |
| database/migrations/2026_03_24_083829_create_instance_connections_table.php | Creates instance_connections table with metadata + session context storage. |
| database/factories/InstanceConnectionFactory.php | Factory states for server/current-instance connections for tests. |
| app/Support/Connections/RemoteInstanceAuthenticator.php | Implements remote login form bootstrap, CSRF extraction, cookie capture, and optional profile fetch. |
| app/Support/Connections/InstanceConnectionManager.php | Centralizes connection listing, active resolution, activation tracking, and auth context persistence. |
| app/Models/User.php | Adds instanceConnections() relationship. |
| app/Models/InstanceConnection.php | New model with encrypted session context + computed attributes for UI. |
| app/Http/Requests/UpdateInstanceConnectionRequest.php | Validation rules for editing/renaming current-instance vs server connections. |
| app/Http/Requests/StoreInstanceConnectionRequest.php | Validation rules/messages for adding a saved server connection. |
| app/Http/Requests/ConnectServerRequest.php | Validation rules/messages for guest “server URL” step. |
| app/Http/Requests/AuthenticateRemoteInstanceConnectionRequest.php | Validation rules/messages for remote credential submission (guest or authed). |
| app/Http/Controllers/InstanceConnectionController.php | Implements connect/prepare/authenticate flows plus connection CRUD and profile endpoint. |
| app/Http/Controllers/HomeController.php | Makes the desktop shell render based on the active connection + passes connection/link/viewer identity state to the UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
database/migrations/2026_03_24_083829_create_instance_connections_table.php
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing