From 3ecf61c537bca9b3befdd022d912936ea915e53a Mon Sep 17 00:00:00 2001 From: Alex Stuart Date: Fri, 22 Jul 2022 11:07:20 +0100 Subject: [PATCH] Add metadata checks for conformance with Sirtfi version 2.0 specification See ukf/ukf-meta#352 for details --- mdx/_rules/check_sirtfi2.xsl | 86 +++++++++++++++++++ tests/manual/ukf-meta-352/README.md | 8 ++ .../both-entity-attributes-as-spec.xml | 15 ++++ ...-entity-attributes-separate-attributes.xml | 17 ++++ .../ukf-meta-352/correctly-specified.xml | 20 +++++ .../entity-attribute-contact-with-email.xml | 18 ++++ ...ntity-attribute-contact-with-givenname.xml | 18 ++++ tests/manual/ukf-meta-352/no-sirtfi-v1.xml | 19 ++++ .../ukf-meta-352/only-entity-attribute.xml | 14 +++ 9 files changed, 215 insertions(+) create mode 100644 mdx/_rules/check_sirtfi2.xsl create mode 100644 tests/manual/ukf-meta-352/README.md create mode 100644 tests/manual/ukf-meta-352/both-entity-attributes-as-spec.xml create mode 100644 tests/manual/ukf-meta-352/both-entity-attributes-separate-attributes.xml create mode 100644 tests/manual/ukf-meta-352/correctly-specified.xml create mode 100644 tests/manual/ukf-meta-352/entity-attribute-contact-with-email.xml create mode 100644 tests/manual/ukf-meta-352/entity-attribute-contact-with-givenname.xml create mode 100644 tests/manual/ukf-meta-352/no-sirtfi-v1.xml create mode 100644 tests/manual/ukf-meta-352/only-entity-attribute.xml diff --git a/mdx/_rules/check_sirtfi2.xsl b/mdx/_rules/check_sirtfi2.xsl new file mode 100644 index 00000000..ca01e9b5 --- /dev/null +++ b/mdx/_rules/check_sirtfi2.xsl @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + Sirtfi version 2 requires a REFEDS security contact + + + + + + + + Sirtfi version 2 requires a REFEDS security contact to have a GivenName + + + + + Sirtfi version 2 requires a REFEDS security contact to have an EmailAddress + + + + + + + + Sirtfi version 2 requires the entity to also support the original Sirtfi entity attribute + + + + + + diff --git a/tests/manual/ukf-meta-352/README.md b/tests/manual/ukf-meta-352/README.md new file mode 100644 index 00000000..b1636678 --- /dev/null +++ b/tests/manual/ukf-meta-352/README.md @@ -0,0 +1,8 @@ + +Manual tests for checking Sirtfi version 2 conformance + +Run the following bash command in this directory to see the thrown errors + +```bash +for i in *.xml; do echo $i; xsltproc ../../../mdx/_rules/check_sirtfi2.xsl $i; done +``` diff --git a/tests/manual/ukf-meta-352/both-entity-attributes-as-spec.xml b/tests/manual/ukf-meta-352/both-entity-attributes-as-spec.xml new file mode 100644 index 00000000..9dfb6ece --- /dev/null +++ b/tests/manual/ukf-meta-352/both-entity-attributes-as-spec.xml @@ -0,0 +1,15 @@ + + + + + + https://refeds.org/sirtfi2 + https://refeds.org/sirtfi + + + + diff --git a/tests/manual/ukf-meta-352/both-entity-attributes-separate-attributes.xml b/tests/manual/ukf-meta-352/both-entity-attributes-separate-attributes.xml new file mode 100644 index 00000000..b659e1cf --- /dev/null +++ b/tests/manual/ukf-meta-352/both-entity-attributes-separate-attributes.xml @@ -0,0 +1,17 @@ + + + + + + https://refeds.org/sirtfi2 + + + https://refeds.org/sirtfi + + + + diff --git a/tests/manual/ukf-meta-352/correctly-specified.xml b/tests/manual/ukf-meta-352/correctly-specified.xml new file mode 100644 index 00000000..8f94a096 --- /dev/null +++ b/tests/manual/ukf-meta-352/correctly-specified.xml @@ -0,0 +1,20 @@ + + + + + + https://refeds.org/sirtfi2 + https://refeds.org/sirtfi + + + + + Name of the security contact + mailto:csirt@example.ac.uk + + diff --git a/tests/manual/ukf-meta-352/entity-attribute-contact-with-email.xml b/tests/manual/ukf-meta-352/entity-attribute-contact-with-email.xml new file mode 100644 index 00000000..c4e31921 --- /dev/null +++ b/tests/manual/ukf-meta-352/entity-attribute-contact-with-email.xml @@ -0,0 +1,18 @@ + + + + + + https://refeds.org/sirtfi2 + + + + + mailto:csirt@example.ac.uk + + diff --git a/tests/manual/ukf-meta-352/entity-attribute-contact-with-givenname.xml b/tests/manual/ukf-meta-352/entity-attribute-contact-with-givenname.xml new file mode 100644 index 00000000..4463e155 --- /dev/null +++ b/tests/manual/ukf-meta-352/entity-attribute-contact-with-givenname.xml @@ -0,0 +1,18 @@ + + + + + + https://refeds.org/sirtfi2 + + + + + Name of the security contact + + diff --git a/tests/manual/ukf-meta-352/no-sirtfi-v1.xml b/tests/manual/ukf-meta-352/no-sirtfi-v1.xml new file mode 100644 index 00000000..5cc6f845 --- /dev/null +++ b/tests/manual/ukf-meta-352/no-sirtfi-v1.xml @@ -0,0 +1,19 @@ + + + + + + https://refeds.org/sirtfi2 + + + + + Name of the security contact + mailto:csirt@example.ac.uk + + diff --git a/tests/manual/ukf-meta-352/only-entity-attribute.xml b/tests/manual/ukf-meta-352/only-entity-attribute.xml new file mode 100644 index 00000000..9b140613 --- /dev/null +++ b/tests/manual/ukf-meta-352/only-entity-attribute.xml @@ -0,0 +1,14 @@ + + + + + + https://refeds.org/sirtfi2 + + + +