Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
27861e0
- Added addition SCA package manager support
cx-anand-nandeshwar Aug 14, 2026
4906dd3
Added additional SCA package manager support
cx-anand-nandeshwar Aug 17, 2026
a587a80
Updated package manager with additional SCA support
cx-anand-nandeshwar Aug 17, 2026
307cfda
Centralize CxWrapper construction with agent version reporting and ar…
cx-anand-nandeshwar Aug 19, 2026
6ff513b
Upgrade ast-cli-java-wrapper from 2.4.24 to 2.4.27
cx-anand-nandeshwar Aug 19, 2026
67ec197
Merge remote-tracking branch 'origin/feature/AST-168518_additional_pk…
cx-anand-nandeshwar Aug 19, 2026
6650fa5
Merge remote-tracking branch 'origin/feature/AST-157277_plugin_versio…
cx-anand-nandeshwar Aug 19, 2026
0da81b3
Additional Package Manager
cx-anand-nandeshwar Aug 19, 2026
1fbdd4e
Enhance Checkmarx One preferences page UI and add logout confirmation
cx-anand-nandeshwar Aug 20, 2026
fa226a5
Improve Checkmarx One preferences page connect/logout UX
cx-anand-nandeshwar Aug 20, 2026
913bd09
Decouple auth-state checks from API key presence; keep key after logout
cx-anand-nandeshwar Aug 20, 2026
4ae2fb5
Add Checkmarx MCP configuration UI with install/edit links and status…
cx-anand-nandeshwar Aug 20, 2026
50ab007
Set fixed width (500px) for API key and Additional Params input fields
cx-anand-nandeshwar Aug 21, 2026
7a2b667
Resolved the review comments
cx-anand-nandeshwar Aug 21, 2026
7f269b9
Resolved the review comments
cx-anand-nandeshwar Aug 21, 2026
277be5e
Implement MCP uninstall with handler and callback pattern
cx-anand-nandeshwar Aug 21, 2026
37cd1d0
Fix MCP uninstall: marshal callback to UI thread and improve logging
cx-anand-nandeshwar Aug 21, 2026
a4f290f
Fix NPE in CheckmarxPreferencePage.performOk: guard against null/disp…
cx-anand-nandeshwar Aug 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
2 changes: 1 addition & 1 deletion ast-cli-java-wrapper.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.24
2.4.27
1 change: 1 addition & 0 deletions checkmarx-ast-eclipse-plugin-tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Expand Down
3 changes: 2 additions & 1 deletion checkmarx-ast-eclipse-plugin-tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ Require-Bundle:
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ClassPath: .,lib/mockito-core-5.14.2.jar,lib/powermock-core-*.jar, lib/byte-buddy-1.17.8.jar, lib/byte-buddy-agent-1.17.8.jar
Automatic-Module-Name: com.checkmarx.ast.eclipse.tests
Import-Package: com.checkmarx.eclipse.common.runner
Import-Package: com.checkmarx.eclipse.common.runner,
org.slf4j;version="[2.0.0,3.0.0)"
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
package checkmarx.ast.eclipse.plugin.tests.integration;


import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.checkmarx.eclipse.common.runner.Authenticator;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.File;

import org.junit.jupiter.api.Test;
import org.slf4j.LoggerFactory;

import com.checkmarx.eclipse.common.runner.Authenticator;

public class AuthenticatorIntegrationTest extends BaseIntegrationTest {

private static final Logger logger = LoggerFactory.getLogger(AuthenticatorIntegrationTest.class);

@Mock

private Authenticator authenticator;

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package checkmarx.ast.eclipse.plugin.tests.unit.runner;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;

import java.io.IOException;

import org.junit.jupiter.api.Test;
import org.mockito.MockedConstruction;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
import org.slf4j.Logger;

import com.checkmarx.ast.wrapper.CxException;
import com.checkmarx.ast.wrapper.CxWrapper;
Expand All @@ -22,16 +24,13 @@ class AuthenticatorTest {
@Test
void testDoAuthenticationSuccess() throws Exception {

Logger mockLogger = mock(Logger.class);

try (MockedConstruction<CxWrapper> mocked =
Mockito.mockConstruction(CxWrapper.class,
(mock, context) -> when(mock.authValidate()).thenReturn("SUCCESS"));
MockedStatic<CxLogger> mockedCxLogger = Mockito.mockStatic(CxLogger.class)) {

Authenticator authenticator = new Authenticator(mockLogger);

String result = authenticator.doAuthentication("dummyKey", "--param");
String result = Authenticator.INSTANCE.doAuthentication("dummyKey", "--param");

assertEquals("SUCCESS", result);
mockedCxLogger.verify(() -> CxLogger.info(String.format(PluginConstants.INFO_AUTHENTICATION_STATUS, "SUCCESS")));
Expand All @@ -41,17 +40,14 @@ void testDoAuthenticationSuccess() throws Exception {
@Test
void testDoAuthenticationIOException() throws Exception {

Logger mockLogger = mock(Logger.class);

try (MockedConstruction<CxWrapper> mocked =
Mockito.mockConstruction(CxWrapper.class,
(mock, context) -> when(mock.authValidate())
.thenThrow(new IOException("IO error")));
MockedStatic<CxLogger> mockedCxLogger = Mockito.mockStatic(CxLogger.class)) {

Authenticator authenticator = new Authenticator(mockLogger);

String result = authenticator.doAuthentication("dummyKey", "--param");
String result = Authenticator.INSTANCE.doAuthentication("dummyKey", "--param");

assertEquals("IO error", result);
mockedCxLogger.verify(() -> CxLogger.error(
Expand All @@ -64,17 +60,14 @@ void testDoAuthenticationIOException() throws Exception {
@Test
void testDoAuthenticationInterruptedException() throws Exception {

Logger mockLogger = mock(Logger.class);

try (MockedConstruction<CxWrapper> mocked =
Mockito.mockConstruction(CxWrapper.class,
(mock, context) -> when(mock.authValidate())
.thenThrow(new InterruptedException("Interrupted")));
MockedStatic<CxLogger> mockedCxLogger = Mockito.mockStatic(CxLogger.class)) {

Authenticator authenticator = new Authenticator(mockLogger);

String result = authenticator.doAuthentication("dummyKey", "--param");
String result = Authenticator.INSTANCE.doAuthentication("dummyKey", "--param");

assertEquals("Interrupted", result);
mockedCxLogger.verify(() -> CxLogger.error(
Expand All @@ -87,17 +80,13 @@ void testDoAuthenticationInterruptedException() throws Exception {
@Test
void testDoAuthenticationCxException() throws Exception {

Logger mockLogger = mock(Logger.class);

try (MockedConstruction<CxWrapper> mocked =
Mockito.mockConstruction(CxWrapper.class,
(mock, context) -> when(mock.authValidate())
.thenThrow(new CxException(1, "Cx error")));
MockedStatic<CxLogger> mockedCxLogger = Mockito.mockStatic(CxLogger.class)) {

Authenticator authenticator = new Authenticator(mockLogger);

String result = authenticator.doAuthentication("dummyKey", "--param");
String result = Authenticator.INSTANCE.doAuthentication("dummyKey", "--param");

assertEquals("Cx error", result);
mockedCxLogger.verify(() -> CxLogger.error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void testAreCredentialsDefinedTrue() {

try (MockedStatic<Preferences> prefs = Mockito.mockStatic(Preferences.class)) {

prefs.when(Preferences::getApiKey).thenReturn("apikey");
prefs.when(Preferences::isAuthenticated).thenReturn(true);

boolean result = PluginUtils.areCredentialsDefined();

Expand All @@ -180,7 +180,7 @@ void testAreCredentialsDefinedFalse() {

try (MockedStatic<Preferences> prefs = Mockito.mockStatic(Preferences.class)) {

prefs.when(Preferences::getApiKey).thenReturn("");
prefs.when(Preferences::isAuthenticated).thenReturn(false);

boolean result = PluginUtils.areCredentialsDefined();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package checkmarx.ast.eclipse.plugin.tests.unit.wrapper;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

import java.util.concurrent.atomic.AtomicReference;

import org.junit.jupiter.api.Test;
import org.mockito.MockedConstruction;

import com.checkmarx.ast.wrapper.CxConfig;
import com.checkmarx.ast.wrapper.CxWrapper;
import com.checkmarx.eclipse.common.preferences.Preferences;
import com.checkmarx.eclipse.common.wrapper.CxWrapperFactory;

class CxWrapperFactoryTest {

@Test
void testBuildWithNoArgs_usesSavedPreferencesAndStampsAgentName() throws Exception {
AtomicReference<CxConfig> capturedConfig = new AtomicReference<>();

try (MockedConstruction<CxWrapper> mocked = mockConstruction(CxWrapper.class,
(mock, context) -> capturedConfig.set((CxConfig) context.arguments().get(0)));
var mockedPreferences = mockStatic(Preferences.class)) {

mockedPreferences.when(Preferences::getApiKey).thenReturn("saved-api-key");
mockedPreferences.when(Preferences::getAdditionalOptions).thenReturn("--saved-param");

CxWrapperFactory.build();

assertEquals(1, mocked.constructed().size());
CxConfig config = capturedConfig.get();
assertNotNull(config);
assertEquals("saved-api-key", config.getApiKey());
assertEquals("--saved-param", String.join(" ", config.getAdditionalParameters()));
assertNotNull(config.getAgentName());
assertTrue(config.getAgentName().startsWith("Eclipse_"),
"Agent name should be stamped as Eclipse_<version>, was: " + config.getAgentName());
}
}

@Test
void testBuildWithExplicitCredentials_doesNotUseSavedPreferences() throws Exception {
AtomicReference<CxConfig> capturedConfig = new AtomicReference<>();

try (MockedConstruction<CxWrapper> mocked = mockConstruction(CxWrapper.class,
(mock, context) -> capturedConfig.set((CxConfig) context.arguments().get(0)));
var mockedPreferences = mockStatic(Preferences.class)) {

CxWrapperFactory.build("typed-api-key", "--typed-param");

assertEquals(1, mocked.constructed().size());
CxConfig config = capturedConfig.get();
assertNotNull(config);
assertEquals("typed-api-key", config.getApiKey());
assertEquals("--typed-param", String.join(" ", config.getAdditionalParameters()));
assertTrue(config.getAgentName().startsWith("Eclipse_"));

mockedPreferences.verifyNoInteractions();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package checkmarx.ast.eclipse.plugin.tests.unit.wrapper;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

import java.util.List;

import org.junit.jupiter.api.Test;
import org.mockito.MockedConstruction;

import com.checkmarx.ast.project.Project;
import com.checkmarx.ast.wrapper.CxWrapper;
import com.checkmarx.eclipse.common.wrapper.WrapperProvider;

class WrapperProviderTest {

private final WrapperProvider wrapperProvider = new WrapperProvider();

@Test
void testIsAiMcpServerEnabled_forwardsCredentialsAndReturnsWrapperResult() throws Exception {
try (MockedConstruction<CxWrapper> mocked = mockConstruction(CxWrapper.class,
(mock, context) -> when(mock.aiMcpServerEnabled()).thenReturn(true))) {

boolean result = wrapperProvider.isAiMcpServerEnabled("api-key", "--param");

assertTrue(result);
assertEquals(1, mocked.constructed().size());
}
}

@Test
void testIsAiMcpServerEnabled_propagatesFalseWhenDisabled() throws Exception {
try (MockedConstruction<CxWrapper> mocked = mockConstruction(CxWrapper.class,
(mock, context) -> when(mock.aiMcpServerEnabled()).thenReturn(false))) {

boolean result = wrapperProvider.isAiMcpServerEnabled("api-key", "--param");

assertFalse(result);
}
}

@Test
void testGetProjects_forwardsLimitAndReturnsWrapperResult() throws Exception {
Project mockProject = mock(Project.class);
try (MockedConstruction<CxWrapper> mocked = mockConstruction(CxWrapper.class,
(mock, context) -> when(mock.projectList("limit=10")).thenReturn(List.of(mockProject)))) {

List<Project> projects = wrapperProvider.getProjects("limit=10");

assertEquals(1, projects.size());
assertSame(mockProject, projects.get(0));
}
}

@Test
void testTriageGetStates_propagatesExceptionFromWrapper() throws Exception {
try (MockedConstruction<CxWrapper> mocked = mockConstruction(CxWrapper.class,
(mock, context) -> when(mock.triageGetStates(false)).thenThrow(new RuntimeException("boom")))) {

assertThrows(RuntimeException.class, () -> wrapperProvider.triageGetStates(false));
}
}
}
3 changes: 2 additions & 1 deletion checkmarx-ast-eclipse-plugin/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Expand All @@ -12,7 +13,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="../common-lib/lib/ast-cli-java-wrapper-2.4.24.jar"/>
<classpathentry exported="true" kind="lib" path="../common-lib/lib/ast-cli-java-wrapper-2.4.27.jar"/>
<classpathentry kind="lib" path="../common-lib/lib/commons-lang3-3.18.0.jar"/>
<classpathentry kind="lib" path="../common-lib/lib/jackson-core-2.21.4.jar"/>
<classpathentry kind="lib" path="../common-lib/lib/jackson-databind-2.21.5.jar"/>
Expand Down
2 changes: 0 additions & 2 deletions checkmarx-ast-eclipse-plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ Import-Package: org.eclipse.core.resources,
Bundle-ActivationPolicy: lazy
Bundle-Activator: com.checkmarx.eclipse.Activator
Export-Package: com.checkmarx.eclipse.enums,
com.checkmarx.eclipse.properties,
com.checkmarx.eclipse.utils
Bundle-ClassPath: .,
lib/org.eclipse.mylyn.commons.ui_4.9.0.v20251121-0615.jar,
lib/org-eclipse-mylyn-commons-core.jar

2 changes: 1 addition & 1 deletion checkmarx-ast-eclipse-plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<page
class="com.checkmarx.eclipse.common.preferences.CheckmarxPreferencePage"
id="com.checkmarx.eclipse.devassist.prefs.checkmarxpreferencepage"
name="Checkmarx Scanner Configuration"
name="Checkmarx One Assist"
category="com.checkmarx.eclipse.properties.preferencespage">
</page>
</extension>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.PlatformUI;
import org.apache.commons.lang3.StringUtils;
import com.checkmarx.ast.results.result.Node;
import com.checkmarx.ast.results.result.Result;
import com.checkmarx.eclipse.enums.ActionName;
Expand Down Expand Up @@ -155,12 +154,12 @@ public static IEventBroker getEventBroker() {
}

/**
* Check if checkmarx credentials are defined in the Preferences
*
* Check if the user is currently authenticated to Checkmarx One.
*
* @return
*/
public static boolean areCredentialsDefined() {
return StringUtils.isNotBlank(Preferences.getApiKey());
return Preferences.isAuthenticated();
}

/**
Expand Down
Loading
Loading