Fix - LoTE filtering logic#598
Conversation
…he same type in the list if serviceTypeIdentifier is absent
| fun fromSchemeType(rawSchemeType: String?): LoTEServiceType? { | ||
| if (rawSchemeType.isNullOrBlank()) return null | ||
|
|
||
| return when { |
There was a problem hiding this comment.
I think that could be written like entries().firstOrNull { it.type.equals(rawSchemeType, true) } ... because why would we do a "contains" check?
There was a problem hiding this comment.
The reason we have to use .contains() instead of .equals() is because the rawSchemeType (which comes from vcType, sdJwtType, or isoDocType) is a fully qualified URI/URN, not a simple string. For example, a PID's scheme type is usually urn:eudi:pid:1. Did add the firstOrNull pattern in c4ccebb, but with contains.
There was a problem hiding this comment.
Okay, then we'll need to adapt two more things: Do not name the function and parameter schemeType but schemeIdentifier to align with nomenclature in VC-K. Also we would need to explicitly check if this is the PID identifier (urn:eudi:pid:1: for SD-JWT or eu.europa.ec.eudi.pid.1 for MDOC, see https://github.com/eu-digital-identity-wallet/eudi-doc-attestation-rulebooks-catalog/blob/main/rulebooks/pid/pid-rulebook.md) or the mDL identifier (org.iso.18013.5.1.mDL) and then map it. Can it ever be a WRPAC or WALLET?
ServiceTypeIdentifiersignifies that all listed trusted entityservices are of the same type. Previous filtering logic was too strict