diff --git a/PKG-INFO b/PKG-INFO index 7c77283b7fbcb7c15e704088f47e15501cd9c1c6..32282eb0a867652f0d610bcc98e9b558f5c17634 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: swh.deposit -Version: 1.4.4 +Version: 2.0.0 Summary: Software Heritage Deposit Server Home-page: https://forge.softwareheritage.org/source/swh-deposit/ Author: Software Heritage developers diff --git a/docs/specs/spec-loading.rst b/docs/specs/spec-loading.rst index c1420b4c091c48a949a769a25318e9b2ad655c33..171400794f0f35a54feef6d4ec21c8c53bddf93f 100644 --- a/docs/specs/spec-loading.rst +++ b/docs/specs/spec-loading.rst @@ -316,7 +316,6 @@ It contains the same fields as any revision object; in particular: "codemeta:url": "https://hal.archives-ouvertes.fr/hal-01883795", "codemeta:version": "1", "committer": "David Picard", - "external_identifier": "hal-01883795", "id": "hal-01883795" }, "parents": [], diff --git a/swh.deposit.egg-info/PKG-INFO b/swh.deposit.egg-info/PKG-INFO index 7c77283b7fbcb7c15e704088f47e15501cd9c1c6..32282eb0a867652f0d610bcc98e9b558f5c17634 100644 --- a/swh.deposit.egg-info/PKG-INFO +++ b/swh.deposit.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: swh.deposit -Version: 1.4.4 +Version: 2.0.0 Summary: Software Heritage Deposit Server Home-page: https://forge.softwareheritage.org/source/swh-deposit/ Author: Software Heritage developers diff --git a/swh.deposit.egg-info/SOURCES.txt b/swh.deposit.egg-info/SOURCES.txt index 65193d746beeb59e81eaea64dff60324d4c882a7..fe119da85a1369869be7220917bb7610f3509d07 100644 --- a/swh.deposit.egg-info/SOURCES.txt +++ b/swh.deposit.egg-info/SOURCES.txt @@ -237,7 +237,6 @@ swh/deposit/tests/data/atom/entry-data-no-origin-url.xml swh/deposit/tests/data/atom/entry-data-parsing-error-prone.xml swh/deposit/tests/data/atom/entry-data-with-add-to-origin-no-prov.xml swh/deposit/tests/data/atom/entry-data-with-add-to-origin.xml -swh/deposit/tests/data/atom/entry-data-with-both-add-to-origin-and-external-id.xml swh/deposit/tests/data/atom/entry-data-with-both-create-origin-and-add-to-origin.xml swh/deposit/tests/data/atom/entry-data-with-metadata-provenance.xml swh/deposit/tests/data/atom/entry-data-with-origin-reference.xml @@ -255,8 +254,6 @@ swh/deposit/tests/data/atom/entry-only-create-origin.xml swh/deposit/tests/data/atom/entry-update-in-place.xml swh/deposit/tests/data/atom/error-cli.xml swh/deposit/tests/data/atom/error-with-decimal.xml -swh/deposit/tests/data/atom/error-with-external-identifier-and-create-origin.xml -swh/deposit/tests/data/atom/error-with-external-identifier.xml swh/deposit/tests/data/atom/error-with-reference-and-create-origin.xml swh/deposit/tests/data/atom/metadata.xml swh/deposit/tests/data/https_deposit.swh.test/1_servicedocument diff --git a/swh/deposit/api/checks.py b/swh/deposit/api/checks.py index 2243aee8d12c894d37fb4c46e46c8806bb4e5ed4..8237ff59bb6a893fed45daf3bac05ae949432130 100644 --- a/swh/deposit/api/checks.py +++ b/swh/deposit/api/checks.py @@ -35,6 +35,112 @@ METADATA_PROVENANCE_KEY = "swh:metadata-provenance" AFFILIATION_NO_NAME = "Reason: affiliation does not have a <codemeta:name> element" +# from https://datatracker.ietf.org/doc/html/rfc4287 +ATOM_ELEMENTS = [ + "name", + "uri", + "email", + # specifically not allowing this one, because clients are supposed to send one + # entry at a time: + # "feed", + "entry", + # ditto: + # "content", + "author", + "category", + "contributor", + "generator", + "icon", + "id", + "link", + "logo", + "published", + "rights", + "source", + "subtitle", + "summary", + "title", + "updated", +] + +# from https://github.com/codemeta/codemeta/blob/2.0/codemeta.jsonld +CODEMETA2_CONTEXT = { + "type": "@type", + "id": "@id", + "schema": "http://schema.org/", + "codemeta": "https://codemeta.github.io/terms/", + "Organization": {"@id": "schema:Organization"}, + "Person": {"@id": "schema:Person"}, + "SoftwareSourceCode": {"@id": "schema:SoftwareSourceCode"}, + "SoftwareApplication": {"@id": "schema:SoftwareApplication"}, + "Text": {"@id": "schema:Text"}, + "URL": {"@id": "schema:URL"}, + "address": {"@id": "schema:address"}, + "affiliation": {"@id": "schema:affiliation"}, + "applicationCategory": {"@id": "schema:applicationCategory", "@type": "@id"}, + "applicationSubCategory": {"@id": "schema:applicationSubCategory", "@type": "@id"}, + "citation": {"@id": "schema:citation"}, + "codeRepository": {"@id": "schema:codeRepository", "@type": "@id"}, + "contributor": {"@id": "schema:contributor"}, + "copyrightHolder": {"@id": "schema:copyrightHolder"}, + "copyrightYear": {"@id": "schema:copyrightYear"}, + "creator": {"@id": "schema:creator"}, + "dateCreated": {"@id": "schema:dateCreated", "@type": "schema:Date"}, + "dateModified": {"@id": "schema:dateModified", "@type": "schema:Date"}, + "datePublished": {"@id": "schema:datePublished", "@type": "schema:Date"}, + "description": {"@id": "schema:description"}, + "downloadUrl": {"@id": "schema:downloadUrl", "@type": "@id"}, + "email": {"@id": "schema:email"}, + "editor": {"@id": "schema:editor"}, + "encoding": {"@id": "schema:encoding"}, + "familyName": {"@id": "schema:familyName"}, + "fileFormat": {"@id": "schema:fileFormat", "@type": "@id"}, + "fileSize": {"@id": "schema:fileSize"}, + "funder": {"@id": "schema:funder"}, + "givenName": {"@id": "schema:givenName"}, + "hasPart": {"@id": "schema:hasPart"}, + "identifier": {"@id": "schema:identifier", "@type": "@id"}, + "installUrl": {"@id": "schema:installUrl", "@type": "@id"}, + "isAccessibleForFree": {"@id": "schema:isAccessibleForFree"}, + "isPartOf": {"@id": "schema:isPartOf"}, + "keywords": {"@id": "schema:keywords"}, + "license": {"@id": "schema:license", "@type": "@id"}, + "memoryRequirements": {"@id": "schema:memoryRequirements", "@type": "@id"}, + "name": {"@id": "schema:name"}, + "operatingSystem": {"@id": "schema:operatingSystem"}, + "permissions": {"@id": "schema:permissions"}, + "position": {"@id": "schema:position"}, + "processorRequirements": {"@id": "schema:processorRequirements"}, + "producer": {"@id": "schema:producer"}, + "programmingLanguage": {"@id": "schema:programmingLanguage"}, + "provider": {"@id": "schema:provider"}, + "publisher": {"@id": "schema:publisher"}, + "relatedLink": {"@id": "schema:relatedLink", "@type": "@id"}, + "releaseNotes": {"@id": "schema:releaseNotes", "@type": "@id"}, + "runtimePlatform": {"@id": "schema:runtimePlatform"}, + "sameAs": {"@id": "schema:sameAs", "@type": "@id"}, + "softwareHelp": {"@id": "schema:softwareHelp"}, + "softwareRequirements": {"@id": "schema:softwareRequirements", "@type": "@id"}, + "softwareVersion": {"@id": "schema:softwareVersion"}, + "sponsor": {"@id": "schema:sponsor"}, + "storageRequirements": {"@id": "schema:storageRequirements", "@type": "@id"}, + "supportingData": {"@id": "schema:supportingData"}, + "targetProduct": {"@id": "schema:targetProduct"}, + "url": {"@id": "schema:url", "@type": "@id"}, + "version": {"@id": "schema:version"}, + "author": {"@id": "schema:author", "@container": "@list"}, + "softwareSuggestions": {"@id": "codemeta:softwareSuggestions", "@type": "@id"}, + "contIntegration": {"@id": "codemeta:contIntegration", "@type": "@id"}, + "buildInstructions": {"@id": "codemeta:buildInstructions", "@type": "@id"}, + "developmentStatus": {"@id": "codemeta:developmentStatus", "@type": "@id"}, + "embargoDate": {"@id": "codemeta:embargoDate", "@type": "schema:Date"}, + "funding": {"@id": "codemeta:funding"}, + "readme": {"@id": "codemeta:readme", "@type": "@id"}, + "issueTracker": {"@id": "codemeta:issueTracker", "@type": "@id"}, + "referencePublication": {"@id": "codemeta:referencePublication", "@type": "@id"}, + "maintainer": {"@id": "codemeta:maintainer"}, +} + def extra_validator( element: ElementTree.Element, @@ -120,6 +226,19 @@ def check_metadata(metadata: ElementTree.Element) -> Tuple[bool, Optional[Dict]] - (False, <detailed-error>) otherwise. """ + if metadata.tag != "{http://www.w3.org/2005/Atom}entry": + return False, { + "metadata": [ + { + "fields": ["atom:entry"], + "summary": ( + "Root element should be {http://www.w3.org/2005/Atom}entry, " + f"but it is {metadata.tag}" + ), + } + ] + } + suggested_fields = [] # at least one value per couple below is mandatory alternate_fields = { @@ -224,6 +343,60 @@ def check_metadata(metadata: ElementTree.Element) -> Tuple[bool, Optional[Dict]] ) break + for element in metadata.iter(): + if element.tag.startswith("{http://www.w3.org/2005/Atom}"): + _, local_name = element.tag.split("}", 1) + if local_name not in ATOM_ELEMENTS: + if local_name == "external_identifier": + detail.append( + { + "fields": [local_name], + "summary": "<external_identifier> is not supported anymore, " + "<swh:create_origin> or <swh:add_to_origin> should be used " + "instead.", + } + ) + elif local_name in CODEMETA2_CONTEXT: + # Probably confused the two namespaces, display a nicer error + detail.append( + { + "fields": [local_name], + "summary": f"{local_name} is not a valid Atom element. " + "However, it would be a valid a Codemeta term; make sure " + "namespaces are not swapped", + } + ) + else: + detail.append( + { + "fields": [local_name], + "summary": f"{local_name} is not a valid Atom element, " + "see https://datatracker.ietf.org/doc/html/rfc4287", + } + ) + elif element.tag.startswith("{https://doi.org/10.5063/SCHEMA/CODEMETA-2.0}"): + _, local_name = element.tag.split("}", 1) + if local_name not in CODEMETA2_CONTEXT: + if local_name in CODEMETA2_CONTEXT: + # Probably confused the two namespaces, display a nicer error + detail.append( + { + "fields": [local_name], + "summary": f"{local_name} is not a valid Codemeta 2.0 term. " + "However, it would be a valid Atom element; make sure " + "namespaces are not swapped", + } + ) + else: + detail.append( + { + "fields": [local_name], + "summary": f"{local_name} is not a valid Codemeta 2.0 term, " + "see " + "https://github.com/codemeta/codemeta/blob/2.0/codemeta.jsonld", + } + ) + if detail: return False, {"metadata": detail + suggested_fields} diff --git a/swh/deposit/api/common.py b/swh/deposit/api/common.py index 7e970d0517d396c41c368d847203905de49a3038..7f82365e996ffd0effb64d9a0ccbf688365f1c03 100644 --- a/swh/deposit/api/common.py +++ b/swh/deposit/api/common.py @@ -29,11 +29,7 @@ from swh.deposit.api.converters import convert_status_detail from swh.deposit.auth import HasDepositPermission, KeycloakBasicAuthentication from swh.deposit.models import DEPOSIT_METADATA_ONLY, Deposit from swh.deposit.parsers import parse_xml -from swh.deposit.utils import ( - NAMESPACES, - compute_metadata_context, - parse_swh_metadata_provenance, -) +from swh.deposit.utils import compute_metadata_context, parse_swh_metadata_provenance from swh.model import hashutil from swh.model.model import ( MetadataAuthority, @@ -945,29 +941,6 @@ class APIBase(APIConfig, APIView, metaclass=ABCMeta): ) deposit.origin_url = origin_url - external_identifier_element = metadata.find( - "atom:external_identifier", namespaces=NAMESPACES - ) - if external_identifier_element is not None: - # Deprecated tag. - # When clients stopped using it, this should raise an error - # unconditionally - - if deposit.origin_url: - raise DepositError( - BAD_REQUEST, - "<external_identifier> is deprecated, you should only use " - "<swh:create_origin> and <swh:add_to_origin> from now on.", - ) - - if headers.slug and external_identifier_element.text != headers.slug: - raise DepositError( - BAD_REQUEST, - "The <external_identifier> tag and Slug header are deprecated, " - "<swh:create_origin> or <swh:add_to_origin> " - "should be used instead.", - ) - def _empty_post( self, request: Request, diff --git a/swh/deposit/tests/api/test_checks.py b/swh/deposit/tests/api/test_checks.py index b287d3580db4e71163530df59c3decde422cd547..bb19a708e9d1916723719314363ffe8f5e2d00ee 100644 --- a/swh/deposit/tests/api/test_checks.py +++ b/swh/deposit/tests/api/test_checks.py @@ -45,8 +45,8 @@ _parameters1 = [ "atom-only-with-name", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <name>foo</name> <author>someone</author> {PROVENANCE_XML} @@ -57,19 +57,19 @@ _parameters1 = [ "atom-only-with-title", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> </entry> """, ), ( - "atom-only-and-external_identifier", + "atom-only-and-id", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <name>foo</name> <author>no one</author> {PROVENANCE_XML} @@ -80,7 +80,7 @@ _parameters1 = [ "atom-and-codemeta-minimal", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>no one</codemeta:name> @@ -89,25 +89,11 @@ _parameters1 = [ </entry> """, ), - ( - "unknown-codemeta-inner-element-after", - f"""\ - <entry {XMLNS}> - <url>some url</url> - <codemeta:name>bar</codemeta:name> - <codemeta:author> - <codemeta:name>someone</codemeta:name> - <codemeta:unknown-tag>should allow anything here</codemeta:unknown-tag> - </codemeta:author> - {PROVENANCE_XML} - </entry> - """, - ), ( "unknown-schema-inner-element-after", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>someone</codemeta:name> @@ -121,7 +107,7 @@ _parameters1 = [ "unknown-schema-inner-element-before", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <schema:unknown-tag>should allow anything here</schema:unknown-tag> @@ -135,7 +121,7 @@ _parameters1 = [ "unknown-schema-inner-element-before-and-after", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <schema:unknown-tag>should allow anything here</schema:unknown-tag> @@ -150,7 +136,7 @@ _parameters1 = [ "identifier-is-halid", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>The Author</codemeta:name> @@ -164,7 +150,7 @@ _parameters1 = [ "identifier-is-propertyvalue", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>The Author</codemeta:name> @@ -182,8 +168,8 @@ _parameters1 = [ "codemeta-dates", f"""\ <entry {XMLNS}> - <url>some url</url> - <external_identifier>some id</external_identifier> + <uri>some url</uri> + <id>some id</id> <name>nar</name> <author>no one</author> <codemeta:datePublished>2020-12-21</codemeta:datePublished> @@ -199,8 +185,8 @@ _parameters1 = [ # Allowed by ISO8601, therefore by schema:Date, but not by xsd:date f"""\ <entry {XMLNS}> - <url>some url</url> - <external_identifier>some id</external_identifier> + <uri>some url</uri> + <id>some id</id> <name>nar</name> <author>no one</author> <codemeta:datePublished>2020-12</codemeta:datePublished> @@ -215,8 +201,8 @@ _parameters1 = [ # Allowed by ISO8601, therefore by schema:Date, but not by xsd:date f"""\ <entry {XMLNS}> - <url>some url</url> - <external_identifier>some id</external_identifier> + <uri>some url</uri> + <id>some id</id> <name>nar</name> <author>no one</author> <codemeta:datePublished>2020</codemeta:datePublished> @@ -232,8 +218,8 @@ _parameters1 = [ # for backward compatibility with old swh-deposit versions f"""\ <entry {XMLNS}> - <url>some url</url> - <external_identifier>some id</external_identifier> + <uri>some url</uri> + <id>some id</id> <name>nar</name> <author>no one</author> <codemeta:datePublished>2020-12-21T12:00:00</codemeta:datePublished> @@ -247,7 +233,7 @@ _parameters1 = [ "author-two-names", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>someone</codemeta:name> @@ -263,7 +249,7 @@ _parameters1 = [ "element-in--affiliation", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>someone</codemeta:name> @@ -281,7 +267,7 @@ _parameters1 = [ "chardata-in-affiliation", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>someone</codemeta:name> @@ -295,8 +281,8 @@ _parameters1 = [ "swh:add_to_origin", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -314,8 +300,8 @@ _parameters1 = [ "swh:reference-origin", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -333,8 +319,8 @@ _parameters1 = [ "swh:reference-object", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -353,7 +339,7 @@ _parameters1 = [ "codemeta-full", f"""\ <entry {XMLNS}> - <url>something</url> + <uri>something</uri> <name>foo</name> <author>someone</author> <codemeta:author> @@ -433,7 +419,7 @@ _parameters2 = [ f"""\ <entry {XMLNS}> <url>something</url> - <external_identifier>something-else</external_identifier> + <id>something-else</id> <author>someone</author> {PROVENANCE_XML} </entry> @@ -448,7 +434,7 @@ _parameters2 = [ f"""\ <entry {XMLNS}> <url>something</url> - <external_identifier>something-else</external_identifier> + <id>something-else</id> <title>foobar</title> {PROVENANCE_XML} </entry> @@ -458,12 +444,95 @@ _parameters2 = [ "fields": ["atom:author or codemeta:author"], }, ), + ( + "wrong-root-element", + f"""\ + <not-entry {XMLNS}> + <url>some url</url> + <title>bar</title> + <codemeta:author> + <codemeta:name>someone</codemeta:name> + <codemeta:name>an alias</codemeta:name> + </codemeta:author> + {PROVENANCE_XML} + </not-entry> + """, + { + "fields": ["atom:entry"], + "summary": "Root element should be " + "{http://www.w3.org/2005/Atom}entry, but it is " + "{http://www.w3.org/2005/Atom}not-entry", + }, + ), + ( + "wrong-root-element-namespace", + f"""\ + <codemeta:entry {XMLNS}> + <url>some url</url> + <title>bar</title> + <codemeta:author> + <codemeta:name>someone</codemeta:name> + <codemeta:name>an alias</codemeta:name> + </codemeta:author> + </codemeta:entry> + """, + { + "fields": ["atom:entry"], + "summary": "Root element should be " + "{http://www.w3.org/2005/Atom}entry, but it is " + "{https://doi.org/10.5063/SCHEMA/CODEMETA-2.0}entry", + }, + ), + ( + "wrong-root-element-no-namespace", + f"""\ + <entry xmlns:atom="http://www.w3.org/2005/Atom" + xmlns:swh="https://www.softwareheritage.org/schema/2018/deposit" + xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0" + xmlns:schema="http://schema.org/"> + <atom:url>some url</atom:url> + <codemeta:name>bar</codemeta:name> + <title>bar</title> + <codemeta:author> + <codemeta:name>someone</codemeta:name> + <codemeta:name>an alias</codemeta:name> + </codemeta:author> + </entry> + """, + { + "fields": ["atom:entry"], + "summary": "Root element should be " + "{http://www.w3.org/2005/Atom}entry, but it is entry", + }, + ), + ( + "wrong-root-element-default-namespace", + f"""\ + <entry xmlns:atom="http://www.w3.org/2005/Atom" + xmlns:swh="https://www.softwareheritage.org/schema/2018/deposit" + xmlns="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0" + xmlns:schema="http://schema.org/"> + <atom:url>some url</atom:url> + <name>bar</name> + <author> + <name>someone</name> + <name>an alias</name> + </author> + </entry> + """, + { + "fields": ["atom:entry"], + "summary": "Root element should be " + "{http://www.w3.org/2005/Atom}entry, but it is " + "{https://doi.org/10.5063/SCHEMA/CODEMETA-2.0}entry", + }, + ), ( "wrong-title-namespace", f"""\ <entry {XMLNS}> <url>something</url> - <external_identifier>something-else</external_identifier> + <id>something-else</id> <codemeta:title>bar</codemeta:title> <author>someone</author> {PROVENANCE_XML} @@ -477,16 +546,16 @@ _parameters2 = [ ( "wrong-author-namespace", f"""\ - <entry xmlns:atom="http://www.w3.org/2005/Atom" - xmlns:swh="https://www.softwareheritage.org/schema/2018/deposit" - xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0" - xmlns:schema="http://schema.org/"> + <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" + xmlns:swh="https://www.softwareheritage.org/schema/2018/deposit" + xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0" + xmlns:schema="http://schema.org/"> <atom:url>something</atom:url> - <atom:external_identifier>something-else</atom:external_identifier> + <atom:id>something-else</atom:id> <atom:title>foobar</atom:title> <author>foo</author> {PROVENANCE_XML} - </entry> + </atom:entry> """, { "summary": "Mandatory fields are missing", @@ -498,7 +567,7 @@ _parameters2 = [ f"""\ <entry {XMLNS}> <url>something</url> - <external_identifier>something-else</external_identifier> + <id>something-else</id> <title>bar</title> <authorblahblah>someone</authorblahblah> {PROVENANCE_XML} @@ -509,6 +578,82 @@ _parameters2 = [ "fields": ["atom:author or codemeta:author"], }, ), + ( + "unknown-atom", + f"""\ + <entry {XMLNS}> + <uri>some url</uri> + <unknown-tag>but in known namespace</unknown-tag> + <codemeta:name>bar</codemeta:name> + <codemeta:author> + <codemeta:name>someone</codemeta:name> + </codemeta:author> + {PROVENANCE_XML} + </entry> + """, + { + "summary": "unknown-tag is not a valid Atom element, see " + "https://datatracker.ietf.org/doc/html/rfc4287", + "fields": ["unknown-tag"], + }, + ), + ( + "unknown-codemeta", + f"""\ + <entry {XMLNS}> + <uri>some url</uri> + <codemeta:name>bar</codemeta:name> + <codemeta:unknown-tag>but in known namespace</codemeta:unknown-tag> + <codemeta:author> + <codemeta:name>someone</codemeta:name> + </codemeta:author> + {PROVENANCE_XML} + </entry> + """, + { + "summary": "unknown-tag is not a valid Codemeta 2.0 term, see " + "https://github.com/codemeta/codemeta/blob/2.0/codemeta.jsonld", + "fields": ["unknown-tag"], + }, + ), + ( + "unknown-atom-in-codemeta", + f"""\ + <entry {XMLNS}> + <uri>some url</uri> + <codemeta:name>bar</codemeta:name> + <codemeta:author> + <codemeta:name>someone</codemeta:name> + <unknown-tag>but in known namespace</unknown-tag> + </codemeta:author> + {PROVENANCE_XML} + </entry> + """, + { + "summary": "unknown-tag is not a valid Atom element, see " + "https://datatracker.ietf.org/doc/html/rfc4287", + "fields": ["unknown-tag"], + }, + ), + ( + "unknown-codemeta-in-codemeta", + f"""\ + <entry {XMLNS}> + <uri>some url</uri> + <codemeta:name>bar</codemeta:name> + <codemeta:author> + <codemeta:name>someone</codemeta:name> + <codemeta:unknown-tag>but in known namespace</codemeta:unknown-tag> + </codemeta:author> + {PROVENANCE_XML} + </entry> + """, + { + "summary": "unknown-tag is not a valid Codemeta 2.0 term, see " + "https://github.com/codemeta/codemeta/blob/2.0/codemeta.jsonld", + "fields": ["unknown-tag"], + }, + ), ] ] @@ -529,7 +674,7 @@ _parameters3 = [ "child-element-in-name", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name> <codemeta:name>bar</codemeta:name> </codemeta:name> @@ -548,7 +693,7 @@ _parameters3 = [ "affiliation-with-no-name", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>someone</codemeta:name> @@ -570,7 +715,7 @@ _parameters3 = [ "empty-affiliation", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>someone</codemeta:name> @@ -591,7 +736,7 @@ _parameters3 = [ "chardata-in-author", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author>no one</codemeta:author> {PROVENANCE_XML} @@ -608,7 +753,7 @@ _parameters3 = [ "author-with-no-name", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <schema:unknown-tag>should allow anything here</schema:unknown-tag> @@ -627,7 +772,7 @@ _parameters3 = [ "contributor-with-no-name", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>should allow anything here</codemeta:name> @@ -649,7 +794,7 @@ _parameters3 = [ "maintainer-with-no-name", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>should allow anything here</codemeta:name> @@ -671,7 +816,7 @@ _parameters3 = [ "id-is-not-url", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>The Author</codemeta:name> @@ -691,7 +836,7 @@ _parameters3 = [ "identifier-is-invalid-url", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>The Author</codemeta:name> @@ -713,7 +858,7 @@ _parameters3 = [ "identifier-is-not-url", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>The Author</codemeta:name> @@ -733,7 +878,7 @@ _parameters3 = [ "identifier-is-not-url2", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author> <codemeta:name>The Author</codemeta:name> @@ -753,8 +898,8 @@ _parameters3 = [ "invalid-dates", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <codemeta:datePublished>2020-aa-21</codemeta:datePublished> @@ -777,8 +922,8 @@ _parameters3 = [ "invalid-dateModified", f"""\ <entry {XMLNS}> - <url>some url</url> - <external_identifier>someid</external_identifier> + <uri>some url</uri> + <id>someid</id> <title>bar</title> <author>no one</author> <codemeta:dateModified>2020-12-aa</codemeta:dateModified> @@ -796,8 +941,8 @@ _parameters3 = [ "invalid-embargoDate", f"""\ <entry {XMLNS}> - <url>some url</url> - <external_identifier>someid</external_identifier> + <uri>some url</uri> + <id>someid</id> <title>bar</title> <author>no one</author> <codemeta:embargoDate>2022-02-28T12:00:00</codemeta:embargoDate> @@ -815,7 +960,7 @@ _parameters3 = [ "error-and-missing-provenance", f"""\ <entry {XMLNS}> - <url>some url</url> + <uri>some url</uri> <codemeta:name>bar</codemeta:name> <codemeta:author>no one</codemeta:author> </entry> @@ -835,8 +980,8 @@ _parameters3 = [ "unknown-tag-in-swh-namespace", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -863,8 +1008,8 @@ _parameters3 = [ "multiple-swh:add_to_origin", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -893,8 +1038,8 @@ _parameters3 = [ "swh:add_to_origin-and-swh:create_origin", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -925,8 +1070,8 @@ _parameters3 = [ "swh:reference-and-swh:create_origin", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -957,8 +1102,8 @@ _parameters3 = [ "swh:add_to_origin-and-swh:reference", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -989,8 +1134,8 @@ _parameters3 = [ "swh:reference-two-children", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -1015,8 +1160,8 @@ _parameters3 = [ "swh:reference-two-origins", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> @@ -1041,8 +1186,8 @@ _parameters3 = [ "swh:reference-two-objects", f"""\ <entry {XMLNS}> - <url>something</url> - <external_identifier>something-else</external_identifier> + <uri>something</uri> + <id>something-else</id> <title>bar</title> <author>someone</author> <swh:deposit> diff --git a/swh/deposit/tests/api/test_collection_add_to_origin.py b/swh/deposit/tests/api/test_collection_add_to_origin.py index 666bedc676fbc6d4954739f8944b868608f76b28..91cef83f86238d1f9902c0b38c29dedb35f43b18 100644 --- a/swh/deposit/tests/api/test_collection_add_to_origin.py +++ b/swh/deposit/tests/api/test_collection_add_to_origin.py @@ -109,30 +109,6 @@ def test_add_deposit_add_to_wrong_origin( assert b"must start with" in response.content -def test_add_deposit_with_add_to_origin_and_external_identifier( - authenticated_client, - deposit_collection, - completed_deposit, - atom_dataset, - deposit_user, -): - """Posting deposit with <swh:add_to_origin> creates a new deposit with parent""" - # given multiple deposit already loaded - origin_url = deposit_user.provider_url + completed_deposit.external_id - - # adding a new deposit with the same external id as a completed deposit - # creates the parenting chain - response = post_atom( - authenticated_client, - reverse(COL_IRI, args=[deposit_collection.name]), - data=atom_dataset["entry-data-with-both-add-to-origin-and-external-id"] - % origin_url, - ) - - assert response.status_code == status.HTTP_400_BAD_REQUEST - assert b"<external_identifier> is deprecated" in response.content - - def test_post_deposit_atom_403_add_to_wrong_origin_url_prefix( authenticated_client, deposit_collection, atom_dataset, deposit_user ): diff --git a/swh/deposit/tests/api/test_collection_post_atom.py b/swh/deposit/tests/api/test_collection_post_atom.py index a613b4ec40692551eafc2ff25c0342c2642bdc64..7b2b0f2c21e23bc77f91ca3c93c6eb47bfba8708 100644 --- a/swh/deposit/tests/api/test_collection_post_atom.py +++ b/swh/deposit/tests/api/test_collection_post_atom.py @@ -286,90 +286,6 @@ def test_post_deposit_atom_no_origin_url_nor_slug_header( assert deposit.status == DEPOSIT_STATUS_DEPOSITED -def test_post_deposit_atom_with_slug_and_external_identifier( - authenticated_client, deposit_collection, deposit_user, atom_dataset, mocker -): - """Even though <external_identifier> is deprecated, it should still be - allowed when it matches the slug, so that we don't break existing clients - - """ - url = reverse(COL_IRI, args=[deposit_collection.name]) - - slug = str(uuid.uuid4()) - - # when - response = post_atom( - authenticated_client, - url, - data=atom_dataset["error-with-external-identifier"] % slug, - HTTP_IN_PROGRESS="false", - HTTP_SLUG=slug, - ) - - assert response.status_code == status.HTTP_201_CREATED - response_content = ElementTree.fromstring(response.content) - deposit_id = int(response_content.findtext("swh:deposit_id", namespaces=NAMESPACES)) - - deposit = Deposit.objects.get(pk=deposit_id) - assert deposit.collection == deposit_collection - assert deposit.origin_url == deposit_user.provider_url + slug - assert deposit.status == DEPOSIT_STATUS_DEPOSITED - - -def test_post_deposit_atom_with_mismatched_slug_and_external_identifier( - authenticated_client, deposit_collection, atom_dataset -): - """Posting an atom entry with mismatched slug header and external_identifier - should return a 400 - - """ - external_id = "foobar" - url = reverse(COL_IRI, args=[deposit_collection.name]) - - # when - response = post_atom( - authenticated_client, - url, - data=atom_dataset["error-with-external-identifier"] % external_id, - HTTP_IN_PROGRESS="false", - HTTP_SLUG="something", - ) - - assert ( - b"The <external_identifier> tag and Slug header are deprecated" - in response.content - ) - assert response.status_code == status.HTTP_400_BAD_REQUEST - - -def test_post_deposit_atom_with_create_origin_and_external_identifier( - authenticated_client, deposit_collection, atom_dataset, deposit_user -): - """<atom:external_identifier> was deprecated before <swh:create_origin> - was introduced, clients should get an error when trying to use both - - """ - external_id = "foobar" - origin_url = deposit_user.provider_url + external_id - url = reverse(COL_IRI, args=[deposit_collection.name]) - - document = atom_dataset["error-with-external-identifier-and-create-origin"].format( - external_id=external_id, - url=origin_url, - ) - - # when - response = post_atom( - authenticated_client, - url, - data=document, - HTTP_IN_PROGRESS="false", - ) - - assert b"<external_identifier> is deprecated" in response.content - assert response.status_code == status.HTTP_400_BAD_REQUEST - - def test_post_deposit_atom_with_create_origin_and_reference( authenticated_client, deposit_collection, atom_dataset, deposit_user ): diff --git a/swh/deposit/tests/api/test_collection_reuse_slug.py b/swh/deposit/tests/api/test_collection_reuse_slug.py index ed6fe1c063e2f9f769c70255b041b582a95d1dd1..6968f51bdd0c44ac30589e16a05eed0f76e4306c 100644 --- a/swh/deposit/tests/api/test_collection_reuse_slug.py +++ b/swh/deposit/tests/api/test_collection_reuse_slug.py @@ -145,46 +145,6 @@ def test_add_deposit_when_done_makes_new_deposit_with_parent_old_one( assert new_deposit.origin_url == origin_url -def test_add_deposit_with_external_identifier( - authenticated_client, - deposit_collection, - completed_deposit, - atom_dataset, - deposit_user, -): - """Even though <external_identifier> is deprecated, it should still be - allowed when it matches the slug, so that we don't break existing clients - - """ - # given multiple deposit already loaded - deposit = completed_deposit - assert deposit.status == DEPOSIT_STATUS_LOAD_SUCCESS - origin_url = deposit_user.provider_url + deposit.external_id - - # adding a new deposit with the same external id as a completed deposit - # creates the parenting chain - response = post_atom( - authenticated_client, - reverse(COL_IRI, args=[deposit_collection.name]), - data=atom_dataset["error-with-external-identifier"] % deposit.external_id, - HTTP_SLUG=deposit.external_id, - ) - - assert response.status_code == status.HTTP_201_CREATED - response_content = parse_xml(response.content) - deposit_id = int(response_content.findtext("swh:deposit_id", namespaces=NAMESPACES)) - - assert deposit_id != deposit.id - - new_deposit = Deposit.objects.get(pk=deposit_id) - assert deposit.collection == new_deposit.collection - assert deposit.origin_url == origin_url - - assert new_deposit != deposit - assert new_deposit.parent == deposit - assert new_deposit.origin_url == origin_url - - def test_add_deposit_external_id_conflict_no_parent( authenticated_client, deposit_collection, diff --git a/swh/deposit/tests/api/test_deposit_private_check.py b/swh/deposit/tests/api/test_deposit_private_check.py index dca61b6c4a14909dcf6a55d76d56dcbf23a11bd4..f582153786c3577cce8db7f9651fcf923f190204 100644 --- a/swh/deposit/tests/api/test_deposit_private_check.py +++ b/swh/deposit/tests/api/test_deposit_private_check.py @@ -59,7 +59,7 @@ def test_deposit_ok( assert response.status_code == status.HTTP_200_OK data = response.json() - assert data["status"] == DEPOSIT_STATUS_VERIFIED + assert data["status"] == DEPOSIT_STATUS_VERIFIED, data deposit = Deposit.objects.get(pk=deposit.id) assert deposit.status == DEPOSIT_STATUS_VERIFIED @@ -202,7 +202,7 @@ def test_check_deposit_metadata_ok( assert response.status_code == status.HTTP_200_OK data = response.json() - assert data["status"] == DEPOSIT_STATUS_VERIFIED + assert data["status"] == DEPOSIT_STATUS_VERIFIED, data deposit = Deposit.objects.get(pk=deposit.id) assert deposit.status == DEPOSIT_STATUS_VERIFIED diff --git a/swh/deposit/tests/api/test_deposit_update_atom.py b/swh/deposit/tests/api/test_deposit_update_atom.py index 4809d982dd0d02904b57a6576ae820191e7512f4..d8ac723e806d8bda3594c7134f7557436b25de0b 100644 --- a/swh/deposit/tests/api/test_deposit_update_atom.py +++ b/swh/deposit/tests/api/test_deposit_update_atom.py @@ -523,43 +523,6 @@ def test_put_update_metadata_done_deposit_failure_functional_checks( assert msg in response.content -def test_put_atom_with_create_origin_and_external_identifier( - authenticated_client, deposit_collection, atom_dataset, deposit_user -): - """<atom:external_identifier> was deprecated before <swh:create_origin> - was introduced, clients should get an error when trying to use both - - """ - external_id = "foobar" - origin_url = deposit_user.provider_url + external_id - url = reverse(COL_IRI, args=[deposit_collection.name]) - - response = post_atom( - authenticated_client, - url, - data=atom_dataset["entry-data0"] % origin_url, - HTTP_IN_PROGRESS="true", - ) - - assert response.status_code == status.HTTP_201_CREATED - response_content = parse_xml(response.content) - - edit_iri = response_content.find( - "atom:link[@rel='edit']", namespaces=NAMESPACES - ).attrib["href"] - - # when - response = put_atom( - authenticated_client, - edit_iri, - data=atom_dataset["error-with-external-identifier"] % external_id, - HTTP_IN_PROGRESS="false", - ) - - assert b"<external_identifier> is deprecated" in response.content - assert response.status_code == status.HTTP_400_BAD_REQUEST - - def test_put_atom_with_create_origin_and_reference( authenticated_client, deposit_collection, atom_dataset, deposit_user ): diff --git a/swh/deposit/tests/data/atom/entry-data-no-origin-url.xml b/swh/deposit/tests/data/atom/entry-data-no-origin-url.xml index 2577103c6e11a2baedcb670531f90f90d10cd9a3..9a183a70537dcc631d967f96da93cedc3bae3e5f 100644 --- a/swh/deposit/tests/data/atom/entry-data-no-origin-url.xml +++ b/swh/deposit/tests/data/atom/entry-data-no-origin-url.xml @@ -5,22 +5,6 @@ <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <updated>2017-10-07T15:17:08Z</updated> <author>some awesome author</author> - <applicationCategory>something</applicationCategory> <name>awesome-compiler</name> - <description>This is an awesome compiler destined to -awesomely compile stuff -and other stuff</description> - <keywords>compiler,programming,language</keywords> - <dateCreated>2005-10-07T17:17:08Z</dateCreated> - <datePublished>2005-10-07T17:17:08Z</datePublished> - <releaseNotes>release note</releaseNotes> - <relatedLink>related link</relatedLink> - <sponsor></sponsor> - <programmingLanguage>Awesome</programmingLanguage> - <codeRepository>https://hoster.org/awesome-compiler</codeRepository> - <operatingSystem>GNU/Linux</operatingSystem> - <version>0.0.1</version> - <developmentStatus>running</developmentStatus> - <runtimePlatform>all</runtimePlatform> </entry> diff --git a/swh/deposit/tests/data/atom/entry-data-with-both-add-to-origin-and-external-id.xml b/swh/deposit/tests/data/atom/entry-data-with-both-add-to-origin-and-external-id.xml deleted file mode 100644 index 9c188f84267c8e9db1e0db5f7904adf3dca3ce9b..0000000000000000000000000000000000000000 --- a/swh/deposit/tests/data/atom/entry-data-with-both-add-to-origin-and-external-id.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<entry xmlns="http://www.w3.org/2005/Atom" - xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0" - xmlns:swh="https://www.softwareheritage.org/schema/2018/deposit"> - <title>Awesome Compiler</title> - <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> - <author>dudess</author> - <external_identifier>foo</external_identifier> - <swh:deposit> - <swh:add_to_origin> - <swh:origin url="%s" /> - </swh:add_to_origin> - </swh:deposit> -</entry> diff --git a/swh/deposit/tests/data/atom/entry-data0.xml b/swh/deposit/tests/data/atom/entry-data0.xml index 53d7b679b9a3c0dd6e1ee75e496ae7a5ddde29f2..647dbe9f5dce21f9b93129076a2d55501d992deb 100644 --- a/swh/deposit/tests/data/atom/entry-data0.xml +++ b/swh/deposit/tests/data/atom/entry-data0.xml @@ -5,23 +5,7 @@ <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <updated>2017-10-07T15:17:08Z</updated> <author>some awesome author</author> - <applicationCategory>something</applicationCategory> <name>awesome-compiler</name> - <description>This is an awesome compiler destined to -awesomely compile stuff -and other stuff</description> - <keywords>compiler,programming,language</keywords> - <dateCreated>2005-10-07T17:17:08Z</dateCreated> - <datePublished>2005-10-07T17:17:08Z</datePublished> - <releaseNotes>release note</releaseNotes> - <relatedLink>related link</relatedLink> - <sponsor></sponsor> - <programmingLanguage>Awesome</programmingLanguage> - <codeRepository>https://hoster.org/awesome-compiler</codeRepository> - <operatingSystem>GNU/Linux</operatingSystem> - <version>0.0.1</version> - <developmentStatus>running</developmentStatus> - <runtimePlatform>all</runtimePlatform> <swh:deposit> <swh:create_origin> diff --git a/swh/deposit/tests/data/atom/entry-data1.xml b/swh/deposit/tests/data/atom/entry-data1.xml index e1bccc7a4cf0c2cf03176ef356345cb6b3236432..8a75ef12017942516b9fb755ccbc21b750448f72 100644 --- a/swh/deposit/tests/data/atom/entry-data1.xml +++ b/swh/deposit/tests/data/atom/entry-data1.xml @@ -3,21 +3,5 @@ <id>urn:uuid:2225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <updated>2017-10-07T15:17:08Z</updated> <author>some awesome author</author> - <applicationCategory>something</applicationCategory> <name>awesome-compiler</name> - <description>This is an awesome compiler destined to -awesomely compile stuff -and other stuff</description> - <keywords>compiler,programming,language</keywords> - <dateCreated>2005-10-07T17:17:08Z</dateCreated> - <datePublished>2005-10-07T17:17:08Z</datePublished> - <releaseNotes>release note</releaseNotes> - <relatedLink>related link</relatedLink> - <sponsor></sponsor> - <programmingLanguage>Awesome</programmingLanguage> - <codeRepository>https://hoster.org/awesome-compiler</codeRepository> - <operatingSystem>GNU/Linux</operatingSystem> - <version>0.0.1</version> - <developmentStatus>running</developmentStatus> - <runtimePlatform>all</runtimePlatform> </entry> diff --git a/swh/deposit/tests/data/atom/error-with-external-identifier-and-create-origin.xml b/swh/deposit/tests/data/atom/error-with-external-identifier-and-create-origin.xml deleted file mode 100644 index 4b6436f3f798fa4c84547e9f24e99b5419cd0e3f..0000000000000000000000000000000000000000 --- a/swh/deposit/tests/data/atom/error-with-external-identifier-and-create-origin.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<entry xmlns="http://www.w3.org/2005/Atom" - xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0" - xmlns:swh="https://www.softwareheritage.org/schema/2018/deposit"> - <title>Composing a Web of Audio Applications</title> - <id>hal-01243065</id> - <external_identifier>{external_id}</external_identifier> - <author>someone</author> - <swh:deposit> - <swh:create_origin> - <swh:origin url="{url}" /> - </swh:create_origin> - </swh:deposit> -</entry> diff --git a/swh/deposit/tests/data/atom/error-with-external-identifier.xml b/swh/deposit/tests/data/atom/error-with-external-identifier.xml deleted file mode 100644 index 7c9703f5cefec544276bf252ad12c3621171e6fb..0000000000000000000000000000000000000000 --- a/swh/deposit/tests/data/atom/error-with-external-identifier.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<entry xmlns="http://www.w3.org/2005/Atom" xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0"> - <title>Composing a Web of Audio Applications</title> - <id>hal-01243065</id> - <author>someone</author> - <external_identifier>%s</external_identifier> -</entry> diff --git a/swh/deposit/tests/loader/data/https_deposit.softwareheritage.org/1_private_test_999_meta b/swh/deposit/tests/loader/data/https_deposit.softwareheritage.org/1_private_test_999_meta index 01419e3d28dcc92a452ff740cdda113eac0be63c..34a5804ebddf78f5ba507fbb3506feaa83e82b45 100644 --- a/swh/deposit/tests/loader/data/https_deposit.softwareheritage.org/1_private_test_999_meta +++ b/swh/deposit/tests/loader/data/https_deposit.softwareheritage.org/1_private_test_999_meta @@ -13,7 +13,6 @@ "no one" ], "codemeta:dateCreated": "2017-10-07T15:17:08Z", - "external_identifier": "some-external-id", "url": "https://hal-test.archives-ouvertes.fr/some-external-id" }, "provider": { @@ -57,7 +56,6 @@ "another one", "no one"], "codemeta:dateCreated": "2017-10-07T15:17:08Z", - "external_identifier": "some-external-id", "url": "https://hal-test.archives-ouvertes.fr/some-external-id" }, "synthetic": "true",