Skip to content

Commit

Permalink
Disable lei list (#22)
Browse files Browse the repository at this point in the history
* disable LEI list, update public config, and other small fixes

Signed-off-by: 2byrds <[email protected]>

---------

Signed-off-by: 2byrds <[email protected]>
  • Loading branch information
2byrds authored Aug 9, 2024
1 parent 86c88f6 commit c28678a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
9 changes: 1 addition & 8 deletions scripts/keri/cf/verifier-config-public.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,5 @@
"https://gleif-it.github.io/oobi/EH6ekLjSr8V32WyFbGe1zXjTzFs9PkTYmupJ9H65O14g",
"https://gleif-it.github.io/oobi/EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao"
],
"LEIs": [
"984500E5DEFDBQ1O9038",
"984500AAFEB59DDC0E43",
"254900OPPU84GM83MG36",
"9845004CC7884BN85018",
"98450030F6X9EC7C8336",
"875500ELOZEL05BVXV37"
]
"LEIs": []
}
5 changes: 3 additions & 2 deletions src/verifier/core/authorizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def setup(hby, vdb, reger, cf):
raise kering.ConfigurationError("invalid configuration, no LEIs available to accept")

leis = data.get("LEIs")
if not isinstance(leis, list) or len(leis) == 0:
if not None and not isinstance(leis, list):
raise kering.ConfigurationError("invalid configuration, invalid LEIs in configuration")

authorizer = Authorizer(hby, vdb, reger, leis)
Expand Down Expand Up @@ -133,7 +133,8 @@ def processEcr(self, creder):
return

LEI = creder.attrib["LEI"]
if LEI not in self.leis:
# only process LEI filter if LEI list has been configured
if len(self.leis) > 0 and LEI not in self.leis:
print(f"LEI: {LEI} not allowed")
return

Expand Down
2 changes: 1 addition & 1 deletion src/verifier/core/verifying.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def on_put(self, req, rep, said):

if not found:
rep.status = falcon.HTTP_BAD_REQUEST
rep.data = json.dumps(dict(msg=f"credential {said} from body of request was not found")).encode("utf-8")
rep.data = json.dumps(dict(msg=f"credential {said} from body of request did not verify")).encode("utf-8")
return

print(f"Credential {said} presented.")
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get():
# # class testCf:
# # def get():
# # return dict(LEIs=[f"{LEI1}",f"{LEI2}"])
# rootsCf = configing.Configer(name="verifier-config-rootsid.json",
# rootsCf = configing.Configer(name="verifier-config-public.json",
# headDirPath="/Users/meenyleeny/VSCode/vlei-verifier/scripts",
# base="",
# temp=False, reopen=True, clear=False)
Expand Down

0 comments on commit c28678a

Please sign in to comment.