Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Explain selection of ProtocolMapper while producing verifiable credentials #31493

@francis-pouatcha

Description

@francis-pouatcha

Description

While issuing credentials, we sort of select all protocol mappers with matching scope and format, instead of just working with the active client. Is there any rational behind that decision?

List<OID4VCClient> clients = getClientsOfScope(credentialConfig.getScope(), credentialConfig.getFormat());

        List<OID4VCMapper> protocolMappers = getProtocolMappers(clients)
                .stream()
                .map(pm -> {
                    if (session.getProvider(ProtocolMapper.class, pm.getProtocolMapper()) instanceof OID4VCMapper mapperFactory) {
                        ProtocolMapper protocolMapper = mapperFactory.create(session);
                        if (protocolMapper instanceof OID4VCMapper oid4VCMapper) {
                            oid4VCMapper.setMapperModel(pm);
                            return oid4VCMapper;
                        }
                    }
                    LOGGER.warnf("The protocol mapper %s is not an instance of OID4VCMapper.", pm.getId());
                    return null;
                })
                .filter(Objects::nonNull)
                .toList();

@wistefan also see comment #30692 (comment) from @tnorimat

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions