From d27690f811409a7690f331acd03d49e21fa3e951 Mon Sep 17 00:00:00 2001 From: Kent Bull Date: Sat, 18 Jan 2025 21:49:38 -0700 Subject: [PATCH] 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 Co-authored-by: Arshdeep --- src/signify/core/keeping.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/signify/core/keeping.py b/src/signify/core/keeping.py index 0bff307..015bded 100644 --- a/src/signify/core/keeping.py +++ b/src/signify/core/keeping.py @@ -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] @@ -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: