Skip to content

Commit d27690f

Browse files
add support to get extern keeper based on extern_type (#117)
- update manager.get function to get extern keeper based on extern_type Signed-off-by: arshdeep singh <[email protected]> Co-authored-by: Arshdeep <[email protected]>
1 parent 3350a14 commit d27690f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/signify/core/keeping.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def new(self, algo, pidx, **kwargs):
5050
eargs = kwargs["extern"]
5151
return mod.shim(pidx=pidx, **eargs)
5252

53-
def get(self, aid):
53+
def get(self, aid, **kwargs):
5454
pre = coring.Prefixer(qb64=aid["prefix"])
5555
if keeping.Algos.salty in aid:
5656
kwargs = aid[keeping.Algos.salty]
@@ -65,6 +65,16 @@ def get(self, aid):
6565
elif keeping.Algos.group in aid:
6666
kwargs = aid[keeping.Algos.group]
6767
return GroupKeeper(mgr=self, **kwargs)
68+
69+
elif keeping.Algos.extern in aid:
70+
extnprms = aid[keeping.Algos.extern]
71+
typ = kwargs["extern_type"]
72+
if typ not in self.modules:
73+
raise kering.ConfigurationError(f"unsupported external module type {typ}")
74+
mod = self.modules[typ]
75+
76+
eargs = kwargs["extern"]
77+
return mod.shim(pidx=extnprms["pidx"], **eargs)
6878

6979

7080
class BaseKeeper:

0 commit comments

Comments
 (0)