Skip to content

Commit 78dfb32

Browse files
committed
chore: update wrt 4.5.2 and 4.5.3 changes
Signed-off-by: jgomer2001 <[email protected]>
1 parent c2ba9bb commit 78dfb32

File tree

8 files changed

+20
-25
lines changed

8 files changed

+20
-25
lines changed

scim-client-jakarta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<parent>
1414
<groupId>org.gluu</groupId>
1515
<artifactId>scim</artifactId>
16-
<version>4.5.3-SNAPSHOT</version>
16+
<version>4.5.4-SNAPSHOT</version>
1717
</parent>
1818

1919
<properties>

scim-client-jakarta/src/test/java/gluu/scim2/client/singleresource/FullUserTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
import org.testng.annotations.Parameters;
1111
import org.testng.annotations.Test;
1212

13-
import javax.ws.rs.core.Response;
13+
import jakarta.ws.rs.core.Response;
1414
import java.util.*;
1515

16-
import static javax.ws.rs.core.Response.Status.*;
16+
import static jakarta.ws.rs.core.Response.Status.*;
1717

1818
import static org.testng.Assert.*;
1919

scim-client/src/test/resources/testng.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
</classes>
8383
</test>
8484

85-
<test name="Fido Devices Test" enabled="false">
85+
<test name="Fido Devices Test" enabled="true">
8686
<classes>
8787
<class name="gluu.scim2.client.singleresource.FidoU2fDeviceTest" />
8888
<class name="gluu.scim2.client.singleresource.Fido2DeviceTest" />

scim-model/src/main/java/org/gluu/oxtrust/model/scim2/extensions/ExtensionField.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.gluu.oxtrust.model.scim2.util.DateUtil;
1111

1212
import java.util.regex.Pattern;
13+
import java.time.format.DateTimeFormatter;
1314

1415
/**
1516
* Represents the metadata of an attribute that belongs to a SCIM resource extension.
@@ -99,8 +100,15 @@ public static Object valueFromString(ExtensionField field, String val){
99100
value = val;
100101
break;
101102
case DATE:
102-
//Dates are stored and read as strings indeed (no handling of Date or DateTime objects)
103103
value=DateUtil.generalizedToISOStringDate(val);
104+
if (value == null) {
105+
try {
106+
DateTimeFormatter.ISO_DATE_TIME.parse(val);
107+
value = val;
108+
} catch (Exception e) {
109+
//Let value be null
110+
}
111+
}
104112
break;
105113
case NUMERIC:
106114
try{
@@ -213,4 +221,4 @@ public void setDescription(String description) {
213221
this.description = description;
214222
}
215223

216-
}
224+
}

scim-rest/src/main/java/org/gluu/oxtrust/service/scim2/ExtensionService.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import static org.gluu.oxtrust.model.scim2.Constants.USER_EXT_SCHEMA_ID;
55
import static org.gluu.oxtrust.model.scim2.Constants.USER_EXT_SCHEMA_NAME;
66

7-
import java.time.format.DateTimeFormatter;
87
import java.util.ArrayList;
98
import java.util.Collection;
109
import java.util.Collections;
@@ -137,34 +136,22 @@ public List<Object> getAttributeValues(ExtensionField field, Collection valuesHo
137136
* asociated to the field: for STRING the value is left as is; for DATE the
138137
* value is converted to a String following the ISO date format; for NUMERIC an
139138
* Integer/Double is created from the value supplied.
140-
* @param ldapBackend Whether the underlying database is an ldap directory
141139
* @param field
142140
* An ExtensionField
143141
* @param strValues
144142
* A non-empty String array with the values associated to the field
145143
* passed. These values are coming from LDAP
146144
* @return List of opaque values
147145
*/
148-
public List<Object> convertValues(ExtensionField field, String strValues[], boolean ldapBackend) {
146+
public List<Object> convertValues(ExtensionField field, String[] strValues) {
149147

150148
List<Object> values = new ArrayList<>();
151149

152150
for (String val : strValues) {
153151
// In practice, there should not be nulls in strValues
154152
if (val != null) {
155-
Object value;
156-
157-
//See org.gluu.oxtrust.model.scim2.util.DateUtil.gluuCouchbaseISODate()
158-
if (!ldapBackend && field.getType().equals(AttributeDataType.DATE)) {
159-
try {
160-
DateTimeFormatter.ISO_DATE_TIME.parse(val);
161-
value = val;
162-
} catch (Exception e) {
163-
value = null;
164-
}
165-
} else {
166-
value = ExtensionField.valueFromString(field, val);
167-
}
153+
Object value = ExtensionField.valueFromString(field, val);
154+
168155
// won't happen either (value being null) because calls to this method occurs
169156
// after lots of validations have taken place
170157
if (value != null) {

scim-rest/src/main/java/org/gluu/oxtrust/service/scim2/Scim2UserService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ private void transferExtendedAttributesToResource(ScimCustomPerson person, BaseS
411411
log.debug("transferExtendedAttributesToResource. Copying to resource the value(s) for attribute '{}'",
412412
attr);
413413
ExtensionField field = fields.get(attr);
414-
List<Object> convertedValues = extService.convertValues(field, values, ldapBackend);
414+
List<Object> convertedValues = extService.convertValues(field, values);
415415

416416
if (convertedValues.size() > 0) {
417417
map.put(attr, field.isMultiValued() ? convertedValues : convertedValues.get(0));

scim-server/src/main/resources/gluu-scim-openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ info:
77
license:
88
name: Apache 2
99
url: https://github.com/GluuFederation/scim/blob/master/LICENSE
10-
version: 4.5.0
10+
version: 4.5.4
1111
servers:
1212
- url: https://your.gluu.server.com/identity/restv1/scim/v2
1313
tags:

scim-server/src/main/resources/gluu-scim-swagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
swagger: '2.0'
88

99
info:
10-
version: "4.5.0"
10+
version: "4.5.4"
1111
title: SCIM API
1212
description: |
1313
Gluu SCIM 2.0 server API. Developers can think of SCIM as a REST API with endpoints exposing CRUD functionality

0 commit comments

Comments
 (0)