Skip to content

Commit 604979f

Browse files
committed
Merge origin/master
2 parents f46e7a1 + c0c5a87 commit 604979f

35 files changed

Lines changed: 3392 additions & 1797 deletions

source/pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<!-- <appium.version>7.2.0</appium.version>-->
6060
<appium.version>8.6.0</appium.version>
6161
<!-- <selenium.version>3.141.59</selenium.version>-->
62-
<selenium.version>4.19.0</selenium.version>
62+
<selenium.version>4.41.0</selenium.version>
6363
<jna.version>4.1.0</jna.version>
6464
<!-- quartz -->
6565
<quartz.version>2.3.2</quartz.version>
@@ -429,6 +429,17 @@
429429
<version>1.9.0</version>
430430
</dependency>
431431
<!--end of IA dependencies-->
432+
<!-- Source: https://mvnrepository.com/artifact/com.iabgpp/iabgpp-core -->
433+
<dependency>
434+
<groupId>com.iabgpp</groupId>
435+
<artifactId>iabgpp-encoder</artifactId>
436+
<version>3.2.5</version>
437+
</dependency>
438+
<dependency>
439+
<groupId>com.iabgpp</groupId>
440+
<artifactId>iabgpp-extras-jackson</artifactId>
441+
<version>3.2.5</version>
442+
</dependency>
432443
<dependency>
433444
<groupId>javax</groupId>
434445
<artifactId>javaee-web-api</artifactId>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Cerberus Copyright (C) 2013 - 2025 cerberustesting
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This file is part of Cerberus.
6+
*
7+
* Cerberus is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* Cerberus is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with Cerberus. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.cerberus.core.api.controllers;
21+
22+
import com.fasterxml.jackson.annotation.JsonView;
23+
import com.fasterxml.jackson.databind.ObjectMapper;
24+
import com.iab.gpp.encoder.GppModel;
25+
import com.iab.gpp.encoder.section.TcfEuV2;
26+
import io.swagger.v3.oas.annotations.Operation;
27+
import io.swagger.v3.oas.annotations.Parameter;
28+
import io.swagger.v3.oas.annotations.tags.Tag;
29+
import lombok.AllArgsConstructor;
30+
import org.apache.logging.log4j.LogManager;
31+
import org.apache.logging.log4j.Logger;
32+
import org.cerberus.core.api.controllers.wrappers.ResponseWrapper;
33+
import org.cerberus.core.api.dto.views.View;
34+
import org.cerberus.core.api.services.PublicApiAuthenticationService;
35+
import org.cerberus.core.crud.entity.LogEvent;
36+
import org.cerberus.core.crud.service.ILogEventService;
37+
import org.cerberus.core.util.IabGppDecoder;
38+
import org.springframework.http.HttpStatus;
39+
import org.springframework.http.MediaType;
40+
import org.springframework.web.bind.annotation.*;
41+
42+
import javax.servlet.http.HttpServletRequest;
43+
import java.security.Principal;
44+
import java.util.*;
45+
46+
@AllArgsConstructor
47+
@Tag(name = "Utils", description = "Operations related to Utils")
48+
@RestController
49+
@RequestMapping(path = "/public/utils")
50+
public class UtilsController {
51+
52+
private static final String API_VERSION_1 = "X-API-VERSION=1";
53+
private static final String API_KEY = "X-API-KEY";
54+
private final PublicApiAuthenticationService apiAuthenticationService;
55+
private static final Logger LOG = LogManager.getLogger(UtilsController.class);
56+
private final ILogEventService logEventService;
57+
private final IabGppDecoder iapGppDecoder;
58+
59+
@GetMapping(path = "/decode-tcfeuv2", headers = {API_VERSION_1}, produces = MediaType.APPLICATION_JSON_VALUE)
60+
@Operation(
61+
summary = "Decode the TCFEuV2 section",
62+
description = "Decode only the TCFEuV2 (section 2) from an IAB GPP string and return JSON"
63+
)
64+
@JsonView(View.Public.GET.class)
65+
@ResponseStatus(HttpStatus.OK)
66+
public ResponseWrapper<Map<String, Object>> decodeTCFEuV2(
67+
@Parameter(description = "IAB GPP String")
68+
@RequestParam("iabgpp") String iabgpp,
69+
@RequestHeader(name = API_KEY, required = false) String apiKey,
70+
HttpServletRequest request,
71+
Principal principal) {
72+
73+
String login = this.apiAuthenticationService.authenticateLogin(principal, apiKey);
74+
logEventService.createForPublicCalls(
75+
"/public/utils/decode-tcfeuv2",
76+
"CALL-GET",
77+
LogEvent.STATUS_INFO,
78+
String.format("API /decode-tcfeuv2 called with URL: %s", request.getRequestURL()),
79+
request,
80+
login);
81+
82+
return ResponseWrapper.wrap(iapGppDecoder.decodeTcfEuV2(iabgpp));
83+
}
84+
85+
}
86+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* Cerberus Copyright (C) 2013 - 2025 cerberustesting
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This file is part of Cerberus.
6+
*
7+
* Cerberus is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* Cerberus is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with Cerberus. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.cerberus.core.util;
21+
22+
import com.iab.gpp.encoder.section.TcfEuV2;
23+
import org.apache.logging.log4j.LogManager;
24+
import org.apache.logging.log4j.Logger;
25+
import org.springframework.stereotype.Service;
26+
import com.iab.gpp.encoder.GppModel;
27+
28+
import java.util.HashMap;
29+
import java.util.Map;
30+
31+
@Service
32+
public class IabGppDecoder {
33+
34+
private static final Logger LOG = LogManager.getLogger(IabGppDecoder.class);
35+
36+
public Map<String, Object> decodeTcfEuV2(String iabgpp) {
37+
Map<String, Object> result = new HashMap<>();
38+
result.put("gppString", iabgpp);
39+
40+
try {
41+
GppModel gppModel = new GppModel(iabgpp);
42+
TcfEuV2 tcfEuV2Section = (TcfEuV2) gppModel.getSection(TcfEuV2.NAME);
43+
44+
Map<String, Object> tcfeuV2Data = new HashMap<>();
45+
if (tcfEuV2Section != null) {
46+
tcfeuV2Data.put("version", tcfEuV2Section.getVersion());
47+
tcfeuV2Data.put("consentLanguage", tcfEuV2Section.getConsentLanguage());
48+
tcfeuV2Data.put("cmpId", tcfEuV2Section.getCmpId());
49+
tcfeuV2Data.put("publisherCountryCode", tcfEuV2Section.getPublisherCountryCode());
50+
tcfeuV2Data.put("consentString", tcfEuV2Section.getVendorConsents());
51+
tcfeuV2Data.put("purposesAllowed", tcfEuV2Section.getLastUpdated());
52+
tcfeuV2Data.put("vendorsAllowed", tcfEuV2Section.getVendorsAllowed());
53+
} else {
54+
tcfeuV2Data.put("error", "TCFEuV2 not present");
55+
}
56+
57+
result.put("tcfeuV2", tcfeuV2Data);
58+
} catch (IllegalArgumentException | ClassCastException e) {
59+
LOG.error("Failed to decode TCFEuV2 from GPP string: {}", iabgpp, e);
60+
Map<String, Object> error = new HashMap<>();
61+
error.put("error", "Invalid GPP string or TCFEuV2 section");
62+
result.put("tcfeuV2", error);
63+
} catch (Exception e) {
64+
LOG.error("Unexpected error decoding TCFEuV2", e);
65+
Map<String, Object> error = new HashMap<>();
66+
error.put("error", "Unexpected error decoding TCFEuV2");
67+
result.put("tcfeuV2", error);
68+
}
69+
70+
return result;
71+
}
72+
}

source/src/main/webapp/AppServiceList.jsp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
<h1 class="page-title-line" id="title">Service Library</h1>
4747

48-
<div class="crb_card">
48+
<div class="">
4949
<div id="soapLibraryList">
5050
<table id="soapLibrarysTable" class="table table-hover display"
5151
name="soapLibrarysTable"></table>
@@ -55,7 +55,6 @@
5555
<footer class="footer">
5656
<div class="container-fluid" id="footer"></div>
5757
</footer>
58-
</div>
5958
</main>
6059
</body>
6160
</html>

source/src/main/webapp/Environment.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
<h1 class="page-title-line" id="title">Environment</h1>
4646

47-
<div class="crb_card">
47+
<div class="">
4848
<div id="environmentList">
4949
<table id="environmentsTable" class="table table-hover display" name="environmentsTable"></table>
5050
<div class="marginBottom20"></div>

source/src/main/webapp/ImpactAnalysis.jsp

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -42,60 +42,30 @@
4242

4343
<h1 class="page-title-line" id="title">Impact Analysis</h1>
4444

45-
<div class="row">
46-
<div class="col-lg-12" id="FiltersPanel">
47-
<div class="crb_card">
48-
<div>
49-
<label class="input-group">
50-
<input class="form-control input-md" id="searchQ" name="searchQ" placeholder="Type any references here .... (xpath, variable, property,...)" onkeydown="searchKeyDown()">
51-
<span class="input-group-btn">
52-
<button type="button" class="btn btn-default input-md" id="btnEmpty" onclick="emptySearch()" name="btnEmpty">X</button>
53-
<button type="button" class="btn btn-default input-md" id="btnSearch" onclick="loadAllTables()" name="btnLoad">Search</button>
54-
</span>
55-
</label>
56-
</div>
57-
</div>
58-
</div>
45+
<!-- Test Cases Table (createDataTableWithPermissionsNew generates the header block) -->
46+
<div class="" id="tcList">
47+
<table id="tcTable" class="table table-hover display" name="tcTable"></table>
5948
</div>
6049

61-
<ul id="tabsIA" class="nav nav-tabs" data-tabs="tabs">
62-
<li class="active"><a data-toggle="tab" href="#tabTestCases" id="headerTabTestCases" name="tabTC">Test Cases</a>
63-
</li>
64-
<li style="display: none"><a data-toggle="tab" href="#tabDataLib" id="headerTabDataLib" name="tabDL">Data Libraries</a></li>
65-
<li style="display: none"><a data-toggle="tab" href="#tabApplications" id="headerTabApplications" name="tabAPP">Applications</a></li>
66-
<li style="display: none"><a data-toggle="tab" href="#tabServices" id="headerTabServices" name="tabSRV">Service Libraries</a></li>
67-
</ul>
68-
69-
<div class="tab-content">
70-
<div class="center tab-pane fade in active" id="tabTestCases">
71-
<div class="panel panel-default">
72-
<div class="panel-body" id="tcList">
73-
<table id="tcTable" class="table table-hover display" name="tcTable"></table>
74-
</div>
50+
<!-- Hidden tabs (kept for potential future use) -->
51+
<div style="display:none">
52+
<div id="tabDataLib">
53+
<div id="dlList">
54+
<table id="dlTable" class="table table-hover display" name="dlTable"></table>
7555
</div>
7656
</div>
77-
<div class="center tab-pane fade in" id="tabDataLib">
78-
<div class="panel panel-default">
79-
<div class="panel-body" id="dlList">
80-
<table id="dlTable" class="table table-hover display" name="dlTable"></table>
81-
</div>
57+
<div id="tabApplications">
58+
<div id="appList">
59+
<table id="appTable" class="table table-hover display" name="appTable"></table>
8260
</div>
8361
</div>
84-
<div class="center tab-pane fade in" id="tabApplications">
85-
<div class="panel panel-default">
86-
<div class="panel-body" id="appList">
87-
<table id="appTable" class="table table-hover display" name="appTable"></table>
88-
</div>
89-
</div>
90-
</div>
91-
<div class="center tab-pane fade in" id="tabServices">
92-
<div class="panel panel-default">
93-
<div class="panel-body" id="srvList">
94-
<table id="srvTable" class="table table-hover display" name="srvTable"></table>
95-
</div>
62+
<div id="tabServices">
63+
<div id="srvList">
64+
<table id="srvTable" class="table table-hover display" name="srvTable"></table>
9665
</div>
9766
</div>
9867
</div>
68+
9969
<footer class="footer">
10070
<div class="container-fluid" id="footer"></div>
10171
</footer>

0 commit comments

Comments
 (0)