Skip to content

Commit 5edbbb2

Browse files
committed
- Updated copyright years for 2024 in license headers
- Replaced javax.xml.bind.* with jakarta.xml.bind.* imports due to upgrade to JAXB 4.0.0 - Replaced javax.ws.rs.* with jakarta.ws.rs.* imports due to upgrade to JAX-RS 3.0.0 (Jakarta Rest-API) - Added GeoXACML content type support - Upgraded Javax.servlet-api to Jakarta.servlet-api: 5.0. - Upgraded Tomcat used in tests: 10.1.18 - Upgraded dependency authzforce-ce-rest-api-model: 7.0.0 - Upgraded dependency authzforce-ce-jaxrs-utils: 3.0.0 - Removed logback-ext-spring dependency - Upgraded dependency jettison: 1.5.4 - Upgraded dependency FastInfoset: 2.1.1 - Upgraded parent project authzforce-ce-parent: 9.1.0 - Upgraded dependency authzforce-ce-core-pap-dao-flat-file: 15.0.0
1 parent d004af1 commit 5edbbb2

49 files changed

Lines changed: 796 additions & 419 deletions

File tree

Some content is hidden

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

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.ow2.authzforce</groupId>
66
<artifactId>authzforce-ce-parent</artifactId>
7-
<version>8.2.1</version>
7+
<version>9.1.0</version>
88
</parent>
99
<artifactId>authzforce-ce-server</artifactId>
1010
<!-- FIWARE Versioning + Version must be equal or higher than 'authzforce-ce-rest-api-model' dependency in 'rest-service' module -->
@@ -15,10 +15,10 @@
1515
<url>${project.url}</url>
1616
<properties>
1717
<git.url.base>https://github.com/authzforce/server</git.url.base>
18-
<authzforce-ce-core.version>20.1.0</authzforce-ce-core.version>
19-
<authzforce-ce-core-pap-api.version>12.0.0</authzforce-ce-core-pap-api.version>
18+
<authzforce-ce-core.version>21.0.1</authzforce-ce-core.version>
19+
<authzforce-ce-core-pap-api.version>13.0.0</authzforce-ce-core-pap-api.version>
2020
<!-- Version must be compatible with authzforce-ce-core and authzforce-ce-core-pap-api versions above. -->
21-
<authzforce-ce-pap-dao-flat-file.version>14.0.0</authzforce-ce-pap-dao-flat-file.version>
21+
<authzforce-ce-pap-dao-flat-file.version>15.0.0</authzforce-ce-pap-dao-flat-file.version>
2222
<productId>authzforce-ce-server</productId>
2323
<productName>AuthzForce CE Server</productName>
2424
<productMaintainer>THALES</productMaintainer>

rest-service/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
</scm>
2020
<dependencies>
2121
<dependency>
22-
<groupId>javax.servlet</groupId>
23-
<artifactId>javax.servlet-api</artifactId>
22+
<groupId>jakarta.servlet</groupId>
23+
<artifactId>jakarta.servlet-api</artifactId>
2424
<scope>provided</scope>
2525
</dependency>
2626
<dependency>
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>${project.groupId}</groupId>
3232
<artifactId>${artifactId.prefix}-rest-api-model</artifactId>
33-
<version>6.0.0</version>
33+
<version>7.0.0</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>${project.groupId}</groupId>
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>org.ow2.authzforce</groupId>
4141
<artifactId>authzforce-ce-jaxrs-utils</artifactId>
42-
<version>2.0.3</version>
42+
<version>3.0.0</version>
4343
</dependency>
4444
<dependency>
4545
<groupId>com.github.spotbugs</groupId>

rest-service/src/main/java/org/ow2/authzforce/rest/service/jaxrs/DomainResourceImpl.java

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2022 THALES.
2+
* Copyright (C) 2012-2024 THALES.
33
*
44
* This file is part of AuthzForce CE.
55
*
@@ -36,8 +36,8 @@
3636
import org.w3._2005.atom.Link;
3737
import org.w3._2005.atom.Relation;
3838

39-
import javax.ws.rs.*;
40-
import javax.ws.rs.core.Response.Status;
39+
import jakarta.ws.rs.*;
40+
import jakarta.ws.rs.core.Response.Status;
4141
import javax.xml.datatype.DatatypeConfigurationException;
4242
import javax.xml.datatype.DatatypeFactory;
4343
import java.io.IOException;
@@ -141,7 +141,7 @@ public Domain getDomain()
141141
{
142142
// Links to child resources (properties, pap, pdp)
143143
// domain properties link
144-
final Link propsLink = new Link();
144+
145145
// For the link, get Path annotation of corresponding method
146146
final Path propsResourcePath;
147147
try
@@ -153,12 +153,9 @@ public Domain getDomain()
153153
throw new InternalServerErrorException("Error getting the 'properties' resource of domain '" + domainId + "'", e);
154154
}
155155

156-
propsLink.setHref(propsResourcePath.value());
157-
propsLink.setTitle("Domain properties");
158-
propsLink.setRel(Relation.ITEM);
156+
final Link propsLink = new Link(Relation.ITEM, null, propsResourcePath.value(), null, "Domain properties", null, null);
159157

160158
// PAP link
161-
final Link papLink = new Link();
162159
// For the link, get Path annotation of getPap method
163160
final Path papResourcePath;
164161
try
@@ -170,12 +167,9 @@ public Domain getDomain()
170167
throw new InternalServerErrorException("Error getting the 'pap' resource of domain '" + domainId + "'", e);
171168
}
172169

173-
papLink.setHref(papResourcePath.value());
174-
papLink.setTitle("Policy Administration Point");
175-
papLink.setRel(Relation.ITEM);
170+
final Link papLink = new Link(Relation.ITEM, null, papResourcePath.value(), null, "Policy Administration Point", null, null);
176171

177172
// PDP link
178-
final Link pdpLink = new Link();
179173
// For the link, get Path annotation of getPap method
180174
final Path pdpResourcePath;
181175
try
@@ -187,15 +181,12 @@ public Domain getDomain()
187181
throw new InternalServerErrorException("Error getting the 'pdp' resource of domain '" + domainId + "'", e);
188182
}
189183

190-
pdpLink.setHref(pdpResourcePath.value());
191-
pdpLink.setTitle("Policy Decision Point");
192-
193184
/*
194185
* Conformance with test assertion 'urn:oasis:names:tc:xacml:3.0:profile:rest:assertion:home:pdp' of REST Profile of XACML v3.0 Version 1.0:
195186
* http://docs.oasis-open.org/xacml/xacml-rest/v1.0/cs02/xacml-rest-v1.0-cs02.html#_Toc399235433. Example:
196187
* http://docs.oasis-open.org/xacml/xacml-rest/v1.0/cs02/xacml-rest-v1.0-cs02.html#_Toc399235419
197188
*/
198-
pdpLink.setRel(Relation.HTTP_DOCS_OASIS_OPEN_ORG_NS_XACML_RELATION_PDP);
189+
final Link pdpLink = new Link(Relation.HTTP_DOCS_OASIS_OPEN_ORG_NS_XACML_RELATION_PDP, null, pdpResourcePath.value(), null, "Policy Decision Point", null, null);
199190

200191
final Resources childResources = new Resources(Arrays.asList(propsLink, papLink, pdpLink));
201192
final ReadableDomainProperties props;
@@ -279,7 +270,6 @@ public ResourceContent getPAP()
279270
}
280271

281272
// Link to child resource 'pdp.properties'
282-
final Link pdpPropsLink = new Link();
283273
// For the link, get Path annotation of corresponding method
284274
final Path pdpPropsResourcePath;
285275
try
@@ -291,12 +281,9 @@ public ResourceContent getPAP()
291281
throw new InternalServerErrorException("Error getting the 'pdp.properties' resource of the domain '" + domainId + "'", e);
292282
}
293283

294-
pdpPropsLink.setHref(pdpPropsResourcePath.value());
295-
pdpPropsLink.setTitle("PDP properties");
296-
pdpPropsLink.setRel(Relation.ITEM);
284+
final Link pdpPropsLink = new Link(Relation.ITEM, null, pdpPropsResourcePath.value(), null, "PDP properties", null, null);
297285

298286
// Link to child resource 'prp.properties'
299-
final Link prpPropsLink = new Link();
300287
// For the link, get Path annotation of corresponding method
301288
final Path prpPropsResourcePath;
302289
try
@@ -308,12 +295,9 @@ public ResourceContent getPAP()
308295
throw new InternalServerErrorException("Error getting the 'prp.properties' resource of the domain '" + domainId + "'", e);
309296
}
310297

311-
prpPropsLink.setHref(prpPropsResourcePath.value());
312-
prpPropsLink.setTitle("PRP properties");
313-
prpPropsLink.setRel(Relation.ITEM);
298+
final Link prpPropsLink = new Link(Relation.ITEM, null, prpPropsResourcePath.value(), null, "PRP properties", null, null);
314299

315300
// Link to child resource 'policies'
316-
final Link policiesLink = new Link();
317301
// For the link, get Path annotation of getPoliciesResource method
318302
final Path policiesResourcePath;
319303
try
@@ -325,12 +309,9 @@ public ResourceContent getPAP()
325309
throw new InternalServerErrorException("Error getting the 'policies' resource of the domain '" + domainId + "'", e);
326310
}
327311

328-
policiesLink.setHref(policiesResourcePath.value());
329-
policiesLink.setTitle("PRP policies");
330-
policiesLink.setRel(Relation.ITEM);
312+
final Link policiesLink = new Link(Relation.ITEM, null, policiesResourcePath.value(), null, "PRP policies", null, null);
331313

332314
// Link to child resource 'attributeProviders'
333-
final Link attrProvidersLink = new Link();
334315
// For the link, get Path annotation of getAttributeProvidersResource
335316
// method
336317
final Path attrProvidersResourcePath;
@@ -343,9 +324,8 @@ public ResourceContent getPAP()
343324
throw new InternalServerErrorException("Error getting the 'attributeProviders' resource of the domain '" + domainId + "'", e);
344325
}
345326

346-
attrProvidersLink.setHref(attrProvidersResourcePath.value());
347-
attrProvidersLink.setTitle("PDP Attribute Providers");
348-
attrProvidersLink.setRel(Relation.ITEM);
327+
final Link attrProvidersLink = new Link(Relation.ITEM, null, attrProvidersResourcePath.value(), null, "PDP Attribute Providers", null, null);
328+
349329

350330
final Resources childResources = new Resources(Arrays.asList(pdpPropsLink, prpPropsLink, policiesLink, attrProvidersLink));
351331
return new ResourceContent(null, childResources);
@@ -493,11 +473,7 @@ public Link addPolicy(final PolicySet policy)
493473
// Policy ID is xs:anyURI, therefore may contain invalid characters for
494474
// URL paths -> needs escaping to be used as URL path segment
495475
final String policyIdUrlPathSegment = URL_PATH_SEGMENT_ESCAPER.escape(policy.getPolicySetId());
496-
final Link policyResourceLink = new Link();
497-
policyResourceLink.setHref(policyIdUrlPathSegment + "/" + policy.getVersion());
498-
policyResourceLink.setTitle("Policy '" + policy.getPolicySetId() + "' v" + policy.getVersion());
499-
policyResourceLink.setRel(Relation.ITEM);
500-
return policyResourceLink;
476+
return new Link(Relation.ITEM, null, policyIdUrlPathSegment + "/" + policy.getVersion(), null, "Policy '" + policy.getPolicySetId() + "' v" + policy.getVersion(), null, null);
501477
}
502478

503479
@Override
@@ -530,18 +506,16 @@ public Resources getPolicies()
530506
throw new InternalServerErrorException("Error getting policy resource IDs in domain '" + domainId + "'", e);
531507
}
532508

533-
if (policyResourceIDs.size() < 1)
509+
if (policyResourceIDs.isEmpty())
534510
{
535511
throw new InternalServerErrorException("Missing root policy resource from DAO in domain '" + domainId + "'");
536512
}
537513

538514
final List<Link> policyResourceLinks = new ArrayList<>(policyResourceIDs.size());
539515
for (final String policyResourceId : policyResourceIDs)
540516
{
541-
final Link link = new Link();
517+
final Link link = new Link(Relation.ITEM, null, policyResourceId, null, null, null, null);
542518
policyResourceLinks.add(link);
543-
link.setHref(policyResourceId);
544-
link.setRel(Relation.ITEM);
545519
}
546520

547521
return new Resources(policyResourceLinks);

rest-service/src/main/java/org/ow2/authzforce/rest/service/jaxrs/DomainsResourceImpl.java

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2022 THALES.
2+
* Copyright (C) 2012-2024 THALES.
33
*
44
* This file is part of AuthzForce CE.
55
*
@@ -25,11 +25,11 @@
2525
import java.util.List;
2626
import java.util.Set;
2727

28-
import javax.servlet.http.HttpServletRequest;
29-
import javax.ws.rs.BadRequestException;
30-
import javax.ws.rs.InternalServerErrorException;
31-
import javax.ws.rs.NotFoundException;
32-
import javax.ws.rs.core.Context;
28+
import jakarta.servlet.http.HttpServletRequest;
29+
import jakarta.ws.rs.BadRequestException;
30+
import jakarta.ws.rs.InternalServerErrorException;
31+
import jakarta.ws.rs.NotFoundException;
32+
import jakarta.ws.rs.core.Context;
3333

3434
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
3535
import org.ow2.authzforce.core.pap.api.dao.DomainsDao;
@@ -112,11 +112,7 @@ public Link addDomain(final DomainProperties props)
112112
}
113113

114114
final String encodedUrlPathSegment = DomainResourceImpl.URL_PATH_SEGMENT_ESCAPER.escape(domainId);
115-
final Link link = new Link();
116-
link.setHref(encodedUrlPathSegment);
117-
link.setRel(Relation.ITEM);
118-
link.setTitle(domainId);
119-
return link;
115+
return new Link(Relation.ITEM, null, encodedUrlPathSegment, null, domainId, null, null);
120116
}
121117

122118
/*
@@ -152,10 +148,9 @@ public Resources getDomains(final String externalId)
152148
}
153149
else
154150
{
155-
if (attrVal instanceof List)
151+
if (attrVal instanceof List<?> resourceIds)
156152
{
157-
final List<?> resourceIds = (List<?>) attrVal;
158-
if (resourceIds.contains(anyResourceId))
153+
if (resourceIds.contains(anyResourceId))
159154
{
160155
final Set<String> domainIDs;
161156
try
@@ -199,10 +194,7 @@ public Resources getDomains(final String externalId)
199194
for (final String domainId : authorizedDomainIDs)
200195
{
201196
final String encodedUrlPathSegment = DomainResourceImpl.URL_PATH_SEGMENT_ESCAPER.escape(domainId);
202-
final Link link = new Link();
203-
link.setHref(encodedUrlPathSegment);
204-
link.setRel(Relation.ITEM);
205-
link.setTitle(domainId);
197+
final Link link = new Link(Relation.ITEM, null, encodedUrlPathSegment, null, domainId, null, null);
206198
domainResourceLinks.add(link);
207199
}
208200

rest-service/src/main/java/org/ow2/authzforce/rest/service/jaxrs/PolicyResourceImpl.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2022 THALES.
2+
* Copyright (C) 2012-2024 THALES.
33
*
44
* This file is part of AuthzForce CE.
55
*
@@ -23,9 +23,9 @@
2323
import java.util.List;
2424
import java.util.NavigableSet;
2525

26-
import javax.ws.rs.BadRequestException;
27-
import javax.ws.rs.InternalServerErrorException;
28-
import javax.ws.rs.NotFoundException;
26+
import jakarta.ws.rs.BadRequestException;
27+
import jakarta.ws.rs.InternalServerErrorException;
28+
import jakarta.ws.rs.NotFoundException;
2929

3030
import org.ow2.authzforce.core.pap.api.dao.DomainDao;
3131
import org.ow2.authzforce.core.pap.api.dao.PolicyDaoClient;
@@ -97,10 +97,8 @@ private static Resources getVersionResources(final NavigableSet<PolicyVersion> v
9797
final List<Link> policyVersionLinks = new ArrayList<>(versions.size());
9898
for (final PolicyVersion v : versions)
9999
{
100-
final Link link = new Link();
100+
final Link link = new Link(Relation.ITEM, null, v.toString(), null, null, null, null);
101101
policyVersionLinks.add(link);
102-
link.setHref(v.toString());
103-
link.setRel(Relation.ITEM);
104102
}
105103

106104
return new Resources(policyVersionLinks);

rest-service/src/main/java/org/ow2/authzforce/rest/service/jaxrs/PolicyVersionResourceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2022 THALES.
2+
* Copyright (C) 2012-2024 THALES.
33
*
44
* This file is part of AuthzForce CE.
55
*
@@ -25,8 +25,8 @@
2525
import org.ow2.authzforce.core.pdp.api.policy.PolicyVersion;
2626
import org.ow2.authzforce.rest.api.jaxrs.PolicyVersionResource;
2727

28-
import javax.ws.rs.InternalServerErrorException;
29-
import javax.ws.rs.NotFoundException;
28+
import jakarta.ws.rs.InternalServerErrorException;
29+
import jakarta.ws.rs.NotFoundException;
3030
import java.io.IOException;
3131
import java.util.HashMap;
3232
import java.util.Map;

rest-service/src/main/java/org/ow2/authzforce/rest/service/jaxrs/ProductMetadataResourceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2022 THALES.
2+
* Copyright (C) 2012-2024 THALES.
33
*
44
* This file is part of AuthzForce CE.
55
*

rest-service/src/main/java/org/ow2/authzforce/rest/service/jaxrs/PrpRWPropertiesImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2022 THALES.
2+
* Copyright (C) 2012-2024 THALES.
33
*
44
* This file is part of AuthzForce CE.
55
*

rest-service/src/main/java/org/ow2/authzforce/rest/service/jaxrs/WritableDomainPropertiesImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2022 THALES.
2+
* Copyright (C) 2012-2024 THALES.
33
*
44
* This file is part of AuthzForce CE.
55
*

rest-service/src/main/java/org/ow2/authzforce/rest/service/jaxrs/WritablePdpPropertiesImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2022 THALES.
2+
* Copyright (C) 2012-2024 THALES.
33
*
44
* This file is part of AuthzForce CE.
55
*

0 commit comments

Comments
 (0)