@@ -664,24 +664,46 @@ def on_get(req, rep, name):
664
664
elif role in (kering .Roles .agent ,): # Fetch URL OOBIs for all witnesses
665
665
roleUrls = hab .fetchRoleUrls (cid = hab .pre , role = kering .Roles .agent , scheme = kering .Schemes .http ) or hab .fetchRoleUrls (cid = hab .pre , role = kering .Roles .agent , scheme = kering .Schemes .https )
666
666
if kering .Roles .agent not in roleUrls :
667
- raise falcon .HTTPNotFound (description = f"unable to query agent roles for { hab .pre } , no http endpoint" )
668
-
669
- aoobis = roleUrls [kering .Roles .agent ]
670
-
671
- oobis = list ()
672
- for agent in set (aoobis .keys ()):
673
- murls = aoobis .naball (agent )
674
- for murl in murls :
675
- urls = []
676
- if kering .Schemes .http in murl :
677
- urls .extend (murl .naball (kering .Schemes .http ))
678
- if kering .Schemes .https in murl :
679
- urls .extend (murl .naball (kering .Schemes .https ))
680
- for url in urls :
681
- up = urlparse (url )
682
- oobis .append (urljoin (up .geturl (), f"/oobi/{ hab .pre } /agent/{ agent } " ))
683
-
684
- res ["oobis" ] = oobis
667
+ res ['oobis' ] = []
668
+ else :
669
+ aoobis = roleUrls [kering .Roles .agent ]
670
+
671
+ oobis = list ()
672
+ for agent in set (aoobis .keys ()):
673
+ murls = aoobis .naball (agent )
674
+ for murl in murls :
675
+ urls = []
676
+ if kering .Schemes .http in murl :
677
+ urls .extend (murl .naball (kering .Schemes .http ))
678
+ if kering .Schemes .https in murl :
679
+ urls .extend (murl .naball (kering .Schemes .https ))
680
+ for url in urls :
681
+ up = urlparse (url )
682
+ oobis .append (urljoin (up .geturl (), f"/oobi/{ hab .pre } /agent/{ agent } " ))
683
+
684
+ res ["oobis" ] = oobis
685
+ elif role in (kering .Roles .mailbox ,): # Fetch URL OOBIs for all witnesses
686
+ roleUrls = (hab .fetchRoleUrls (cid = hab .pre , role = kering .Roles .mailbox , scheme = kering .Schemes .http ) or
687
+ hab .fetchRoleUrls (cid = hab .pre , role = kering .Roles .mailbox , scheme = kering .Schemes .https ))
688
+ if kering .Roles .mailbox not in roleUrls :
689
+ res ['oobis' ] = []
690
+ else :
691
+ aoobis = roleUrls [kering .Roles .mailbox ]
692
+
693
+ oobis = list ()
694
+ for mailbox in set (aoobis .keys ()):
695
+ murls = aoobis .naball (mailbox )
696
+ for murl in murls :
697
+ urls = []
698
+ if kering .Schemes .http in murl :
699
+ urls .extend (murl .naball (kering .Schemes .http ))
700
+ if kering .Schemes .https in murl :
701
+ urls .extend (murl .naball (kering .Schemes .https ))
702
+ for url in urls :
703
+ up = urlparse (url )
704
+ oobis .append (urljoin (up .geturl (), f"/oobi/{ hab .pre } /mailbox/{ mailbox } " ))
705
+
706
+ res ["oobis" ] = oobis
685
707
else :
686
708
raise falcon .HTTPBadRequest (description = f"unsupport role type { role } for oobi request" )
687
709
0 commit comments