feat: soft binding for plugin flexibility #3010
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a way to bind providers in profiles in such a way that they may be overridden by a plugin.
I have a fairly pointed use case: my goal is to be able to provide an alternate implementation of VC Holder. To see an example of this in use, check out this demo I put together: https://github.com/dbluhm/acapy-vc-holder. This demo uses an external KMS, delegating secure storage and retrieval of received LDP-VCs to an external component.
The "soft-binding" functionality has so far only been applied to the binding of a VC Holder instance.
An alternative to this approach would be to move the VC Holder provider binding code outside of the profile. This is possible now that the profile itself is bound to the context after #2997. I think this would create a pattern where we have dynamic providers based on wallet type. I don't think that's necessarily a bad thing but it moves logic specific to a wallet type out of the Profile definition for the wallet type. This seemed less than desirable. However, making a special case binding mechanism also feels a bit less than desirable, though it was straightforward to implement.
I'm open to feedback on this one.