use of com.webauthn4j.metadata.legacy.data.toc.MetadataTOCPayload in project webauthn4j by webauthn4j.
the class FidoMdsMetadataItemsProvider method refresh.
private void refresh() {
MetadataTOCPayload tocPayload = fetchMetadataTOCPayload(false);
cachedMetadataItemMap = tocPayload.getEntries().parallelStream().map(entry -> {
try {
return fetchFidoMdsMetadataItem(entry);
} catch (RuntimeException e) {
logger.warn("Failed to fetch MetadataTOCPayLoad", e);
return null;
}
}).filter(Objects::nonNull).distinct().collect(Collectors.groupingBy(MetadataItem::getAaguid)).entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> Collections.unmodifiableSet(new HashSet<>(entry.getValue()))));
nextUpdate = tocPayload.getNextUpdate().atStartOfDay().atOffset(ZoneOffset.UTC);
lastRefresh = OffsetDateTime.now(ZoneOffset.UTC);
}
Aggregations