Skip to content

Commit 218533e

Browse files
Merge branch 'main' into fix/AST-105531
2 parents a8ce506 + efd94e6 commit 218533e

File tree

10 files changed

+65
-37
lines changed

10 files changed

+65
-37
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,29 @@ jobs:
5151
chmod +x ./.github/scripts/update_cli.sh
5252
./.github/scripts/update_cli.sh ${{ inputs.cliTag }}
5353
54+
- name: Extract CLI version
55+
id: extract_cli_version
56+
run: |
57+
CLI_VERSION=$(./src/main/resources/cx-linux version | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+')
58+
echo "CLI version being packed is $CLI_VERSION"
59+
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
60+
echo "::set-output name=CLI_VERSION::$CLI_VERSION"
61+
62+
- name: Check if CLI version is latest
63+
if: ${{ github.event.inputs.dev == 'false' && !github.event.inputs.cliTag && github.ref == 'refs/heads/main' }}
64+
id: check_latest_cli_version
65+
run: |
66+
LATEST_CLI_VERSION=$(curl -s https://api.github.com/repos/Checkmarx/ast-cli/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
67+
echo "CLI_VERSION=[$CLI_VERSION]"
68+
echo "LATEST_CLI_VERSION=[$LATEST_CLI_VERSION]"
69+
echo "Latest CLI version from GitHub: $LATEST_CLI_VERSION"
70+
if [ "$CLI_VERSION" = "$LATEST_CLI_VERSION" ]; then
71+
echo "CLI_VERSION ($CLI_VERSION) matches the latest released version ($LATEST_CLI_VERSION). Proceeding."
72+
else
73+
echo "CLI_VERSION ($CLI_VERSION) does not match the latest released version ($LATEST_CLI_VERSION). Failing workflow."
74+
exit 1
75+
fi
76+
5477
- name: Tag
5578
id: set_tag_name
5679
run: |
@@ -77,7 +100,7 @@ jobs:
77100
with:
78101
java-version: '11'
79102
distribution: 'temurin'
80-
server-id: ossrh
103+
server-id: central
81104
server-username: MAVEN_USERNAME
82105
server-password: MAVEN_PASSWORD
83106
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
@@ -94,14 +117,6 @@ jobs:
94117
fi
95118
echo "AID_PROP=${prop}" >> $GITHUB_ENV
96119
97-
- name: Extract CLI version
98-
id: extract_cli_version
99-
run: |
100-
CLI_VERSION=$(./src/main/resources/cx-linux version | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+')
101-
echo "CLI version being packed is $CLI_VERSION"
102-
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
103-
echo "::set-output name=CLI_VERSION::$CLI_VERSION"
104-
105120
- name: Publish package
106121
run: mvn --batch-mode deploy -DskipTests ${{ env.AID_PROP }}
107122
env:
@@ -138,4 +153,4 @@ jobs:
138153
cli_version: ${{ needs.release.outputs.CLI_VERSION }}
139154
is_cli_release: false
140155
is_java_release: true
141-
secrets: inherit
156+
secrets: inherit

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Each line is a file pattern followed by one or more owners
33

44
# Specify the default owners for the entire repository
5-
* @greensd4 @AlvoBen @pedrompflopes
5+
* @cx-anurag-dalke @cx-anand-nandeshwar @cx-atish-jadhav

checkmarx-ast-cli.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.19
1+
2.3.28

pom.xml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,17 @@
165165
</executions>
166166
</plugin>
167167
<plugin>
168-
<groupId>org.sonatype.plugins</groupId>
169-
<artifactId>nexus-staging-maven-plugin</artifactId>
170-
<version>1.6.13</version>
168+
<groupId>org.sonatype.central</groupId>
169+
<artifactId>central-publishing-maven-plugin</artifactId>
170+
<version>0.8.0</version>
171171
<extensions>true</extensions>
172172
<configuration>
173-
<serverId>ossrh</serverId>
174-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
175-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
176-
<stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
173+
<publishingServerId>central</publishingServerId>
174+
<autoPublish>true</autoPublish> <!-- Optional -->
177175
</configuration>
178176
</plugin>
177+
178+
179179
<plugin>
180180
<groupId>org.apache.maven.plugins</groupId>
181181
<artifactId>maven-gpg-plugin</artifactId>
@@ -199,17 +199,15 @@
199199
</plugins>
200200
</build>
201201

202+
202203
<distributionManagement>
203-
<snapshotRepository>
204-
<id>ossrh</id>
205-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
206-
</snapshotRepository>
207204
<repository>
208-
<id>ossrh</id>
209-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
205+
<id>central</id>
206+
<url>https://central.sonatype.com/api/v1/publish</url>
210207
</repository>
211208
</distributionManagement>
212209

210+
213211
<licenses>
214212
<license>
215213
<name>MIT License</name>
@@ -230,8 +228,8 @@
230228

231229
<developers>
232230
<developer>
233-
<name>Jay Nanduri</name>
234-
<email>jay.nanduri@checkmarx.com</email>
231+
<name>Anand Nandeshwar</name>
232+
<email>anand.nandeshwar@checkmarx.com</email>
235233
<organization>Checkmarx</organization>
236234
<organizationUrl>https://www.checkmarx.com/</organizationUrl>
237235
</developer>

src/main/java/com/checkmarx/ast/results/result/ScaPackageData.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,26 @@ public class ScaPackageData {
2020
boolean outdated;
2121
boolean supportsQuickFix;
2222
String typeOfDependency;
23+
boolean isDevelopmentDependency;
24+
boolean isTestDependency;
2325

2426

2527
public ScaPackageData(@JsonProperty("Id") String id,
2628
@JsonProperty("fixLink") String fixLink,
2729
@JsonProperty("dependencyPaths") List<List<DependencyPath>> dependencyPaths,
2830
@JsonProperty("outdated") boolean outdated,
2931
@JsonProperty("supportsQuickFix") boolean supportsQuickFix,
30-
@JsonProperty("typeOfDependency") String typeOfDependency) {
32+
@JsonProperty("typeOfDependency") String typeOfDependency,
33+
@JsonProperty("isDevelopmentDependency") boolean isDevelopmentDependency,
34+
@JsonProperty("isTestDependency") boolean isTestDependency) {
3135

3236
Id = id;
3337
this.fixLink = fixLink;
3438
this.dependencyPaths = dependencyPaths;
3539
this.outdated = outdated;
3640
this.supportsQuickFix = supportsQuickFix;
3741
this.typeOfDependency = typeOfDependency;
42+
this.isDevelopmentDependency = isDevelopmentDependency;
43+
this.isTestDependency = isTestDependency;
3844
}
3945
}

src/main/java/com/checkmarx/ast/wrapper/CxConfig.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import lombok.Data;
66
import lombok.Setter;
77
import org.apache.commons.lang3.StringUtils;
8+
89
import java.util.ArrayList;
910
import java.util.List;
1011
import java.util.regex.Matcher;
@@ -33,7 +34,15 @@ public void setAdditionalParameters(String additionalParameters) {
3334
List<String> toArguments() {
3435
List<String> commands = new ArrayList<>();
3536

36-
if (StringUtils.isNotBlank(getApiKey())) {
37+
if (StringUtils.isNotBlank(getClientId()) && StringUtils.isNotBlank(getApiKey())) {
38+
/*
39+
* Added dynamic client-id support for refresh_token grant flow
40+
*/
41+
commands.add(CxConstants.CLIENT_ID);
42+
commands.add(getClientId());
43+
commands.add(CxConstants.API_KEY);
44+
commands.add(getApiKey());
45+
} else if (StringUtils.isNotBlank(getApiKey())) {
3746
commands.add(CxConstants.API_KEY);
3847
commands.add(getApiKey());
3948
} else if (StringUtils.isNotBlank(getClientId()) && StringUtils.isNotBlank(getClientSecret())) {

src/main/resources/cx-linux

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:9eae11d84cb766a5df14ce5e9d57013268f3d687484cf2a4d67595c419a4a762
3-
size 73937080
2+
oid sha256:1d2436e1fef7dd4841a003697702e52e2cdc3f3fba74e2196cebe5d7992f9d4f
3+
size 76206264

src/main/resources/cx-linux-arm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:d8aadaf3d739ad13957ec37b5afe462fd824283adb53cf8e4c2c4b1b048348d9
3-
size 70582456
2+
oid sha256:e41b066ccc5dd4281a134518b3ece5ac6c17f229c9a7844493371ac3936a94a4
3+
size 72745144

src/main/resources/cx-mac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:68cb8baeb6eb68cff07440c2dd142b5a3cf53b2d12c4ca98dd01d0a95a4f9370
3-
size 148816000
2+
oid sha256:4764f25769b820906cf09c6b3281f2b1df7c021f9063aef983f2aac0c48e39bc
3+
size 153324992

src/main/resources/cx.exe

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:b073010a1e360028fcc2eee56d1a7376be36459a2ea1a27c0a516a227a334943
3-
size 75835264
2+
oid sha256:7968c2c1ec4e6264e91324f649f2bb44db04e53ce20f90f3a77c56abf2525664
3+
size 78184384

0 commit comments

Comments
 (0)