aries-cloudagent-python GitHub
PR #2705 | feat: inject profile |
This PR adds the Profile to the injection context. This enables creating a `ClassProvider` for a class that takes a profile in its init method: ```python class ExamplePluggable: def __init__(self, profile: Profile): self.profile = profile def do_something(self): self.profile.notify("some:event", {"with": "data"}) async def setup(context: InjectionContext): context.injector.bind_provider( ExamplePluggable, ClassProvider(ExamplePluggable, ClassProvider.Inject(Profile)) ) # ... Somewhere else ... plugged_in = profile.inject(ExamplePluggable) plugged_in.do_something() ``` It's a common pattern to create a class with a profile instance. This will make it easier to turn some of these components into pluggable components. For example, the `VcLdpManager`. At the moment, it's created directly where it's needed: ```python manager = VcLdpManager(self.profile) # do something with manager ``` With this change, I can create an (override-able) class provider for VcLdpManager, which changes the above into: ```python manager = self.profile.inject(VcLdpManager) # do something with manager ``` The only way this could be done previously was by binding providers in the Profile init method itself. This made it more difficult to make more components pluggable. Side note: it's critical that the profile instance be injected as a weak reference or it will never be "finalized" (garbage collected) in multitenant contexts. |
Created At 2024-01-10 14:56:21 +0000 UTC
PR #2704 | fix: minor type hint corrections for VcLdpManager |
These are some really minor fixes just to make type checking happy and to clarify the use of some values in the VcLdpManager. |
Created At 2024-01-10 13:18:30 +0000 UTC
PR #2700 | Update legacy bcgovimages references. |
Resolves: #2118 |
Created At 2024-01-08 19:48:07 +0000 UTC
PR #2699 | Remove tiny-vim from being added to the container image to reduce reported vulnerabilities from scanning |
Signed-off-by: Stephen Curran <swcurran@gmail.com> |
Created At 2024-01-05 18:42:29 +0000 UTC
PR #2698 | fix: update constants in TransactionRecord |
Resolves: #1650 |
Created At 2024-01-04 22:28:10 +0000 UTC