Skip to content

feat (PUT-1025 PUT-1026 and PUT-1017): better handling old token auth required in gui#3166

Merged
Salazareo merged 2 commits into
mainfrom
DS/put-1025-1026-1017
May 27, 2026
Merged

feat (PUT-1025 PUT-1026 and PUT-1017): better handling old token auth required in gui#3166
Salazareo merged 2 commits into
mainfrom
DS/put-1025-1026-1017

Conversation

@Salazareo
Copy link
Copy Markdown
Member

No description provided.

@Salazareo Salazareo changed the title feat (PUT-1025 PUT-1026 and PUT-1017): better handling old token forcing in gui feat (PUT-1025 PUT-1026 and PUT-1017): better handling old token auth required in gui May 27, 2026
@Salazareo Salazareo requested a review from Copilot May 27, 2026 07:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 71.73%
⬆️ +0.04%
13682 / 19074
🔵 Statements 70.18%
⬆️ +0.05%
14456 / 20597
🔵 Functions 70.46%
⬆️ +0.02%
2257 / 3203
🔵 Branches 60.05%
⬆️ +0.13%
9296 / 15479
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/backend/controllers/auth/AuthController.ts 89.03%
⬇️ -0.05%
74.57%
⬆️ +0.20%
71.15%
⬇️ -0.41%
90.02%
⬇️ -0.07%
6, 24-26, 32, 33, 34, 38-39, 44, 45, 47, 354-355, 416-418, 435-437, 548, 608, 648, 659, 673-681, 714-715, 718-723, 757, 861, 992, 1037, 1097, 1110-1113, 1153-1155, 1217-1219, 1231-1233, 1238-1240, 1259, 1278, 1289, 1379-1386, 1412-1426, 1435-1441, 1459, 1490-1492, 1504-1510, 1536, 1543-1550, 1556, 1563-1576, 1595-1610, 1639-1641, 1681, 1704-1706, 1729, 1767-1769, 1835, 1865, 1958-1961, 2038-2043, 2046-2048, 2075, 2094, 2112, 2130, 2143, 2155, 2172, 2182, 2193, 2206, 2215, 2219, 2225, 2243-2247, 2256-2258, 2272, 2275-2279, 2355
src/backend/core/http/middleware/authProbe.ts 95%
⬇️ -1.05%
87.01%
⬇️ -1.72%
100%
🟰 ±0%
97.33%
⬇️ -1.26%
190, 222, 228, 234
src/backend/services/auth/AuthService.ts 82.78%
⬆️ +0.43%
73.82%
⬆️ +1.77%
89.33%
⬇️ -0.67%
85.74%
⬆️ +0.41%
77, 81, 131-133, 155-159, 180, 313-315, 366-368, 398, 400, 444, 587-590, 646-648, 683-685, 695-697, 703-705, 719-721, 736, 754-756, 762-764, 777-779, 816-819, 878-891, 900, 902, 918, 927-932, 950, 962, 992-993, 996-998, 1001-1006, 1012-1013, 1024, 1036, 1038, 1044, 1132, 1206-1208, 1367-1369, 1465-1472, 1513, 1601-1603, 1670-1673, 1699, 1719-1723, 1726, 1729-1731, 1752, 1755, 1772, 1774-1778, 1786-1788
src/backend/services/auth/TokenService.ts 96.22%
⬇️ -0.65%
85.71%
⬇️ -2.62%
100%
🟰 ±0%
96.93%
⬇️ -0.82%
91, 100, 266-268, 300-303
src/backend/services/socket/SocketService.ts 39.71%
⬇️ -0.86%
29.34%
⬇️ -2.05%
42.85%
🟰 ±0%
42.74%
⬇️ -1.01%
46-56, 72, 76-78, 88, 94-134, 139, 142-144, 147-187, 192, 194-218, 226, 233, 239, 265-279, 291
src/backend/stores/session/SessionStore.js 76.49%
⬇️ -1.33%
72.91%
⬇️ -0.45%
66.66%
⬇️ -2.22%
78.07%
⬇️ -1.82%
91, 275, 353, 395-397, 447, 465-467, 504, 516-518, 558-609, 716, 722, 728, 781-782, 791, 798-815, 824-830, 833, 847, 852, 925
Generated in workflow #257 for commit 8aea304 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves session management and “old token reauth required” handling by enriching session metadata (IP/User-Agent + parent linkage), adding backend support for session label renaming, and upgrading the GUI’s Manage Sessions window with search, grouping, and new actions.

Changes:

  • Backend: thread request IP/User-Agent through auth to SessionStore.touch/updateActivity, persist last_ip/last_user_agent, and expose them (plus parent_session_id) in /auth/list-sessions.
  • Backend: add session label rename support (SessionStore.setLabel + AuthService.setSessionLabel + PATCH /auth/sessions/:uuid/label) with ownership enforcement and cache invalidation.
  • GUI: rebuild Manage Sessions UI with hierarchical display, search, revoke-all-others, per-row rename UI, and client label derived from User-Agent.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/gui/src/UI/UIWindowManageSessions.js Adds session tree UI, search, rename, revoke-all-others, and UA-derived client labels.
src/backend/stores/session/SessionStore.test.ts Adds tests for updateActivity IP/UA refresh and setLabel ownership behavior.
src/backend/stores/session/SessionStore.js Implements setLabel and extends updateActivity/touch to persist IP/UA and invalidate caches.
src/backend/services/socket/SocketService.ts Passes socket IP and User-Agent into auth so sessions can refresh roaming metadata.
src/backend/services/auth/AuthService.ts Extends authenticate with request context, threads it into session resolution, exposes new session fields, and adds setSessionLabel.
src/backend/core/http/middleware/authProbe.ts Passes request IP and User-Agent into authenticate for HTTP flows.
src/backend/controllers/auth/AuthController.ts Adds PATCH /auth/sessions/:uuid/label route + handler for session renaming.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +39
else if ( /Mac OS X/i.test(ua) ) os = 'macOS';
else if ( /Android/i.test(ua) ) os = 'Android';
else if ( /iPhone|iPad|iPod/i.test(ua) ) os = 'iOS';
Comment on lines +491 to +494
el_search.addEventListener('input', () => {
searchQuery = el_search.value.trim();
reload_sessions();
});
Comment on lines +145 to +156
const el_caret = document.createElement('span');
el_caret.classList.add('session-widget-caret');
el_caret.textContent = '▾';
el_caret.style.cursor = 'pointer';
el_caret.style.marginRight = '4px';
el_caret.addEventListener('click', () => {
if ( !el_children_container ) return;
const collapsed = el_children_container.style.display === 'none';
el_children_container.style.display = collapsed ? '' : 'none';
el_caret.textContent = collapsed ? '▾' : '▸';
});
el_header.appendChild(el_caret);
Comment on lines +180 to +185
const el_rename_btn = document.createElement('span');
el_rename_btn.classList.add('session-widget-rename');
el_rename_btn.textContent = '✎';
el_rename_btn.title = i18n('ui_rename') || 'Rename';
el_rename_btn.style.cursor = 'pointer';
el_rename_btn.style.opacity = '0.6';
Comment on lines +1883 to +1887
await this.services.auth.setSessionLabel(
req.actor!,
uuid,
label ?? null,
);
Comment on lines +239 to +244
el_input.addEventListener('keydown', (ev) => {
if ( ev.key === 'Enter' ) finish(true);
else if ( ev.key === 'Escape' ) finish(false);
});
el_input.addEventListener('blur', () => finish(true));
};
@Salazareo Salazareo force-pushed the DS/put-1025-1026-1017 branch 2 times, most recently from c31a0bf to 9e024e6 Compare May 27, 2026 07:25
@Salazareo Salazareo force-pushed the DS/put-1025-1026-1017 branch from 9e024e6 to dea0dbf Compare May 27, 2026 07:27
@Salazareo Salazareo merged commit 8f8efcb into main May 27, 2026
6 of 7 checks passed
@Salazareo Salazareo deleted the DS/put-1025-1026-1017 branch May 27, 2026 18:45
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.

2 participants