Skip to content

Commit 310ab16

Browse files
authored
Merge pull request #18 from MobileID-Strong-Authentication/develop
Geofencing custom policy property types switch to String - for release 1.5.6
2 parents 9f533bd + 77fe123 commit 310ab16

3 files changed

Lines changed: 21 additions & 22 deletions

File tree

mid-java-client-core/src/main/java/ch/swisscom/mid/client/model/GeofencingAdditionalService.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import java.util.ArrayList;
2121
import java.util.List;
22-
import java.util.Map;
2322

2423
/**
2524
* Specific class to use when requesting the Geofencing additional service to Mobile ID. Please also see the
@@ -34,10 +33,10 @@ public GeofencingAdditionalService() {
3433

3534
private List<String> countryWhiteList = new ArrayList<>();
3635
private List<String> countryBlackList = new ArrayList<>();
37-
private float minDeviceConfidence;
38-
private float minLocationConfidence;
39-
private int maxTimestampMinutes;
40-
private int maxAccuracyMeters;
36+
private String minDeviceConfidence;
37+
private String minLocationConfidence;
38+
private String maxTimestampMinutes;
39+
private String maxAccuracyMeters;
4140

4241
public List<String> getCountryWhiteList() {
4342
return countryWhiteList;
@@ -55,46 +54,46 @@ public void setCountryBlackList(List<String> countryBlackList) {
5554
this.countryBlackList = countryBlackList;
5655
}
5756

58-
public float getMinDeviceConfidence() {
57+
public String getMinDeviceConfidence() {
5958
return minDeviceConfidence;
6059
}
6160

62-
public void setMinDeviceConfidence(float minDeviceConfidence) {
61+
public void setMinDeviceConfidence(String minDeviceConfidence) {
6362
this.minDeviceConfidence = minDeviceConfidence;
6463
}
6564

66-
public float getMinLocationConfidence() {
65+
public String getMinLocationConfidence() {
6766
return minLocationConfidence;
6867
}
6968

70-
public void setMinLocationConfidence(float minLocationConfidence) {
69+
public void setMinLocationConfidence(String minLocationConfidence) {
7170
this.minLocationConfidence = minLocationConfidence;
7271
}
7372

74-
public int getMaxTimestampMinutes() {
73+
public String getMaxTimestampMinutes() {
7574
return maxTimestampMinutes;
7675
}
7776

78-
public void setMaxTimestampMinutes(int maxTimestampMinutes) {
77+
public void setMaxTimestampMinutes(String maxTimestampMinutes) {
7978
this.maxTimestampMinutes = maxTimestampMinutes;
8079
}
8180

82-
public int getMaxAccuracyMeters() {
81+
public String getMaxAccuracyMeters() {
8382
return maxAccuracyMeters;
8483
}
8584

86-
public void setMaxAccuracyMeters(int maxAccuracyMeters) {
85+
public void setMaxAccuracyMeters(String maxAccuracyMeters) {
8786
this.maxAccuracyMeters = maxAccuracyMeters;
8887
}
8988

9089

9190
public boolean isDefined() {
9291
if(countryWhiteList!=null && !countryBlackList.isEmpty()) return true;
9392
if(countryBlackList!=null && !countryBlackList.isEmpty()) return true;
94-
if(maxAccuracyMeters!=0) return true;
95-
if(maxTimestampMinutes!=0) return true;
96-
if(minDeviceConfidence>0) return true;
97-
if(minLocationConfidence>0) return true;
93+
if (minDeviceConfidence != null && !minDeviceConfidence.isEmpty() && !minDeviceConfidence.equalsIgnoreCase("0")) return true;
94+
if (minLocationConfidence != null && !minLocationConfidence.isEmpty() && !minLocationConfidence.equalsIgnoreCase("0")) return true;
95+
if (maxAccuracyMeters != null && !maxAccuracyMeters.isEmpty()) return true;
96+
if (maxTimestampMinutes != null && !maxTimestampMinutes.isEmpty()) return true;
9897
return false;
9998
}
10099
}

mid-java-client-rest/src/main/java/ch/swisscom/mid/client/rest/model/signreq/AdditionalServiceGeofencing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@JsonInclude(JsonInclude.Include.NON_NULL)
99
@JsonPropertyOrder({
1010
"Description",
11-
"GeoFeancingRequest"
11+
"GeoFencingRequest"
1212

1313
})
1414
public class AdditionalServiceGeofencing extends AdditionalService {

mid-java-client-rest/src/main/java/ch/swisscom/mid/client/rest/model/signreq/GeoFencingRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public class GeoFencingRequest {
2727
@JsonProperty("countryblacklist")
2828
private List<String> countryBlackList;
2929
@JsonProperty("mindeviceconfidence")
30-
private float minDeviceConfidence;
30+
private String minDeviceConfidence;
3131
@JsonProperty("minlocationconfidence")
32-
private float minLocationConfidence;
32+
private String minLocationConfidence;
3333
@JsonProperty("maxtimestampminutes")
34-
private int maxTimestampMinutes;
34+
private String maxTimestampMinutes;
3535
@JsonProperty("maxaccuracymeters")
36-
private int maxAccuracyMeters;
36+
private String maxAccuracyMeters;
3737
}

0 commit comments

Comments
 (0)