Skip to content

Commit 96018ab

Browse files
committed
fixup! Add new method
1 parent bfda15b commit 96018ab

File tree

1 file changed

+11
-0
lines changed
  • x-pack/plugin/security/lib/nimbus-jose-jwt-modified/src/main/java/com/nimbusds/jose/util

1 file changed

+11
-0
lines changed

x-pack/plugin/security/lib/nimbus-jose-jwt-modified/src/main/java/com/nimbusds/jose/util/JSONObjectUtils.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import java.text.ParseException;
1616
import java.util.List;
1717
import java.util.Map;
18+
import java.util.Date;
1819

1920
/**
2021
* This class wraps {@link org.elasticsearch.nimbus.jose.util.JSONObjectUtils}, which is copied directly from the source
@@ -192,6 +193,16 @@ public static Base64URL getBase64URL(final Map<String, Object> o, final String k
192193
}
193194
}
194195

196+
public static Date getEpochSecondAsDate(final Map<String, Object> o, final String key) throws ParseException {
197+
try {
198+
return AccessController.doPrivileged(
199+
(PrivilegedExceptionAction<Date>) () -> org.elasticsearch.nimbus.jose.util.JSONObjectUtils.getEpochSecondAsDate(o, key)
200+
);
201+
} catch (PrivilegedActionException e) {
202+
throw (ParseException) e.getException();
203+
}
204+
}
205+
195206
public static String toJSONString(final Map<String, ?> o) {
196207
return AccessController.doPrivileged(
197208
(PrivilegedAction<String>) () -> org.elasticsearch.nimbus.jose.util.JSONObjectUtils.toJSONString(o)

0 commit comments

Comments
 (0)