Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.sql.Timestamp;
import java.text.ParseException;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -60,7 +61,13 @@ public PassportWithVisas decodeAndValidatePassportJwtString(String passportJwtSt
passportJwt.getClaimAsStringList(GA4GH_PASSPORT_V1_CLAIM), Collections.emptyList());

var visas =
visaJwtStrings.stream().map(this::decodeAndValidateJwt).map(JwtUtils::buildVisa).toList();
visaJwtStrings.stream()
// this split is here because RAS prefers to encode the visa list as a single comma
// delimited string instead of a json array as the spec requires
.flatMap(s -> Arrays.stream(s.split(",")))
.map(this::decodeAndValidateJwt)
.map(JwtUtils::buildVisa)
.toList();

return new PassportWithVisas.Builder()
.passport(buildPassport(passportJwt))
Expand Down