From abde87e0fe40df5d7a6fb05ea8718ce9c8aefef3 Mon Sep 17 00:00:00 2001 From: Samuel M Smith Date: Wed, 6 Mar 2024 10:40:44 -0700 Subject: [PATCH] updated doc strings for config file usage added test stub for smell --- src/keri/app/configing.py | 29 +++++++++++++++++++ src/keri/app/habbing.py | 59 +++++++++++++++++++++++++++++++++------ tests/test_kering.py | 10 +++++++ 3 files changed, 90 insertions(+), 8 deletions(-) diff --git a/src/keri/app/configing.py b/src/keri/app/configing.py index 41a807a72..72efc20f7 100644 --- a/src/keri/app/configing.py +++ b/src/keri/app/configing.py @@ -40,6 +40,35 @@ class Configer(filing.Filer): Attributes: (see Filer for inherited attributes) human (bool): True (default) means use human friendly HJSON when fext is JSON + + + + config file json or hjon + + { + "dt": "2021-01-01T00:00:00.000000+00:00", + "nel": + { + "dt": "2021-01-01T00:00:00.000000+00:00", + "curls": + [ + "tcp://localhost:5621/" + ] + }, + "iurls": + [ + "tcp://localhost:5620/?role=peer&name=tam" + ], + "durls": + [ + "http://127.0.0.1:7723/oobi/EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy", + "http://127.0.0.1:7723/oobi/EMhvwOlyEJ9kN4PrwCpr9Jsv7TxPhiYveZ0oP3lJzdEi", + ], + "wurls": + [ + "http://127.0.0.1:5644/.well-known/keri/oobi/EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy?name=Root" + ] + } """ TailDirPath = "keri/cf" CleanTailDirPath = "keri/clean/cf" diff --git a/src/keri/app/habbing.py b/src/keri/app/habbing.py index 66b3698b0..2fd9dc1f5 100644 --- a/src/keri/app/habbing.py +++ b/src/keri/app/habbing.py @@ -804,13 +804,34 @@ def reconfigure(self): """Apply configuration from config file managed by .cf. to this Habery Process any oobis or endpoints - conf + config file json or hjon + { - dt: "isodatetime", - curls: ["tcp://localhost:5620/"], - iurls: ["tcp://localhost:5621/?name=eve"], + "dt": "2021-01-01T00:00:00.000000+00:00", + "nel": + { + "dt": "2021-01-01T00:00:00.000000+00:00", + "curls": + [ + "tcp://localhost:5621/" + ] + }, + "iurls": + [ + "tcp://localhost:5620/?role=peer&name=tam" + ], + "durls": + [ + "http://127.0.0.1:7723/oobi/EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy", + "http://127.0.0.1:7723/oobi/EMhvwOlyEJ9kN4PrwCpr9Jsv7TxPhiYveZ0oP3lJzdEi", + ], + "wurls": + [ + "http://127.0.0.1:5644/.well-known/keri/oobi/EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy?name=Root" + ] } + Config file is meant to be read only at init not changed by app at run time. Any dynamic app changes must go in database not config file that way we don't have to worry about multiple writers of cf. @@ -1122,13 +1143,35 @@ def reconfigure(self): Assumes that .pre and signing keys have been setup in order to create own endpoint auth when provided in .cf. - conf + config file json or hjon + { - dt: "isodatetime", - curls: ["tcp://localhost:5620/"], - iurls: ["tcp://localhost:5621/?name=eve"] + "dt": "2021-01-01T00:00:00.000000+00:00", + "nel": + { + "dt": "2021-01-01T00:00:00.000000+00:00", + "curls": + [ + "tcp://localhost:5621/" + ] + }, + "iurls": + [ + "tcp://localhost:5620/?role=peer&name=tam" + ], + "durls": + [ + "http://127.0.0.1:7723/oobi/EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy", + "http://127.0.0.1:7723/oobi/EMhvwOlyEJ9kN4PrwCpr9Jsv7TxPhiYveZ0oP3lJzdEi", + ], + "wurls": + [ + "http://127.0.0.1:5644/.well-known/keri/oobi/EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy?name=Root" + ] } + + Config file is meant to be read only at init not changed by app at run time. Any dynamic app changes must go in database not config file that way we don't have to worry about multiple writers of cf. diff --git a/tests/test_kering.py b/tests/test_kering.py index e8bfa7b4c..9784f18a8 100644 --- a/tests/test_kering.py +++ b/tests/test_kering.py @@ -544,6 +544,15 @@ def test_ilks(): """End Test """ +def test_smell(): + """ + Test smell function to parse into Serializations + """ + pass + + """End Test""" + + if __name__ == "__main__": test_protos() test_version_regex() @@ -551,3 +560,4 @@ def test_ilks(): test_versify_v1() test_versify_v2() test_ilks() + test_smell()