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

ParticipantContextServiceImpl createParticipantContext does not configure did #347

Closed
thomasrutger opened this issue May 16, 2024 · 4 comments · Fixed by #348
Closed

ParticipantContextServiceImpl createParticipantContext does not configure did #347

thomasrutger opened this issue May 16, 2024 · 4 comments · Fixed by #348
Assignees
Labels
question Further information is requested

Comments

@thomasrutger
Copy link
Contributor

Bug Report

Describe the Bug

When a new participant is created using ParticipantContextServiceImpl.createParticipantContext, did is not configured.

Expected Behavior

Did to be set according to the ParticipantManifest.

Observed Behavior

Did is set to null.

Steps to Reproduce

Create a ParticipantManifest (with did) and create a ParticipantContext using ParticipantContextServiceImpl.createParticipantContext. When retrieving the newly created ParticipantContext object, did will be null.

Possible Implementation

Call the did builder method in convert, using the did as defined in the manifest

@github-actions github-actions bot added the triage all new issues awaiting classification label May 16, 2024
Copy link

Thanks for your contribution 🔥 We will take a look asap 🚀

@paullatzelsperger
Copy link
Member

paullatzelsperger commented May 16, 2024

Not sure this is a bug. Please take a look at the ParticipantContextEventCoordinator, which will receive the ParticipantContextCreatedEvent and then call the DidDocumentService.
When resolving DID documents for a participant, we always go through the ParticipantContext database entry.

@paullatzelsperger paullatzelsperger added wontfix This will not be worked on bug Something isn't working question Further information is requested and removed triage all new issues awaiting classification wontfix This will not be worked on bug Something isn't working labels May 16, 2024
@thomasrutger
Copy link
Contributor Author

thomasrutger commented May 16, 2024

Not sure this is a bug. Please take a look at the ParticipantContextEventCoordinator, which will receive the ParticipantContextCreatedEvent and then call the DidDocumentService. When resolving DID documents for a participant, we always go through the ParticipantContext database entry.

Not sure I fully understand. I did check out ParticipantContextEventCoordinator and noticed a DID document is created there based on the manifest.

Basically I create a participant during startup, call participantContextService.createParticipantContext etc., then later I have a participantId and I want to get the associated did for that Participant. I am unable to use ParticipantContextService to get the did as it never seems to be set and so it returns null.

@paullatzelsperger
Copy link
Member

Basically I create a participant during startup, call participantContextService.createParticipantContext etc., then later I have a participantId and I want to get the associated did for that Participant. I am unable to use ParticipantContextService to get the did as it never seems to be set and so it returns null.

The ParticipantContextService is not intended to do that, if you want to get a DID Document for a participant, you'll need to use the DidDocumentService#queryDocuments method supplying a QuerySpec like:

QuerySpec.Builder.newInstance()
                .filter(new Criterion("participantId", "=", participantId))
                .build()

I did notice however, that the ParticipantContext#did property is not set correctly (which I think is what you meant).
Once that is fixed, you can use participantContext.getDid() and then DidDocumentService#findbyId()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants