Skip to content

Commit

Permalink
Merge pull request #95 from pagopa/hotfix-seconds-from-epoch
Browse files Browse the repository at this point in the history
fix: use seconds from epoch in AssertionVerifierServiceImpl
  • Loading branch information
pp-ps authored Jan 10, 2025
2 parents 074ebef + 9833ef0 commit 443e2b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repositories {
}

allprojects {
version = '1.0.0-RC6'
version = '1.0.0-RC7-hotfix'
group = 'it.pagopa.tech.lollipop-consumer-java-sdk'
sourceCompatibility = '11'
targetCompatibility = '11'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* (C)2023 */
/* (C)2023-2025 */
package it.pagopa.tech.lollipop.consumer.service.impl;

import com.nimbusds.jose.JOSEException;
Expand Down Expand Up @@ -222,7 +222,7 @@ protected List<IdpCertData> getIdpCertData(Document assertionDoc)
ErrorRetrievingIdpCertDataException.ErrorCode.ENTITY_ID_FIELD_NOT_FOUND,
"Missing entity id field in the retrieved saml assertion");
}
instant = parseInstantToMillis(instant);
instant = parseInstantToUnixTimestamp(instant);
try {
entityId = entityId.trim();
List<IdpCertData> idpCertData = idpCertProvider.getIdpCertData(instant, entityId);
Expand Down Expand Up @@ -436,11 +436,12 @@ private String getPublicKey(String publicKey) {
return publicKey;
}

private String parseInstantToMillis(String instant) {
private String parseInstantToUnixTimestamp(String instant) {
try {
instant =
Long.toString(
ISODateTimeFormat.dateTimeParser().parseDateTime(instant).getMillis());
ISODateTimeFormat.dateTimeParser().parseDateTime(instant).getMillis()
/ 1000);
} catch (UnsupportedOperationException | IllegalArgumentException e) {
String msg =
String.format(
Expand Down

0 comments on commit 443e2b3

Please sign in to comment.