forked from openwallet-foundation/acapy-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rearrange plugin structure slightly
Since this is not a DIDComm protocol plugin, it doesn't make sense to follow the same conventions Signed-off-by: Daniel Bluhm <[email protected]>
- Loading branch information
Showing
18 changed files
with
56 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""OID4VCI plugin.""" | ||
|
||
import logging | ||
from os import getenv | ||
|
||
from aries_cloudagent.config.injection_context import InjectionContext | ||
from aries_cloudagent.core.event_bus import Event, EventBus | ||
from aries_cloudagent.core.profile import Profile | ||
from aries_cloudagent.core.util import STARTUP_EVENT_PATTERN | ||
from .oid4vci_server import Oid4vciServer | ||
from .config import Config | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
OID4VCI_HOST = getenv("OID4VCI_HOST", default="0.0.0.0") | ||
OID4VCI_PORT = int(getenv("OID4VCI_PORT", default="8081")) | ||
|
||
|
||
async def setup(context: InjectionContext): | ||
"""Setup the plugin.""" | ||
LOGGER.info("> oid4vci plugin setup...") | ||
event_bus = context.inject(EventBus) | ||
event_bus.subscribe(STARTUP_EVENT_PATTERN, started_event_handler) | ||
LOGGER.info("< oid4vci plugin setup.") | ||
|
||
|
||
async def started_event_handler(profile: Profile, event: Event): | ||
"""Event handler for Basic Messages.""" | ||
LOGGER.info(event.payload) | ||
try: | ||
config = Config(profile.context) | ||
oid4vci = Oid4vciServer( | ||
config.host, | ||
config.port, | ||
profile.context, | ||
profile, | ||
) | ||
profile.context.injector.bind_instance(Oid4vciServer, oid4vci) | ||
except Exception: | ||
LOGGER.exception("Unable to register admin server") | ||
raise | ||
|
||
oid4vci = profile.inject(Oid4vciServer) | ||
await oid4vci.start() |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters