Skip to content

Commit

Permalink
Merge pull request #53 from maykinmedia/fix/xml-metadata-file-creation
Browse files Browse the repository at this point in the history
Fix metadata file creation
  • Loading branch information
sergei-maertens committed Feb 15, 2024
2 parents 24758de + 3976e40 commit 04c9e4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions digid_eherkenning/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,20 @@ class Meta:
def __str__(self):
return force_str(self._meta.verbose_name)

def populate_xml_fields(self, urls: dict[str, str], xml: str) -> None:
def populate_xml_fields(self, urls: dict[str, str], xml: bytes) -> None:
"""
Populates the idp_metadata_file and idp_service_entity_id fields based on the
fetched xml metadata
"""
self.idp_service_entity_id = urls["entityId"]
content = ContentFile(xml.encode("utf-8"))
content = ContentFile(xml)
self.idp_metadata_file.save("metadata.xml", content, save=False)

def process_metadata_from_xml_source(self) -> tuple[dict[str, str], str]:
def process_metadata_from_xml_source(self) -> tuple[dict[str, str], bytes]:
"""
Parses the xml metadata
:return a tuple of a dictionary with the useful urls and the xml string itself.
:return a tuple of a dictionary with the useful urls and the xml bytes.
"""
try:
xml = OneLogin_Saml2_IdPMetadataParser.get_metadata(
Expand Down

0 comments on commit 04c9e4e

Please sign in to comment.