From 83cfe6d582cdf17c9967bdf5d66017f5571eca8d Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 09:27:57 -0500 Subject: [PATCH 1/8] feat: invocation enum --- config/detekt.yml | 3 ++- .../stickyburp/StickyBurpContextMenu.kt | 23 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/config/detekt.yml b/config/detekt.yml index 2e6f288..4d5428b 100644 --- a/config/detekt.yml +++ b/config/detekt.yml @@ -6,7 +6,8 @@ build: complexity: LongMethod: - threshold: 120 # Increased from default to accommodate provideMenuItems + threshold: 130 # Increased from 120 to accommodate provideMenuItems + excludes: ["**/StickyBurpContextMenu.kt"] # Exclude this file from LongMethod check LongParameterList: functionThreshold: 5 constructorThreshold: 6 diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt index feef003..61f588d 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt @@ -6,8 +6,8 @@ import burp.api.montoya.ui.Selection import burp.api.montoya.core.ByteArray import burp.api.montoya.ui.contextmenu.ContextMenuEvent import burp.api.montoya.ui.contextmenu.ContextMenuItemsProvider +import burp.api.montoya.ui.contextmenu.InvocationType import burp.api.montoya.logging.Logging -import burp.api.montoya.ui.contextmenu.InvocationType.* import javax.swing.* import burp.api.montoya.http.message.requests.HttpRequest import burp.api.montoya.http.message.responses.HttpResponse @@ -24,7 +24,7 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: val selection = editor.selectionOffsets() if (!selection.isPresent) return emptyList() - val selectedText = if (event.isFrom(MESSAGE_EDITOR_REQUEST, MESSAGE_VIEWER_REQUEST)) { + val selectedText = if (event.isFrom(InvocationType.MESSAGE_EDITOR_REQUEST, InvocationType.MESSAGE_VIEWER_REQUEST)) { val request = editor.requestResponse().request() val range = selection.get() request.toByteArray().subArray(range).toString() @@ -76,7 +76,22 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: val source = if (messageEditor.isPresent) { val reqRes = messageEditor.get().requestResponse() - "HTTP ${reqRes.request().method()} ${reqRes.request().url()}" + val toolName = when (event.invocationType()) { + InvocationType.MESSAGE_EDITOR_REQUEST -> "Message Editor Request" + InvocationType.MESSAGE_EDITOR_RESPONSE -> "Message Editor Response" + InvocationType.MESSAGE_VIEWER_REQUEST -> "Message Viewer Request" + InvocationType.MESSAGE_VIEWER_RESPONSE -> "Message Viewer Response" + InvocationType.SITE_MAP_TREE -> "Site Map Tree" + InvocationType.SITE_MAP_TABLE -> "Site Map Table" + InvocationType.PROXY_HISTORY -> "Proxy History" + InvocationType.PROXY_INTERCEPT -> "Proxy Intercept" + InvocationType.SCANNER_RESULTS -> "Scanner Results" + InvocationType.INTRUDER_PAYLOAD_POSITIONS -> "Intruder Payload Positions" + InvocationType.INTRUDER_ATTACK_RESULTS -> "Intruder Attack Results" + InvocationType.SEARCH_RESULTS -> "Search Results" + else -> "Other" + } + "$toolName - ${reqRes.request().method()} ${reqRes.request().url()}" } else { "Manual Selection" } @@ -96,7 +111,7 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: val range = selection.get() val reqRes = editor.requestResponse() - if (event.isFrom(MESSAGE_EDITOR_REQUEST, MESSAGE_VIEWER_REQUEST)) { + if (event.isFrom(InvocationType.MESSAGE_EDITOR_REQUEST, InvocationType.MESSAGE_VIEWER_REQUEST)) { val request = reqRes.request() val newRequest = HttpRequest.httpRequest( request.httpService(), From 6e92ca358253c1d61ebb3fab41c2567a53cd8492 Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 11:11:20 -0500 Subject: [PATCH 2/8] chore: update linting and as extra column --- .editorconfig | 6 ++---- .../stickyburp/StickyBurpContextMenu.kt | 16 ++++++++-------- .../stickyburp/StickyBurpTab.kt | 17 +++++++++++------ .../stickyburp/StickyVariable.kt | 1 + 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9fe6e70..2a3d1cf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,10 +7,8 @@ insert_final_newline = true [*.{kt,kts}] indent_size = 4 insert_final_newline = true -max_line_length = 150 # Increased to avoid line length issues +max_line_length=150 ktlint_code_style = ktlint_official -# TODO -# Disable problematic rules for all Kotlin files ktlint_standard = enabled ktlint_standard_no-unused-imports = disabled ktlint_standard_multiline-expression-wrapping = disabled @@ -20,12 +18,12 @@ ktlint_standard_final-newline = disabled ktlint_standard_trailing-comma-on-call-site = disabled ktlint_standard_trailing-comma-on-declaration-site = disabled ktlint_standard_argument-list-wrapping = disabled -ktlint_standard_max-line-length = disabled ktlint_standard_function-signature = disabled ktlint_standard_statement-wrapping = disabled ktlint_standard_blank-line-before-declaration = disabled ktlint_standard_import-ordering = disabled ktlint_standard_no-wildcard-imports = disabled +ktlint_standard_no-multi-spaces = disabled [*.kts] # Additional specific rules for Kotlin script files diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt index 61f588d..82b10b3 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt @@ -76,7 +76,7 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: val source = if (messageEditor.isPresent) { val reqRes = messageEditor.get().requestResponse() - val toolName = when (event.invocationType()) { + val sourceTab = when (event.invocationType()) { InvocationType.MESSAGE_EDITOR_REQUEST -> "Message Editor Request" InvocationType.MESSAGE_EDITOR_RESPONSE -> "Message Editor Response" InvocationType.MESSAGE_VIEWER_REQUEST -> "Message Viewer Request" @@ -91,16 +91,16 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: InvocationType.SEARCH_RESULTS -> "Search Results" else -> "Other" } - "$toolName - ${reqRes.request().method()} ${reqRes.request().url()}" + + tab.addVariable(StickyVariable( + name = trimmedName, + value = selectedText, + sourceTab = sourceTab, + source = "HTTP ${reqRes.request().method()} ${reqRes.request().url()}" + )) } else { "Manual Selection" } - - tab.addVariable(StickyVariable( - name = trimmedName, - value = selectedText, - source = source - )) } mainMenu.add(addItem) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt index 06b23c4..08dbbdb 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt @@ -20,8 +20,11 @@ class StickyBurpTab( private val variables: MutableList, private val persistence: Persistence ) : JPanel() { - private val tableModel: DefaultTableModel = object : DefaultTableModel(arrayOf("Name", "Value", "Source", "Notes"), 0) { - override fun isCellEditable(row: Int, column: Int): Boolean = column == 3 + private val tableModel: DefaultTableModel = object : DefaultTableModel( + arrayOf("Name", "Value", "Source Tab", "Source", "Notes"), + 0 + ) { + override fun isCellEditable(row: Int, column: Int): Boolean = column == 4 } private fun extractColor(source: String): Color? { @@ -132,13 +135,13 @@ class StickyBurpTab( } }) - t.getColumnModel().getColumn(3).cellEditor = DefaultCellEditor(JTextField()) + t.getColumnModel().getColumn(4).cellEditor = DefaultCellEditor(JTextField()) t.addPropertyChangeListener { evt -> if ("tableCellEditor" == evt.propertyName) { val row = t.editingRow val col = t.editingColumn - if (row != -1 && col == 3) { + if (row != -1 && col == 4) { val notes = t.getValueAt(row, col)?.toString() ?: "" val variable = variables[row] variables[row] = variable.copy(notes = notes) @@ -209,6 +212,7 @@ class StickyBurpTab( tableModel.addRow(arrayOf( variable.name, variable.value, + variable.sourceTab, variable.source, variable.notes )) @@ -231,8 +235,9 @@ class StickyBurpTab( private fun updateTableRow(index: Int, variable: StickyVariable) { tableModel.setValueAt(variable.name, index, 0) tableModel.setValueAt(variable.value, index, 1) - tableModel.setValueAt(variable.source, index, 2) - tableModel.setValueAt(variable.notes, index, 3) + tableModel.setValueAt(variable.sourceTab, index, 2) + tableModel.setValueAt(variable.source, index, 3) + tableModel.setValueAt(variable.notes, index, 4) } private fun updateSelectedVariable() { diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyVariable.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyVariable.kt index d6058f5..fb04a30 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyVariable.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyVariable.kt @@ -7,5 +7,6 @@ data class StickyVariable( val name: String, val value: String, val source: String, + val sourceTab: String = "", val notes: String = "" ) From 04816c1524127a966d055759aba95c275c46f49f Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 11:20:26 -0500 Subject: [PATCH 3/8] chore: correct proxy and repeater --- .../stickyburp/StickyBurpContextMenu.kt | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt index 82b10b3..58136e5 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt @@ -76,27 +76,42 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: val source = if (messageEditor.isPresent) { val reqRes = messageEditor.get().requestResponse() - val sourceTab = when (event.invocationType()) { - InvocationType.MESSAGE_EDITOR_REQUEST -> "Message Editor Request" - InvocationType.MESSAGE_EDITOR_RESPONSE -> "Message Editor Response" - InvocationType.MESSAGE_VIEWER_REQUEST -> "Message Viewer Request" - InvocationType.MESSAGE_VIEWER_RESPONSE -> "Message Viewer Response" - InvocationType.SITE_MAP_TREE -> "Site Map Tree" - InvocationType.SITE_MAP_TABLE -> "Site Map Table" - InvocationType.PROXY_HISTORY -> "Proxy History" - InvocationType.PROXY_INTERCEPT -> "Proxy Intercept" - InvocationType.SCANNER_RESULTS -> "Scanner Results" - InvocationType.INTRUDER_PAYLOAD_POSITIONS -> "Intruder Payload Positions" - InvocationType.INTRUDER_ATTACK_RESULTS -> "Intruder Attack Results" - InvocationType.SEARCH_RESULTS -> "Search Results" + val tool = when (event.invocationType()) { + InvocationType.PROXY_HISTORY, + InvocationType.PROXY_INTERCEPT, + InvocationType.MESSAGE_VIEWER_REQUEST, + InvocationType.MESSAGE_VIEWER_RESPONSE -> "Proxy" + InvocationType.INTRUDER_PAYLOAD_POSITIONS, + InvocationType.INTRUDER_ATTACK_RESULTS -> "Intruder" + InvocationType.SCANNER_RESULTS -> "Scanner" + InvocationType.MESSAGE_EDITOR_REQUEST, + InvocationType.MESSAGE_EDITOR_RESPONSE -> "Repeater" + InvocationType.SITE_MAP_TREE, + InvocationType.SITE_MAP_TABLE -> "Site Map" + InvocationType.SEARCH_RESULTS -> "Search" else -> "Other" } + val context = when (event.invocationType()) { + InvocationType.PROXY_HISTORY -> "History" + InvocationType.PROXY_INTERCEPT -> "Intercept" + InvocationType.INTRUDER_PAYLOAD_POSITIONS -> "Payload Positions" + InvocationType.INTRUDER_ATTACK_RESULTS -> "Attack Results" + else -> "" + } + + val source = buildString { + append("HTTP ${reqRes.request().method()} ${reqRes.request().url()}") + if (context.isNotEmpty()) { + append(" ($context)") + } + } + tab.addVariable(StickyVariable( name = trimmedName, value = selectedText, - sourceTab = sourceTab, - source = "HTTP ${reqRes.request().method()} ${reqRes.request().url()}" + sourceTab = tool, + source = source )) } else { "Manual Selection" From a2c7c4805c7a201f62dd5c5de3b03e9110c9c30e Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 11:23:36 -0500 Subject: [PATCH 4/8] chore: preserve updated values too --- .../stickyburp/StickyBurpContextMenu.kt | 34 ++++++++++++++++++- .../stickyburp/StickyBurpTab.kt | 6 +++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt index 58136e5..99875aa 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt @@ -158,10 +158,42 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: val updateItem = JMenuItem(varName) updateItem.addActionListener { val reqRes = event.messageEditorRequestResponse().get().requestResponse() + val tool = when (event.invocationType()) { + InvocationType.PROXY_HISTORY, + InvocationType.PROXY_INTERCEPT, + InvocationType.MESSAGE_VIEWER_REQUEST, + InvocationType.MESSAGE_VIEWER_RESPONSE -> "Proxy" + InvocationType.INTRUDER_PAYLOAD_POSITIONS, + InvocationType.INTRUDER_ATTACK_RESULTS -> "Intruder" + InvocationType.SCANNER_RESULTS -> "Scanner" + InvocationType.MESSAGE_EDITOR_REQUEST, + InvocationType.MESSAGE_EDITOR_RESPONSE -> "Repeater" + InvocationType.SITE_MAP_TREE, + InvocationType.SITE_MAP_TABLE -> "Site Map" + InvocationType.SEARCH_RESULTS -> "Search" + else -> "Other" + } + + val context = when (event.invocationType()) { + InvocationType.PROXY_HISTORY -> "History" + InvocationType.PROXY_INTERCEPT -> "Intercept" + InvocationType.INTRUDER_PAYLOAD_POSITIONS -> "Payload Positions" + InvocationType.INTRUDER_ATTACK_RESULTS -> "Attack Results" + else -> "" + } + + val source = buildString { + append("HTTP ${reqRes.request().method()} ${reqRes.request().url()}") + if (context.isNotEmpty()) { + append(" ($context)") + } + } + tab.addVariable(StickyVariable( name = varName, value = selectedText, - source = "HTTP ${reqRes.request().method()} ${reqRes.request().url()}" + sourceTab = tool, + source = source )) } updateMenu.add(updateItem) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt index 08dbbdb..4bde69a 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt @@ -261,7 +261,11 @@ class StickyBurpTab( return } - val updatedVariable = currentVariable.copy(value = trimmedValue, source = "Manual Update") + val updatedVariable = currentVariable.copy( + value = trimmedValue, + source = "Manual Update", + sourceTab = currentVariable.sourceTab + ) variables[selectedRow] = updatedVariable updateTableRow(selectedRow, updatedVariable) saveVariables() From 6db526c9df92d73894ef9c993533714e5f0f3a33 Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:17:23 -0500 Subject: [PATCH 5/8] chore: add additional metadata --- .../stickyburp/StickyBurpContextMenu.kt | 32 ++++++++++++++++--- .../stickyburp/StickyBurpTab.kt | 12 ++++--- .../stickyburp/StickyVariable.kt | 1 + 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt index 99875aa..83f6a93 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt @@ -101,17 +101,29 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: } val source = buildString { - append("HTTP ${reqRes.request().method()} ${reqRes.request().url()}") + val request = reqRes.request() + val service = request.httpService() + + append("HTTP ${request.method()} ${request.url()}") + append(" (${service.host()}:${service.port()})") + if (service.secure()) append(" [HTTPS]") + if (context.isNotEmpty()) { append(" ($context)") } + + val notes = reqRes.annotations().notes() + if (notes != "") { + append(" - Note: $notes") + } } tab.addVariable(StickyVariable( name = trimmedName, value = selectedText, sourceTab = tool, - source = source + source = source, + timestamp = java.time.LocalDateTime.now().toString() )) } else { "Manual Selection" @@ -183,17 +195,29 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: } val source = buildString { - append("HTTP ${reqRes.request().method()} ${reqRes.request().url()}") + val request = reqRes.request() + val service = request.httpService() + + append("HTTP ${request.method()} ${request.url()}") + append(" (${service.host()}:${service.port()})") + if (service.secure()) append(" [HTTPS]") + if (context.isNotEmpty()) { append(" ($context)") } + + val notes = reqRes.annotations().notes() + if (notes != "") { + append(" - Note: $notes") + } } tab.addVariable(StickyVariable( name = varName, value = selectedText, sourceTab = tool, - source = source + source = source, + timestamp = java.time.LocalDateTime.now().toString() )) } updateMenu.add(updateItem) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt index 4bde69a..a2a245a 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt @@ -21,10 +21,10 @@ class StickyBurpTab( private val persistence: Persistence ) : JPanel() { private val tableModel: DefaultTableModel = object : DefaultTableModel( - arrayOf("Name", "Value", "Source Tab", "Source", "Notes"), + arrayOf("Name", "Value", "Source Tab", "Source", "Timestamp", "Notes"), 0 ) { - override fun isCellEditable(row: Int, column: Int): Boolean = column == 4 + override fun isCellEditable(row: Int, column: Int): Boolean = column == 5 } private fun extractColor(source: String): Color? { @@ -135,13 +135,13 @@ class StickyBurpTab( } }) - t.getColumnModel().getColumn(4).cellEditor = DefaultCellEditor(JTextField()) + t.getColumnModel().getColumn(5).cellEditor = DefaultCellEditor(JTextField()) t.addPropertyChangeListener { evt -> if ("tableCellEditor" == evt.propertyName) { val row = t.editingRow val col = t.editingColumn - if (row != -1 && col == 4) { + if (row != -1 && col == 5) { val notes = t.getValueAt(row, col)?.toString() ?: "" val variable = variables[row] variables[row] = variable.copy(notes = notes) @@ -214,6 +214,7 @@ class StickyBurpTab( variable.value, variable.sourceTab, variable.source, + variable.timestamp, variable.notes )) variables.add(variable) @@ -237,7 +238,8 @@ class StickyBurpTab( tableModel.setValueAt(variable.value, index, 1) tableModel.setValueAt(variable.sourceTab, index, 2) tableModel.setValueAt(variable.source, index, 3) - tableModel.setValueAt(variable.notes, index, 4) + tableModel.setValueAt(variable.timestamp, index, 4) + tableModel.setValueAt(variable.notes, index, 5) } private fun updateSelectedVariable() { diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyVariable.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyVariable.kt index fb04a30..05451b0 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyVariable.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyVariable.kt @@ -8,5 +8,6 @@ data class StickyVariable( val value: String, val source: String, val sourceTab: String = "", + val timestamp: String = java.time.LocalDateTime.now().toString(), val notes: String = "" ) From 31c3a1df1438c640f382a2509180e3092f635a6a Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:19:23 -0500 Subject: [PATCH 6/8] fix: not adding variable to the tab in the updatemenu section --- .../stickyburp/StickyBurpContextMenu.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt index 83f6a93..eaeba1e 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt @@ -170,6 +170,10 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: val updateItem = JMenuItem(varName) updateItem.addActionListener { val reqRes = event.messageEditorRequestResponse().get().requestResponse() + // Get the existing variable to preserve its notes + val existingVar = tab.getVariables().find { it.name == varName } + ?: return@addActionListener + val tool = when (event.invocationType()) { InvocationType.PROXY_HISTORY, InvocationType.PROXY_INTERCEPT, @@ -212,8 +216,7 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: } } - tab.addVariable(StickyVariable( - name = varName, + tab.addVariable(existingVar.copy( value = selectedText, sourceTab = tool, source = source, From 148c3b41085304328b6943bc9588eee81e0c33dc Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:28:25 -0500 Subject: [PATCH 7/8] chore: rm debug comments --- .../com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt index eaeba1e..445473c 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpContextMenu.kt @@ -170,7 +170,6 @@ class StickyBurpContextMenu(private val tab: StickyBurpTab, private val logging: val updateItem = JMenuItem(varName) updateItem.addActionListener { val reqRes = event.messageEditorRequestResponse().get().requestResponse() - // Get the existing variable to preserve its notes val existingVar = tab.getVariables().find { it.name == varName } ?: return@addActionListener From ed6b29a486b3c6dd7363e3a1792dbb14ecf45b36 Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:39:19 -0500 Subject: [PATCH 8/8] chore: slight column rename --- .../kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt index a2a245a..acd8f67 100644 --- a/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt +++ b/src/main/kotlin/com/ganggreentempertatum/stickyburp/StickyBurpTab.kt @@ -21,7 +21,7 @@ class StickyBurpTab( private val persistence: Persistence ) : JPanel() { private val tableModel: DefaultTableModel = object : DefaultTableModel( - arrayOf("Name", "Value", "Source Tab", "Source", "Timestamp", "Notes"), + arrayOf("Sticky Name", "Sticky Value", "Source Tab", "Source Meta", "Source Timestamp", "Sticky Notes"), 0 ) { override fun isCellEditable(row: Int, column: Int): Boolean = column == 5