Fixed default allowed origins when the issuerId is not an url

This commit is contained in:
Xavi Aracil 2022-12-07 16:08:29 +01:00
parent e1f9c31b7b
commit 3c094f53ef

View File

@ -5,6 +5,7 @@ import static org.oneedtech.inspect.util.code.Defensives.checkNotNull;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
import org.oneedtech.inspect.core.probe.Probe;
import org.oneedtech.inspect.core.probe.RunContext;
@ -87,7 +88,10 @@ public class VerificationDependenciesProbe extends Probe<JsonLdGeneratedObject>
List<String> allowedOrigins = null;
String issuerId = issuerNode.get("id").asText().strip();
if (allowedOriginsNode == null || allowedOriginsNode.isNull()) {
allowedOrigins = List.of(getDefaultAllowedOrigins(issuerId));
String defaultAllowedOrigins = getDefaultAllowedOrigins(issuerId);
if (defaultAllowedOrigins != null) {
allowedOrigins = List.of(defaultAllowedOrigins);
}
} else {
JsonNodeUtil.asStringList(allowedOriginsNode);
}