Skip to content

Commit

Permalink
Merge pull request #197 from skoranda/content_type_documentation_enha…
Browse files Browse the repository at this point in the history
…ncement

Update documentation and examples for content negotiation
  • Loading branch information
leifj committed Apr 29, 2020
2 parents bbd321e + 8e34d65 commit 438721a
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions docs/usage/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ a basic example:
- when request:
- select:
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- first
- finalize:
cacheDuration: PT12H
validUntil: P10D
- sign:
key: sign.key
cert: sign.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- discojson
Expand Down Expand Up @@ -109,7 +109,7 @@ appear to have no parameters, is actually "fed" from the request processing of p

The subsequent calls to `when` implements content negotiation to provide a discojuice and XML version of the
metadata depending on what the caller is asking for. This is key to using pyFF as a backend to the thiss.io discovery
service for instance.
service. More than one content type may be specified to accommodate noncompliant MDQ clients.

The rest of the XML "branch" of the pipeline should be pretty easy to understand. First we use the
:py:func:`pyff.builtins.first` pipe to ensure that we only return a single EntityDescriptor if our select
Expand Down
4 changes: 2 additions & 2 deletions examples/edugain-copy.fd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- when request:
- select
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- pipe:
- when path /md/swamid-kalmar-1.0:
- xslt:
Expand All @@ -34,7 +34,7 @@
- sign:
key: sign.key
cert: sign.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- discojson
Expand Down
4 changes: 2 additions & 2 deletions examples/edugain-mdq.fd
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
- when request:
- select:
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- first
- finalize:
cacheDuration: PT12H
validUntil: P10D
- sign:
key: sign.key
cert: sign.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- discojson
Expand Down
4 changes: 2 additions & 2 deletions examples/eidas.fd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- when request:
- select
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- xslt:
stylesheet: tidy.xsl
- first
Expand All @@ -26,7 +26,7 @@
- sign:
key: sign.key
cert: sign.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- discojson
Expand Down
4 changes: 2 additions & 2 deletions examples/mdx.fd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- when request:
- select
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- pipe:
- when path /md/swamid-kalmar-1.0:
- xslt:
Expand All @@ -56,7 +56,7 @@
- sign:
key: sign.key
cert: sign.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- discojson
Expand Down
4 changes: 2 additions & 2 deletions examples/met.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- when request:
- select
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- xslt:
stylesheet: tidy.xsl
- pubinfo:
Expand All @@ -54,7 +54,7 @@
- sign:
key: default.key
cert: default.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- xslt:
Expand Down
4 changes: 2 additions & 2 deletions examples/ndn.fd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- when request:
- select
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- xslt:
stylesheet: tidy.xsl
- first
Expand All @@ -28,7 +28,7 @@
- sign:
key: sign.key
cert: sign.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- discojson
Expand Down
4 changes: 2 additions & 2 deletions examples/new-renater.fd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- when request:
- select
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- xslt:
stylesheet: tidy.xsl
- first
Expand All @@ -16,7 +16,7 @@
- sign:
key: sign.key
cert: sign.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- discojson
Expand Down
4 changes: 2 additions & 2 deletions examples/test.fd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- when request:
- select
- pipe:
- when accept application/xml:
- when accept application/samlmetadata+xml application/xml:
- pipe:
- when path /md/swamid-kalmar-1.0:
- xslt:
Expand All @@ -41,7 +41,7 @@
- sign:
key: sign.key
cert: sign.crt
- emit application/xml
- emit application/samlmetadata+xml
- break
- when accept application/json:
- discojson
Expand Down

0 comments on commit 438721a

Please sign in to comment.