Skip to content

Commit

Permalink
add support to get extern keeper based on extern_type (#117)
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
kentbull and Arsh-Sandhu authored Jan 19, 2025
1 parent 3350a14 commit d27690f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/signify/core/keeping.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def new(self, algo, pidx, **kwargs):
eargs = kwargs["extern"]
return mod.shim(pidx=pidx, **eargs)

def get(self, aid):
def get(self, aid, **kwargs):
pre = coring.Prefixer(qb64=aid["prefix"])
if keeping.Algos.salty in aid:
kwargs = aid[keeping.Algos.salty]
Expand All @@ -65,6 +65,16 @@ def get(self, aid):
elif keeping.Algos.group in aid:
kwargs = aid[keeping.Algos.group]
return GroupKeeper(mgr=self, **kwargs)

elif keeping.Algos.extern in aid:
extnprms = aid[keeping.Algos.extern]
typ = kwargs["extern_type"]
if typ not in self.modules:
raise kering.ConfigurationError(f"unsupported external module type {typ}")
mod = self.modules[typ]

eargs = kwargs["extern"]
return mod.shim(pidx=extnprms["pidx"], **eargs)


class BaseKeeper:
Expand Down

0 comments on commit d27690f

Please sign in to comment.