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

Provide an optional Profile to the verification key strategy #2265

Merged

Conversation

yvgny
Copy link
Contributor

@yvgny yvgny commented Jun 14, 2023

PR #2235 has just been merged, but I realized that not having access to Profile could be too restrictive. For example, accessing storage with the current function's signature is hard. In fact, I thought that custom strategies could be initialized with an InjectionContext and query what they need, but it doesn't seem to be working. Let me know if there is a more idiomatic way of doing this.

This PR fixes this by providing an optional Profile and switching to an async method.

@yvgny yvgny marked this pull request as draft June 14, 2023 14:35
@yvgny yvgny changed the title Allow awaiting in verification key strategy Provide an optional Profile to the verification key strategy Jun 15, 2023
Signed-off-by: Sacha Kozma <[email protected]>
@yvgny yvgny marked this pull request as ready for review June 15, 2023 12:48
@swcurran
Copy link
Contributor

Given this is related to #2235 -- do we need this one to be merged as part of 0.8.2? @dbluhm @usingtechnology , could you please take a look at this one and let us know?

Thanks!

self,
did: str,
profile: Optional[Profile] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to require the profile and just not use it if the strategy does not require it. This will make the calls to the strategy more consistent and prevent intermittent failures from one call not having it but others do.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @dbluhm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dbluhm
Copy link
Contributor

dbluhm commented Jun 19, 2023

Yes, ideally this is merged with 0.8.2 if we can swing it.

Copy link
Contributor

@usingtechnology usingtechnology left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the profile should NOT be optional and let the implementations decide if it needs to use it.

Also, you need to update all the docstrings with the new parameter.

self,
did: str,
profile: Optional[Profile] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @dbluhm.

@yvgny yvgny force-pushed the feat/async_verkey_id_strategy branch from 0cba53e to 2ed81c1 Compare June 20, 2023 08:20
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@yvgny yvgny requested review from usingtechnology and dbluhm June 20, 2023 08:47
@swcurran swcurran merged commit 421c4ed into openwallet-foundation:main Jun 20, 2023
@yvgny yvgny deleted the feat/async_verkey_id_strategy branch June 21, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants