XML type not accepted in metarefresh config?

13 views
Skip to first unread message

José A. Accino

unread,
Sep 30, 2016, 5:02:44 AM9/30/16
to simple...@googlegroups.com
Hello.

We are currently giving a try to SSp metarefresh feature.

According to "Configuring the metarefresh module" in
https://simplesamlphp.org/docs/stable/simplesamlphp-automated_metadata,
the "outputFormat" option "must match the metadata source added in
config.php"

However, while 'metadata.sources' goes fine with 'type' => 'xml', such a
common format is not accepted during metarefresh execution:

"Error during metarefresh: ... : Invalid value given for the option
'outputFormat'. It should have one of the following values: 'flatfile',
'serialize'; but it had the following value: 'xml'"

If XML metadata are fine in metadata.sources, why not make it a valid
option for metarefresh outputFormat as well, without need of any
'XML->PHP array' conversion?

Or am I missing something somewhere in the docs?

JA.

Peter Schober

unread,
Sep 30, 2016, 6:00:48 AM9/30/16
to simple...@googlegroups.com
¡Hola José!

* José A. Accino <acc...@uma.es> [2016-09-30 11:09]:
> According to "Configuring the metarefresh module" in
> https://simplesamlphp.org/docs/stable/simplesamlphp-automated_metadata,
> the "outputFormat" option "must match the metadata source added in
> config.php"

I have no idea what "This must match the metadata source added in
config.php." is supposed to mean here, sorry.

> However, while 'metadata.sources' goes fine with 'type' => 'xml', such a
> common format is not accepted during metarefresh execution:
>
> "Error during metarefresh: ... : Invalid value given for the option
> 'outputFormat'. It should have one of the following values: 'flatfile',
> 'serialize'; but it had the following value: 'xml'"

In my config-metarefresh.php there's this comment above that parameter:

Which output format the metadata should be saved as.
Can be 'flatfile' or 'serialize'. 'flatfile' is the default.

Which also matches what the error message above says. So that's what
you can use.

> If XML metadata are fine in metadata.sources, why not make it a valid
> option for metarefresh outputFormat as well, without need of any
> 'XML->PHP array' conversion?

The PHP format (arrays of arrays) is what SSP uses internally, which
is why you need metarefresh to turn XML into SSP's expected PHP files.
If SSP were able to consume SAML Metadata directly there's be no need
for metarefresh.

> Or am I missing something somewhere in the docs?

What are you trying to achieve? Why feed XML to SSP when you expect
XML as the output? What's the purpose of SSP then? For a metadata
aggregation and processing appliance look at pyFF or the Shib MDA.
-peter

José A. Accino

unread,
Sep 30, 2016, 7:53:58 AM9/30/16
to simple...@googlegroups.com
El 30/09/16 a las 12:00, Peter Schober escribió:
> ¡Hola José!

Hi, Peter,

> * José A. Accino <acc...@uma.es> [2016-09-30 11:09]:
>> According to "Configuring the metarefresh module" in
>> https://simplesamlphp.org/docs/stable/simplesamlphp-automated_metadata,
>> the "outputFormat" option "must match the metadata source added in
>> config.php"
>
> I have no idea what "This must match the metadata source added in
> config.php." is supposed to mean here, sorry.

Well, I would say it means that both, the outputFormat generated by
metarefresh and the type of that metadata source as defined in
config.php must be the same. ;-) This is the origin of my question,
precisely.

> In my config-metarefresh.php there's this comment above that parameter:
>
> Which output format the metadata should be saved as.
> Can be 'flatfile' or 'serialize'. 'flatfile' is the default.

Yes, I know, but it could be a mislead or omission in the comment, and
because of the previous paragraph I was just thinking about the reason
for that mismatch: 'flatfile', 'xml' (and other formats, 'mdx', 'pdo')
accepted in 'metadata.sources', but only 'flatfile' and 'serialize' in
config-metarefresh. The only common format for both is 'flatfile', then.

> The PHP format (arrays of arrays) is what SSP uses internally, which
> is why you need metarefresh to turn XML into SSP's expected PHP files.
> If SSP were able to consume SAML Metadata directly there's be no need
> for metarefresh.

As far as I know, the result of a metarefresh action is a metadata file
saved in someplace where SSp can retrieve it ("Now you can configure
SimpleSAMLphp to use the metadata fetched by metarefresh. Edit the main
config.php file, and modify the metadata.sources directive
accordingly"), being 'flatfile' type in 'metadata/' directory the default.

Currently, 'metadata.sources' in my test machine looks as follows:

'metadata.sources' => array(
// array('type'=>'flatfile','directory'=>'metadata/refresh-pre'),
// array('type'=>'flatfile','directory'=>'metadata/refresh-pro'),
array('type' => 'xml', 'file' => 'metadata/cron/idp_pre_uma_es.xml'),
array('type' => 'xml', 'file' => 'metadata/cron/idp_uma_es.xml'),
array('type' => 'flatfile'),
),

Those XML files are fetched for testing by standard cron actions (not
metarefresh ones, now comented out), and are working fine, but, of
course, with no signature verification or centralized configuration at
all. The question then is why, if 'metadata.sources' can accept XML
files, metarefresh does not like to provide them.

Maybe there is a reason for that, gaining greater efficiency or so, but
the issue is not clear from the docs, in any case.

> What are you trying to achieve?

Understanding, just that. Should there be another reason? ;-)

Regards,
JA.

Reply all
Reply to author
Forward
0 new messages