Skip to content

Commit 2c7723e

Browse files
author
Offensive 360
committed
v1.1.3/v1.12: Fix empty-cache rescan, 413 handling, exclude project files, AS BGT thread
- VS: Empty-result cache no longer blocks rescan (0-finding cache treated as stale) - VS: HTTP 413 shows clear message about nginx file size limit - VS: Exclude .sln/.csproj/.vbproj from zip (prevents server build timeout) - AS: getActionUpdateThread returns BGT (fixes right-click context menu freeze) - AS: KB loads lazily on first scan, not on menu render
1 parent 8dd0331 commit 2c7723e

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pluginGroup=com.offensive360.sast
22
pluginName=O360 SAST
3-
pluginVersion=1.1.2
3+
pluginVersion=1.1.3
44

55
platformType=IC
66
platformVersion=2024.1

src/main/kotlin/com/offensive360/sast/actions/BaseScanAction.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ abstract class BaseScanAction : AnAction() {
134134
})
135135
}
136136

137+
override fun getActionUpdateThread(): com.intellij.openapi.actionSystem.ActionUpdateThread {
138+
return com.intellij.openapi.actionSystem.ActionUpdateThread.BGT
139+
}
140+
137141
override fun update(e: AnActionEvent) {
138142
e.presentation.isEnabledAndVisible = e.project != null
139143
}

src/main/kotlin/com/offensive360/sast/knowledge/VulnerabilityKnowledgeBase.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ object VulnerabilityKnowledgeBase {
2020

2121
private val byId: MutableMap<String, KBEntry> = mutableMapOf()
2222
private val byNorm: MutableMap<String, KBEntry> = mutableMapOf()
23-
private var loaded = false
23+
@Volatile private var loaded = false
2424

25-
init {
26-
loadFromResource()
25+
private fun ensureLoaded() {
26+
if (!loaded) {
27+
synchronized(this) {
28+
if (!loaded) loadFromResource()
29+
}
30+
}
2731
}
2832

2933
private fun loadFromResource() {
@@ -63,6 +67,7 @@ object VulnerabilityKnowledgeBase {
6367
*/
6468
fun lookup(type: String): KBEntry? {
6569
if (type.isBlank()) return null
70+
ensureLoaded()
6671
val l = type.lowercase().trim()
6772
byId[l]?.let { return it }
6873
val n = l.replace(Regex("[_\\-\\s]"), "")

0 commit comments

Comments
 (0)