Skip to content

Commit aa7473b

Browse files
authored
Merge pull request #48 from gdgd009xcd/ARCADIUS241220
## [v1.2.4] - 2024-12-25
2 parents f787e88 + 3c1164e commit aa7473b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1024
-541
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The add-on is built with [Gradle]: https://gradle.org/
4848

4949
To download & build this addon, simply run:
5050

51-
$ git clone https://github.com/gdgd009xcd/RequestRecorder.git
51+
$ git clone https://github.com/gdgd009xcd/RequestRecorder.git
5252
$ cd RequestRecorder/
5353
$ ./gradlew addOns:requestRecorderForZAP:jarZapAddOn
5454

addOns/requestRecorderForZAP/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ All notable changes to this add-on will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

6+
## [v1.2.4] - 2024-12-25
7+
### Changed
8+
- maintenance: code was changed to prepare for new java version and ubuntu 24.04
9+
- maintenance: reduced noisy log message in the console.
10+
611
## [v1.2.3] - 2024-12-17
712
### Changed
813
- maintenance: code was changed to prepare for new java version and ubuntu 24.04

addOns/requestRecorderForZAP/requestRecorderForZAP.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import org.zaproxy.gradle.addon.AddOnStatus
22

3-
version = "1.2.3"
3+
version = "1.2.4"
44
description = "RequestRecorder for ZAP"
55

66
tasks.withType<JavaCompile> {

addOns/requestRecorderForZAP/src/main/java/org/zaproxy/zap/extension/automacrobuilder/AppParmsIni.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public void clearLastAppValueNOCOUNT() {
421421
int plast = parmlist.size() - 1;
422422
if (plast >= 0) {
423423
AppValue av = parmlist.get(plast);
424-
av.clearNoCount();
424+
av.clearNoCountExported();
425425
parmlist.set(plast, av);
426426
}
427427
}

addOns/requestRecorderForZAP/src/main/java/org/zaproxy/zap/extension/automacrobuilder/AppValue.java

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//
3131
// class AppValue
3232
//
33-
public final class AppValue {
33+
public class AppValue {
3434
private static org.apache.logging.log4j.Logger LOGGER4J =
3535
org.apache.logging.log4j.LogManager.getLogger();
3636

@@ -160,7 +160,7 @@ public AppValue() {
160160
resRegexPos = -1;
161161
}
162162

163-
public AppValue(String _Type, boolean _disabled, String _value) {
163+
AppValue(String _Type, boolean _disabled, String _value) {
164164
initctype();
165165
setValPart(_Type);
166166
setEnabled(!_disabled); // NOT
@@ -221,9 +221,9 @@ public AppValue(
221221
setEnabled(!_disabled); // NOT
222222
// value = _value;
223223
setVal(_value);
224-
setresURL(_resURL);
224+
setResURL(_resURL);
225225
setresRegex(_resRegex);
226-
setresPartType(_resPartType);
226+
setResPartType(_resPartType);
227227
setResRegexPosFromString(_resRegexPos);
228228
token = _token;
229229
urlencode = _urlenc;
@@ -372,10 +372,14 @@ public boolean isEnabled() {
372372
return enabled;
373373
}
374374

375-
public void setEnabled(boolean b) {
375+
private void setEnabled(boolean b) {
376376
enabled = b;
377377
}
378378

379+
public void setEnabledExported(boolean b) {
380+
setEnabled(b);
381+
}
382+
379383
/**
380384
* Get ResEncodeTypes : response page content type JSON/RAW/URLENCODE..
381385
*
@@ -437,7 +441,7 @@ String QUOTE_PREFCOMMA(String t) {
437441
return "";
438442
}
439443

440-
public void setresURL(String _url) {
444+
private void setResURL(String _url) {
441445
if (_url == null) _url = "";
442446
resURL = _url.trim();
443447
try {
@@ -448,6 +452,10 @@ public void setresURL(String _url) {
448452
}
449453
}
450454

455+
public void setResURLExported(String _url) {
456+
setResURL(_url);
457+
}
458+
451459
public String getresURL() {
452460
return resURL;
453461
}
@@ -478,7 +486,7 @@ public void setresRegexURLencoded(String _regex) {
478486
setresRegex(ParmGenUtil.URLdecode(_regex, JSONFileIANACharsetName));
479487
}
480488

481-
public void setresRegex(String _regex) {
489+
private void setresRegex(String _regex) {
482490
if (_regex == null) _regex = "";
483491
resRegex = _regex;
484492
try {
@@ -494,7 +502,7 @@ public void setresRegex(String _regex) {
494502
*
495503
* @param _regex
496504
*/
497-
public void setCondRegex(String _regex) {
505+
private void setCondRegex(String _regex) {
498506
if (_regex == null) _regex = "";
499507
this.condRegex = _regex;
500508
try {
@@ -587,11 +595,15 @@ public void setReplaceZeroSize(boolean b) {
587595
this.replaceZeroSize = b;
588596
}
589597

590-
public void setresPartType(String respart) {
598+
private void setResPartType(String respart) {
591599
if (respart == null) respart = "";
592600
resPartType = parseValPartType(respart);
593601
}
594602

603+
public void setResPartTypeExported(String respart) {
604+
setResPartType(respart);
605+
}
606+
595607
/**
596608
* Get resRegexPos value
597609
*
@@ -615,14 +627,18 @@ public void setResRegexPos(int resRegexPos) {
615627
*
616628
* @param _resregexpos
617629
*/
618-
public void setResRegexPosFromString(String _resregexpos) {
630+
private void setResRegexPosFromString(String _resregexpos) {
619631
this.resRegexPos = Integer.parseInt(_resregexpos);
620632
}
621633

622-
public int getTypeInt() {
634+
private int getTypeInt() {
623635
return valparttype & C_VTYPE;
624636
}
625637

638+
public int getTypeIntExported() {
639+
return getTypeInt();
640+
}
641+
626642
public void setTypeInt(int t) {
627643
valparttype = t;
628644
}
@@ -709,7 +725,11 @@ public static int parseValPartType(String _valtype) {
709725
return _valparttype;
710726
}
711727

712-
public boolean setValPart(String _valtype) {
728+
public boolean setValPartExported(String _valtype) {
729+
return setValPart(_valtype);
730+
}
731+
732+
private boolean setValPart(String _valtype) {
713733
boolean noerror = false;
714734
valparttype = parseValPartType(_valtype);
715735
//
@@ -730,14 +750,22 @@ public boolean setValPart(String _valtype) {
730750
return noerror;
731751
}
732752

733-
void setNoCount() {
753+
private void setNoCount() {
734754
valparttype = valparttype | C_NOCOUNT;
735755
}
736756

737-
public void clearNoCount() {
757+
public void setNoCountExported() {
758+
setNoCount();
759+
}
760+
761+
private void clearNoCount() {
738762
valparttype = valparttype & ~C_NOCOUNT;
739763
}
740764

765+
public void clearNoCountExported() {
766+
clearNoCount();
767+
}
768+
741769
public boolean isNoCount() {
742770
return ((valparttype & C_NOCOUNT) == C_NOCOUNT ? true : false);
743771
}
@@ -757,7 +785,7 @@ public boolean setURLencodedVal(String _value) {
757785
return noerror;
758786
}
759787

760-
void setVal(String _value) {
788+
private void setVal(String _value) {
761789
valueregex = null;
762790
value = _value;
763791
if (value != null) {

addOns/requestRecorderForZAP/src/main/java/org/zaproxy/zap/extension/automacrobuilder/LineWrapRenderer.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,16 @@
2424
* @author gdgd009xcd
2525
*/
2626
@SuppressWarnings("serial")
27-
public final class LineWrapRenderer extends JTextArea implements TableCellRenderer {
27+
public class LineWrapRenderer extends JTextArea implements TableCellRenderer {
2828
private static org.apache.logging.log4j.Logger LOGGER4J =
2929
org.apache.logging.log4j.LogManager.getLogger();
3030

31-
public LineWrapRenderer() {
31+
/**
32+
* Constructor for the LineWrapRenderer class.<br>
33+
* this constructor is package-private.<br>
34+
* this means that this class can be instantiated only in this package.
35+
*/
36+
LineWrapRenderer() {
3237
super();
3338
setLineWrap(true);
3439
}

addOns/requestRecorderForZAP/src/main/java/org/zaproxy/zap/extension/automacrobuilder/OneThreadProcessor.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @author gdgd009xcd
2525
*/
26-
public final class OneThreadProcessor {
26+
public class OneThreadProcessor {
2727
private static org.apache.logging.log4j.Logger LOGGER4J =
2828
org.apache.logging.log4j.LogManager.getLogger();
2929
final Level DEBUGPROCESS = Level.getLevel("DEBUGPROCESS");
@@ -41,15 +41,16 @@ public final class OneThreadProcessor {
4141
private Object optdata = null;
4242

4343
/**
44-
* Newly create doaction.
45-
*
46-
* <p>it call void startAction(ThreadManager tm, OneThreadProcessor otp)
44+
* Newly create doaction.<br>
45+
* this constructor is package-private.<br>
46+
* this means that this class can be instantiated only in this package.<br>
47+
* this calls void startAction(ThreadManager tm, OneThreadProcessor otp)
4748
*
4849
* @param tm
4950
* @param th
5051
* @param provider
5152
*/
52-
public OneThreadProcessor(ThreadManager tm, Thread th, InterfaceDoActionProvider provider) {
53+
OneThreadProcessor(ThreadManager tm, Thread th, InterfaceDoActionProvider provider) {
5354
this.doaction = provider.getDoActionInstance();
5455
this.seqno = provider.getSequnceNo();
5556
this.th = th;

addOns/requestRecorderForZAP/src/main/java/org/zaproxy/zap/extension/automacrobuilder/ParmGen.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ PRequest ParseRequest(
8080
LOGGER4J.debug("method[" + method + "] request[" + url + "]");
8181
int qpos = -1;
8282
String[] nvcont = null;
83-
switch (av.getTypeInt()) {
83+
switch (av.getTypeIntExported()) {
8484
// switch(av.valparttype & AppValue.C_VTYPE){
8585
case AppValue.V_PATH: // path
8686
// path = url
@@ -212,13 +212,13 @@ PRequest ParseRequest(
212212
LOGGER4J.trace(" Original body[" + content + "]");
213213
LOGGER4J.trace(" Modified body[" + n_content + "]");
214214
try {
215-
_contarray.initParmGenBinUtil(
215+
_contarray.initParmGenBinUtilExported(
216216
n_content.getBytes(
217217
requestBodyEncode.getIANACharsetName()));
218218
} catch (UnsupportedEncodingException ex) {
219219
Logger.getLogger(ParmGen.class.getName())
220220
.log(Level.SEVERE, null, ex);
221-
_contarray.initParmGenBinUtil(n_content.getBytes());
221+
_contarray.initParmGenBinUtilExported(n_content.getBytes());
222222
}
223223
if (org_request != null
224224
&& org_content_iso8859 != null
@@ -367,7 +367,7 @@ PRequest ParseRequest(
367367

368368
if (partupdt) {
369369
// _contarray = n_array;
370-
_contarray.initParmGenBinUtil(n_array.getBytes());
370+
_contarray.initParmGenBinUtilExported(n_array.getBytes());
371371
if (org_content_isupdated) {
372372
if (org_request != null
373373
&& org_content_iso8859 != null

addOns/requestRecorderForZAP/src/main/java/org/zaproxy/zap/extension/automacrobuilder/ParmGenBinUtil.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
// ByteArray
1111
//
12-
public final class ParmGenBinUtil {
12+
public class ParmGenBinUtil {
1313

1414
private ByteArrayOutputStream bstream = null;
1515

@@ -21,9 +21,13 @@ public ParmGenBinUtil(byte[] bin) {
2121
initParmGenBinUtil(bin);
2222
}
2323

24-
public void initParmGenBinUtil(byte[] bin) {
24+
private void initParmGenBinUtil(byte[] bin) {
2525
bstream = new ByteArrayOutputStream();
26-
concat(bin);
26+
concatInternal(bin);
27+
}
28+
29+
public void initParmGenBinUtilExported(byte[] bin) {
30+
initParmGenBinUtil(bin);
2731
}
2832

2933
public int length() {
@@ -36,7 +40,7 @@ public int length() {
3640
* @param bin
3741
* @return
3842
*/
39-
public boolean concat(byte[] bin) {
43+
private boolean concatInternal(byte[] bin) {
4044

4145
if ((bin == null)) {
4246
return false;
@@ -51,6 +55,10 @@ public boolean concat(byte[] bin) {
5155
return true;
5256
}
5357

58+
public boolean concat(byte[] bin) {
59+
return concatInternal(bin);
60+
}
61+
5462
public byte[] getBytes() {
5563
if (bstream == null) {
5664
return null;

0 commit comments

Comments
 (0)