Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Local XML file names cannot contain percent sign #276

Copy link
Copy link
@dnmvisser

Description

@dnmvisser
Issue body actions

Code Version

pyff version 2.1.2

Expected Behavior

Local file name should not matter

Current Behavior

Minimal config:

---
- load:
  - /tmp/local/ as LOCAL
- select
- publish: /tmp/out.xml
- stats

When I drop a valid foobar.xml metadata file into /tmp/local, then pyFF works OK:

(venv) dnmvisser@GA0501-DVISSER pyFF$ pyff --local_copy_dir $TMPDIR batch.yaml 
---
total size:     1
selected:       1
          idps: 0
           sps: 1
---

When I rename that same file to foo%bar.xml:

(venv) dnmvisser@GA0501-DVISSER pyFF$ pyff --local_copy_dir $TMPDIR batch.yaml 
WARNING:pyff.resource:Got status=404 while getting file:///tmp/local/foo%bar.xml. Attempting fallback to local copy.
ERROR:pyff.resource:Failed handling resource: failed to fetch file:///tmp/local/foo%bar.xml (status: 404)
ERROR:pyff.builtins:<string>:0:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element '{urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptor': Missing child element(s). Expected is one of ( {http://www.w3.org/2000/09/xmldsig#}Signature, {urn:oasis:names:tc:SAML:2.0:metadata}Extensions, {urn:oasis:names:tc:SAML:2.0:metadata}EntityDescriptor, {urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptor ).
ERROR:pyff.pipes:Got exception when loading/executing pipe: XML schema validation failed
Traceback (most recent call last):
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/src/pyff/builtins.py", line 534, in publish
    validate_document(req.t)
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/src/pyff/utils.py", line 279, in validate_document
    schema().assertValid(t)
  File "src/lxml/etree.pyx", line 3691, in lxml.etree._Validator.assertValid
lxml.etree.DocumentInvalid: Element '{urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptor': Missing child element(s). Expected is one of ( {http://www.w3.org/2000/09/xmldsig#}Signature, {urn:oasis:names:tc:SAML:2.0:metadata}Extensions, {urn:oasis:names:tc:SAML:2.0:metadata}EntityDescriptor, {urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptor ).

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/venv/bin/pyff", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/src/pyff/md.py", line 33, in main
    plumbing(p).process(md, state={'batch': True, 'stats': {}})
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/src/pyff/pipes.py", line 365, in process
    ).process(self)
      ^^^^^^^^^^^^^
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/src/pyff/pipes.py", line 301, in process
    return pl.iprocess(self)
           ^^^^^^^^^^^^^^^^^
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/src/pyff/pipes.py", line 333, in iprocess
    raise ex
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/src/pyff/pipes.py", line 323, in iprocess
    ot = pipefn(req, *opts)
         ^^^^^^^^^^^^^^^^^^
  File "/Users/dnmvisser/git/github.com/IdentityPython/pyFF/src/pyff/builtins.py", line 537, in publish
    raise PipeException("XML schema validation failed")
pyff.pipes.PipeException: XML schema validation failed

I wanted to have the convention of storing local metadata using their URL encoded entityID as file name (much like MDQ), but that doesn't work because of this issue

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.