Skip to content

Commit

Permalink
feat: advanced listing endpoint changes fix missing TA
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Apr 18, 2024
1 parent 114d6f9 commit 387fbfc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setUp(self):
rp_onboarding_data_local = deepcopy(rp_onboarding_data)
rp_onboarding_data_local["sub"] = "http://rp-test.it/oidc/rplocal/"
FederationDescendant.objects.create(**rp_onboarding_data_local)
FederationEntityConfiguration.objects.create(**ta_conf_data)
self.ta = FederationEntityConfiguration.objects.create(**ta_conf_data)

@override_settings(MAX_ENTRIES_PAGE=1)
def test_advanced_entity_listing_1(self):
Expand Down
10 changes: 9 additions & 1 deletion spid_cie_oidc/authority/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,18 @@ def advanced_entity_listing(request):
).order_by("-modified")
entities_list = []
for descendant in desecendants:
try:
_ss = descendant.entity_statement_as_jws()
except AttributeError as e:
logger.warning(
f"Subordinate {descendant} missing authority hint: {e}"
)
continue

entity = {
descendant.sub : {
"iat" : int(descendant.modified.timestamp()),
"subordinate_statement": descendant.entity_statement_as_jws()
"subordinate_statement": _ss
}
}
entities_list.append(entity)
Expand Down

0 comments on commit 387fbfc

Please sign in to comment.