Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallet API list credentials wrong results #843

Closed
antoniogfs opened this issue Dec 4, 2024 · 6 comments
Closed

Wallet API list credentials wrong results #843

antoniogfs opened this issue Dec 4, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@antoniogfs
Copy link

antoniogfs commented Dec 4, 2024

Describe the bug

The list credential endpoint of the Wallet API return an empty list of credentials.

To Reproduce

  1. Register an issuer in the wallet api
  2. enable all the default credentials in the issuer api through the config file credetial-issuer-metadata.conf (uncomment line from 5 to 31).

Steps to reproduce the behavior:

  1. call the endpoint /wallet-api/wallet/{wallet}/credentials

Expected behavior

A list of 26 credentials

Actual behavior

An empty list

Additional context

I think, the issue is in method fetchCredentials from the class IssuerUseCaseImpl. This method get the credentials from the /.well-known/openid-credential-issuer, but expect to find the types of the credential from the property "types" on the root of the json object while in reality this property (but in sigular - "type") is a child of property "credential_definition".

Not beeing able to find that property, the method ends up filtering all the credentials and gives back an empty list.

@antoniogfs antoniogfs added the bug Something isn't working label Dec 4, 2024
@severinstampler severinstampler self-assigned this Dec 19, 2024
@severinstampler
Copy link
Contributor

The credentialals endpoint you mention is meant to list the credentials, that have been issued to your wallet. Not yhe credentials offered by any issuer. If you created a new wallet, the empty list is the expected behaviour.

@severinstampler
Copy link
Contributor

the buggy endpoint is: /wallet-api/wallet/{wallet}/issuers/{issuer}/credentials

Working on a solution...

@antoniogfs
Copy link
Author

antoniogfs commented Dec 19, 2024

Sorry, but I do not think that this is correct.

The endpoint /wallet-api/wallet/{wallet}/issuers/{issuer}/credentials, (you are right, this should be the correct endpoint) call in the background the endpoint /.well-known/openid-credential-issuer from the issuer. This last endpoint, list all the available credential offered (not issued) by the issuer to anyone and therefore also to this specific wallet.

So the possibilities are two: either the implementation is incorrect according to the intention or the implementation is correct but then the intention is wrong.

@severinstampler
Copy link
Contributor

Like I said, the endpoint listing the credentials of an issuer is indeed not working as intended, and I'm currently working on a solution.
The endpoint you mentioned first is meant to list the credentials of the user in the wallet.

@severinstampler
Copy link
Contributor

A fix has been implemented with this pull request: #863
Once, it's merged it should be fixed.

@antoniogfs
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants