Skip to content

Commit c10c7ee

Browse files
author
Jose Alfredo Serrano
committed
Replace Properties for a Map<String, Object>
1 parent b4f278c commit c10c7ee

File tree

3 files changed

+334
-173
lines changed

3 files changed

+334
-173
lines changed

core/src/main/java/com/onelogin/saml2/settings/Saml2Settings.java

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,31 @@ public class Saml2Settings {
5656
private String idpCertFingerprintAlgorithm = "sha1";
5757

5858
// Security
59-
private Boolean nameIdEncrypted = false;
60-
private Boolean authnRequestsSigned = false;
61-
private Boolean logoutRequestSigned = false;
62-
private Boolean logoutResponseSigned = false;
63-
private Boolean wantMessagesSigned = false;
64-
private Boolean wantAssertionsSigned = false;
65-
private Boolean wantAssertionsEncrypted = false;
66-
private Boolean wantNameId = true;
67-
private Boolean wantNameIdEncrypted = false;
68-
private Boolean signMetadata = false;
59+
private boolean nameIdEncrypted = false;
60+
private boolean authnRequestsSigned = false;
61+
private boolean logoutRequestSigned = false;
62+
private boolean logoutResponseSigned = false;
63+
private boolean wantMessagesSigned = false;
64+
private boolean wantAssertionsSigned = false;
65+
private boolean wantAssertionsEncrypted = false;
66+
private boolean wantNameId = true;
67+
private boolean wantNameIdEncrypted = false;
68+
private boolean signMetadata = false;
6969
private List<String> requestedAuthnContext = new ArrayList<>();
7070
private String requestedAuthnContextComparison = "exact";
71-
private Boolean wantXMLValidation = true;
71+
private boolean wantXMLValidation = true;
7272
private String signatureAlgorithm = Constants.RSA_SHA1;
73-
private Boolean rejectUnsolicitedResponsesWithInResponseTo = false;
73+
private boolean rejectUnsolicitedResponsesWithInResponseTo = false;
7474

7575
// Compress
76-
private Boolean compressRequest = true;
77-
private Boolean compressResponse = true;
76+
private boolean compressRequest = true;
77+
private boolean compressResponse = true;
7878

7979
// Misc
8080
private List<Contact> contacts = new LinkedList<>();
8181
private Organization organization = null;
8282

83-
private boolean spValidationOnly = false;
83+
private boolean spValidationOnly = false;
8484

8585
/**
8686
* @return the strict setting value
@@ -215,70 +215,70 @@ public final String getIdpCertFingerprintAlgorithm() {
215215
/**
216216
* @return the nameIdEncrypted setting value
217217
*/
218-
public Boolean getNameIdEncrypted() {
218+
public boolean getNameIdEncrypted() {
219219
return nameIdEncrypted;
220220
}
221221

222222
/**
223223
* @return the authnRequestsSigned setting value
224224
*/
225-
public Boolean getAuthnRequestsSigned() {
225+
public boolean getAuthnRequestsSigned() {
226226
return authnRequestsSigned;
227227
}
228228

229229
/**
230230
* @return the logoutRequestSigned setting value
231231
*/
232-
public Boolean getLogoutRequestSigned() {
232+
public boolean getLogoutRequestSigned() {
233233
return logoutRequestSigned;
234234
}
235235

236236
/**
237237
* @return the logoutResponseSigned setting value
238238
*/
239-
public Boolean getLogoutResponseSigned() {
239+
public boolean getLogoutResponseSigned() {
240240
return logoutResponseSigned;
241241
}
242242

243243
/**
244244
* @return the wantMessagesSigned setting value
245245
*/
246-
public Boolean getWantMessagesSigned() {
246+
public boolean getWantMessagesSigned() {
247247
return wantMessagesSigned;
248248
}
249249

250250
/**
251251
* @return the wantAssertionsSigned setting value
252252
*/
253-
public Boolean getWantAssertionsSigned() {
253+
public boolean getWantAssertionsSigned() {
254254
return wantAssertionsSigned;
255255
}
256256

257257
/**
258258
* @return the wantAssertionsEncrypted setting value
259259
*/
260-
public Boolean getWantAssertionsEncrypted() {
260+
public boolean getWantAssertionsEncrypted() {
261261
return wantAssertionsEncrypted;
262262
}
263263

264264
/**
265265
* @return the wantNameId setting value
266266
*/
267-
public Boolean getWantNameId() {
267+
public boolean getWantNameId() {
268268
return wantNameId;
269269
}
270270

271271
/**
272272
* @return the wantNameIdEncrypted setting value
273273
*/
274-
public Boolean getWantNameIdEncrypted() {
274+
public boolean getWantNameIdEncrypted() {
275275
return wantNameIdEncrypted;
276276
}
277277

278278
/**
279279
* @return the signMetadata setting value
280280
*/
281-
public Boolean getSignMetadata() {
281+
public boolean getSignMetadata() {
282282
return signMetadata;
283283
}
284284

@@ -299,7 +299,7 @@ public String getRequestedAuthnContextComparison() {
299299
/**
300300
* @return the wantXMLValidation setting value
301301
*/
302-
public Boolean getWantXMLValidation() {
302+
public boolean getWantXMLValidation() {
303303
return wantXMLValidation;
304304
}
305305

@@ -327,7 +327,7 @@ public Organization getOrganization() {
327327
/**
328328
* @return if the debug is active or not
329329
*/
330-
public Boolean isDebugActive() {
330+
public boolean isDebugActive() {
331331
return this.debug;
332332
}
333333

@@ -528,7 +528,7 @@ protected final void setIdpCertFingerprintAlgorithm(String idpCertFingerprintAlg
528528
* @param nameIdEncrypted
529529
* the nameIdEncrypted value to be set. Based on it the SP will encrypt the NameID or not
530530
*/
531-
public void setNameIdEncrypted(Boolean nameIdEncrypted) {
531+
public void setNameIdEncrypted(boolean nameIdEncrypted) {
532532
this.nameIdEncrypted = nameIdEncrypted;
533533
}
534534

@@ -538,7 +538,7 @@ public void setNameIdEncrypted(Boolean nameIdEncrypted) {
538538
* @param authnRequestsSigned
539539
* the authnRequestsSigned value to be set. Based on it the SP will sign Logout Request or not
540540
*/
541-
public void setAuthnRequestsSigned(Boolean authnRequestsSigned) {
541+
public void setAuthnRequestsSigned(boolean authnRequestsSigned) {
542542
this.authnRequestsSigned = authnRequestsSigned;
543543
}
544544

@@ -548,7 +548,7 @@ public void setAuthnRequestsSigned(Boolean authnRequestsSigned) {
548548
* @param logoutRequestSigned
549549
* the logoutRequestSigned value to be set. Based on it the SP will sign Logout Request or not
550550
*/
551-
public void setLogoutRequestSigned(Boolean logoutRequestSigned) {
551+
public void setLogoutRequestSigned(boolean logoutRequestSigned) {
552552
this.logoutRequestSigned = logoutRequestSigned;
553553
}
554554

@@ -558,7 +558,7 @@ public void setLogoutRequestSigned(Boolean logoutRequestSigned) {
558558
* @param logoutResponseSigned
559559
* the logoutResponseSigned value to be set. Based on it the SP will sign Logout Response or not
560560
*/
561-
public void setLogoutResponseSigned(Boolean logoutResponseSigned) {
561+
public void setLogoutResponseSigned(boolean logoutResponseSigned) {
562562
this.logoutResponseSigned = logoutResponseSigned;
563563
}
564564

@@ -568,7 +568,7 @@ public void setLogoutResponseSigned(Boolean logoutResponseSigned) {
568568
* @param wantMessagesSigned
569569
* the wantMessagesSigned value to be set. Based on it the SP expects the SAML Messages to be signed or not
570570
*/
571-
public void setWantMessagesSigned(Boolean wantMessagesSigned) {
571+
public void setWantMessagesSigned(boolean wantMessagesSigned) {
572572
this.wantMessagesSigned = wantMessagesSigned;
573573
}
574574

@@ -578,7 +578,7 @@ public void setWantMessagesSigned(Boolean wantMessagesSigned) {
578578
* @param wantAssertionsSigned
579579
* the wantAssertionsSigned value to be set. Based on it the SP expects the SAML Assertions to be signed or not
580580
*/
581-
public void setWantAssertionsSigned(Boolean wantAssertionsSigned) {
581+
public void setWantAssertionsSigned(boolean wantAssertionsSigned) {
582582
this.wantAssertionsSigned = wantAssertionsSigned;
583583
}
584584

@@ -588,7 +588,7 @@ public void setWantAssertionsSigned(Boolean wantAssertionsSigned) {
588588
* @param wantAssertionsEncrypted
589589
* the wantAssertionsEncrypted value to be set. Based on it the SP expects the SAML Assertions to be encrypted or not
590590
*/
591-
public void setWantAssertionsEncrypted(Boolean wantAssertionsEncrypted) {
591+
public void setWantAssertionsEncrypted(boolean wantAssertionsEncrypted) {
592592
this.wantAssertionsEncrypted = wantAssertionsEncrypted;
593593
}
594594

@@ -598,7 +598,7 @@ public void setWantAssertionsEncrypted(Boolean wantAssertionsEncrypted) {
598598
* @param wantNameId
599599
* the wantNameId value to be set. Based on it the SP expects a NameID
600600
*/
601-
public void setWantNameId(Boolean wantNameId) {
601+
public void setWantNameId(boolean wantNameId) {
602602
this.wantNameId = wantNameId;
603603
}
604604

@@ -608,7 +608,7 @@ public void setWantNameId(Boolean wantNameId) {
608608
* @param wantNameIdEncrypted
609609
* the wantNameIdEncrypted value to be set. Based on it the SP expects the NameID to be encrypted or not
610610
*/
611-
public void setWantNameIdEncrypted(Boolean wantNameIdEncrypted) {
611+
public void setWantNameIdEncrypted(boolean wantNameIdEncrypted) {
612612
this.wantNameIdEncrypted = wantNameIdEncrypted;
613613
}
614614

@@ -618,7 +618,7 @@ public void setWantNameIdEncrypted(Boolean wantNameIdEncrypted) {
618618
* @param signMetadata
619619
* the signMetadata value to be set. Based on it the SP will sign or not the metadata with the SP PrivateKey/Certificate
620620
*/
621-
public void setSignMetadata(Boolean signMetadata) {
621+
public void setSignMetadata(boolean signMetadata) {
622622
this.signMetadata = signMetadata;
623623
}
624624

@@ -650,7 +650,7 @@ public void setRequestedAuthnContextComparison(String requestedAuthnContextCompa
650650
* @param wantXMLValidation
651651
* the wantXMLValidation value to be set. Based on it the SP will validate SAML messages against the XML scheme
652652
*/
653-
public void setWantXMLValidation(Boolean wantXMLValidation) {
653+
public void setWantXMLValidation(boolean wantXMLValidation) {
654654
this.wantXMLValidation = wantXMLValidation;
655655
}
656656

@@ -864,7 +864,7 @@ public List<String> checkSPSettings() {
864864
*
865865
* @return true if the SP settings are valid
866866
*/
867-
public Boolean checkSPCerts() {
867+
public boolean checkSPCerts() {
868868
X509Certificate cert = getSPcert();
869869
PrivateKey key = getSPkey();
870870

@@ -901,7 +901,7 @@ private boolean checkRequired(Object value) {
901901
* @param spValidationOnly
902902
* the spValidationOnly value to be set
903903
*/
904-
public void setSPValidationOnly(Boolean spValidationOnly)
904+
public void setSPValidationOnly(boolean spValidationOnly)
905905
{
906906
this.spValidationOnly = spValidationOnly;
907907
}
@@ -926,7 +926,7 @@ public String getSPMetadata() throws CertificateEncodingException {
926926
String metadataString = metadataObj.getMetadataString();
927927

928928
// Check if must be signed
929-
Boolean signMetadata = this.getSignMetadata();
929+
boolean signMetadata = this.getSignMetadata();
930930
if (signMetadata) {
931931
// TODO Extend this in order to be able to read not only SP privateKey/certificate
932932
try {

0 commit comments

Comments
 (0)