-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
28 lines (20 loc) · 931 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""acapy-ld-signer plugin init module."""
from os import getenv
from aries_cloudagent.config.injection_context import InjectionContext
from aries_cloudagent.vc.vc_ld.external_suite import ExternalSuiteProvider
from aries_cloudagent.wallet.default_verification_key_strategy import (
BaseVerificationKeyStrategy,
)
from .kms import MiniKMS
from .provider import KMSVerificationKeyStrategy, KmsSuiteProvider
async def setup(context: InjectionContext):
"""Setup plugin."""
KMS_BASE_URL = getenv("KMS_BASE_URL")
if not KMS_BASE_URL:
raise ValueError("KMS_BASE_URL not set")
kms_client = MiniKMS(base_url=KMS_BASE_URL)
context.injector.bind_instance(MiniKMS, kms_client)
suite = KmsSuiteProvider(kms_client)
context.injector.bind_instance(ExternalSuiteProvider, suite)
key_strat = KMSVerificationKeyStrategy()
context.injector.bind_instance(BaseVerificationKeyStrategy, key_strat)