pyFF icon indicating copy to clipboard operation
pyFF copied to clipboard

Unable to query metadata that ends in .xml or a /

Open andrewbcoyle opened this issue 7 months ago • 5 comments

This appears to be similar to https://github.com/IdentityPython/pyFF/issues/193. We are upgrading from 1.1.0 to 2.1.x. Currently I am testing 2.1.2. I am finding that, although all our SP metadata fiels are in our metadata aggregate used for MDQ, when entities ending in .xml or a trailing slash do not return metadata. They just return "Not found".

I apologize if this is a duplicate request, but I do not see any proposed solutions. How can we get pyff to query all entityID's no matter their spelling?

Pipeline with specifics removed:

- when update:
    - load:
        - /$my_aggregate.xml
    - break
- when request:
    - select
    - pipe:
        - when accept application/samlmetadata+xml application/xml:
             - xslt:
                 stylesheet: tidy.xsl
             - first
             - sign:
                 key: /$my_key.key
                 cert: /$my_cert.crt
             - emit application/xml
             - break
        - when accept application/json:
             - discojson
             - emit application/json:
             - break

E.G. for entityID "http://alation.com/" In the logs I see 2025-06-02 16:24:47 INFO pyff.builtins selecting using args: ['http://alation.com'] indicating the trailing slash is removed.

andrewbcoyle avatar Jun 02 '25 16:06 andrewbcoyle

I'm facing a similar issue. Here's what I'm observing:

  • When I request a JSON response, the response is an empty list ([]).
  • When I request an XML response, but it returns an <md:EntitiesDescriptor> instead of singe entity.

CzNorbi avatar Jun 13 '25 18:06 CzNorbi

I think I solved the problem with trailing slashes in #302. Main maintainer @mikaelfrykholm will take a look at it when back from vacation.

The content-type issues can be solved by setting the --content_negotiation_policy according to easy to find documentation: https://github.com/IdentityPython/pyFF/blob/62fe3e22bb48588f027957e539652523e2c7fd11/src/pyff/api.py#L218-L230

It might be time to switch the default as stated in the docs.

theseal avatar Jun 24 '25 09:06 theseal

There is a cache problem when switching content-type. Will try to solve that as-well in the PR above.

theseal avatar Jun 24 '25 09:06 theseal

I have also created a PR to fix this issue. https://github.com/IdentityPython/pyFF/pull/301

CzNorbi avatar Jun 24 '25 10:06 CzNorbi

Ah didn't see your PR before I started my work @CzNorbi.

theseal avatar Jun 25 '25 12:06 theseal