Repository navigation
Conversation
toku-sa-n
marked this pull request as draft
May 27, 2026 02:40
toku-sa-n
force-pushed
the
refactor/config-http-server-decouple
branch
4 times, most recently
from
July 7, 2026 05:50
7d8a334 to
f0d292f
Compare
toku-sa-n
force-pushed
the
refactor/config-http-server-decouple
branch
from
July 10, 2026 11:36
f0d292f to
3b6c621
Compare
toku-sa-n
force-pushed
the
refactor/config-http-server-decouple
branch
from
November 5, 2026 10:10
3b6c621 to
47c6a25
Compare
ConfigHttpServer lives in packetproxy.common, yet it drove GUIMain and JOptionPane directly to confirm a remote config overwrite, and wrote the received config into the database inline. That tied the HTTP handler to Swing and made it impossible to exercise without a running GUI. Move the confirmation behind a ConfigHttpUiActions interface, implemented by SwingConfigHttpUiActions in packetproxy.gui, and move the database write into ConfigSettingsWriter. GUIOptionHubServer injects both through the constructor. The overwrite decision is unchanged: only NO_OPTION rejects. The window still stays always-on-top from selecting the Options tab until the dialog closes. The reset now sits in a finally block, so an exception while the dialog is up no longer leaves the window pinned on top. Co-authored-by: Cursor <cursoragent@cursor.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
With the Swing dialog and the database write behind injected collaborators, ConfigHttpServer.serve() can be called directly with a mocked session. Pin down the paths that guard a remote config overwrite. A missing, empty or wrong access token returns 401 without touching the UI or the database. A declined confirmation returns 401 without writing. An accepted one passes postData to ConfigSettingsWriter and returns 200. Co-authored-by: Cursor <cursoragent@cursor.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
toku-sa-n
force-pushed
the
refactor/config-http-server-decouple
branch
from
November 9, 2026 02:50
47c6a25 to
a5e0e56
Compare
toku-sa-n
marked this pull request as ready for review
November 9, 2026 03:31
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.
UIとロジックコードの分離の第一歩として、PacketProxyHubから設定をダウンロードする際に使う
ConfigHttpServerから、Swingのダイアログ表示とDBへの書き込みを切り離しました。動作は変えないリファクタです。変更内容
ConfigHttpUiActions(packetproxy.common): 設定の上書きをユーザーに確認するためのインタフェースSwingConfigHttpUiActions(packetproxy.gui): 上のインタフェースのSwing実装。これまでConfigHttpServerの中にあった、ウィンドウの最前面化・Optionsタブへの切り替え・確認ダイアログを移したConfigSettingsWriter(packetproxy.common): 受け取った設定JSONをDBへ反映する処理を移したConfigHttpServer: 上の2つをコンストラクタで受け取るようにし、javax.swingとpacketproxy.guiへの依存をなくした(生成はGUIOptionHubServerで行う)上書きするかどうかの判定(はっきり「はい」と答えたときだけ上書きする。#277 で入った判定をそのまま移しています)、レスポンス、DBへの書き込み順は変えていません。ひとつだけ、ウィンドウの最前面化(
setAlwaysOnTop(true))の解除をfinallyに移し、ダイアログの表示中に例外が起きても最前面のまま残らないようにしました。テスト
ConfigHttpServerTestを追加しました。serve()をモックのセッションで直接呼び、次を確認しています。postDataをそのままConfigSettingsWriterに渡し、200と{"status": "ok"}を返す最新の
masterにrebaseし、./gradlew compileJava testとspotlessCheckが通ることを確認しました。By placing an "x" in the box, I hereby understand, accept and agree to be bound by the terms and conditions of the Contribution License Agreement.
🤖 Generated with Claude Code