diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 284e67091..9234383fb 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -5,6 +5,8 @@ class ContactsController < ApplicationController before_action :set_contact, only: %i[show update destroy] before_action :authenticate_user! + after_action :set_provider_contacts, only: %i[create update] + after_action :remove_provider_contacts, only: %i[destroy] load_and_authorize_resource def index @@ -181,6 +183,37 @@ def set_include end private + def set_provider_contacts + if @contact.valid? + Contact.roles.each do | role | + if @contact.has_role?(role) + @contact.set_provider_role(role, { 'email': @contact.email, 'given_name': @contact.given_name, 'family_name': @contact.family_name }) + elsif @contact.has_provider_role?(role) + @contact.set_provider_role(role, nil) + end + end + + # Make sure no other contact with this provider claims these roles. + @contact.provider.contacts.each do | contact | + if !@contact.is_me?(contact) + if contact.remove_roles!(@contact.role_name) + contact.update_attribute("role_name", contact.role_name) + end + end + end + + end + end + + def remove_provider_contacts + @contact.role_name.each do | role | + if @contact.has_provider_role?(role) + @contact.set_provider_role(role, nil) + end + end + @contact.update_attribute("role_name", []) + end + def safe_params if params[:data].blank? fail JSON::ParserError, diff --git a/app/models/contact.rb b/app/models/contact.rb index e28142b7d..8521be1b6 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -442,6 +442,65 @@ def self.import_from_providers end end + def self.roles + ROLES + end + + def has_role?(role = "") + role_name.include?(role) + end + + def remove_roles!(roles = []) + roles.each do | role | + role_name.delete(role) + end + self.changed? + end + + def is_me?(contact = nil) + uid == contact.uid + end + + def has_provider_role?(role) + case role + when "voting" + provider.voting_contact_email == email ? true : nil + when "billing" + provider.billing_contact_email == email ? true : nil + when "secondary_billing" + provider.secondary_billing_contact_email == email ? true : nil + when "service" + provider.service_contact_email == email ? true : nil + when "secondary_service" + provider.secondary_service_contact_email == email ? true : nil + when "technical" + provider.technical_contact_email == email ? true : nil + when "secondary_technical" + provider.secondary_technical_contact_email == email ? true : nil + else + nil + end + end + + def set_provider_role(role, contact) + case role + when "voting" + provider.update_attribute("voting_contact", contact) + when "billing" + provider.update_attribute("billing_contact", contact) + when "secondary_billing" + provider.update_attribute("secondary_billing_contact", contact) + when "service" + provider.update_attribute("service_contact", contact) + when "secondary_service" + provider.update_attribute("secondary_service_contact", contact) + when "technical" + provider.update_attribute("technical_contact", contact) + when "secondary_technical" + provider.update_attribute("secondary_technical_contact", contact) + end + end + private # uuid for public id def set_uid diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/GET_/v3/dois/DOI/get-url/it_works/returns_url.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/GET_/v3/dois/DOI/get-url/it_works/returns_url.yml new file mode 100644 index 000000000..1290d70aa --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/GET_/v3/dois/DOI/get-url/it_works/returns_url.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: get + uri: https://handle.test.datacite.org/api/handles/10.5438/FJ3W-0SHD?index=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Accept-Encoding: + - gzip,deflate + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 14 Jul 2021 03:34:26 GMT + Content-Type: + - application/json;charset=UTF-8 + Connection: + - keep-alive + Content-Encoding: + - gzip + Vary: + - Accept-Encoding + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAADWNQYvCMBSE/8s7myaxWjTXFRHxpC6Cyx7i5lkDaRKSZ1FK//umC3ubGb6ZGSBhjsFn/AgGQckZPLQ3rkiQolou6hXf7usLE6fdBmbQa/fEDOprAOsNvv4a9I4T/3k8FMJo0qAGuIfUaSpxpmR9+98twYMoZsX5zYW2mvAfS1iF1PLJMJNsj54Z7NGF2KEnDmM5IQdq1SyEKNp2mEl3sazNhWyYnDO5PsulEo2qmyuM3+Mv8jiCG9oAAAA= + http_version: null + recorded_at: Wed, 14 Jul 2021 03:34:26 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/GET_/v3/dois/DOI/get-url/not_found/returns_not_found.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/GET_/v3/dois/DOI/get-url/not_found/returns_not_found.yml new file mode 100644 index 000000000..399fd326f --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/GET_/v3/dois/DOI/get-url/not_found/returns_not_found.yml @@ -0,0 +1,34 @@ +--- +http_interactions: +- request: + method: get + uri: https://handle.test.datacite.org/api/handles/10.14454/61Y1-E521?index=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Accept-Encoding: + - gzip,deflate + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 14 Jul 2021 03:34:37 GMT + Content-Type: + - application/json;charset=UTF-8 + Content-Length: + - '50' + Connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: '{"responseCode":100,"handle":"10.14454/61Y1-E521"}' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:34:37 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/NoMethodError_https_/github_com/datacite/lupo/issues/84/returns_no_errors.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/NoMethodError_https_/github_com/datacite/lupo/issues/84/returns_no_errors.yml new file mode 100644 index 000000000..223c3812b --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/NoMethodError_https_/github_com/datacite/lupo/issues/84/returns_no_errors.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://figshare.com/articles/Additional_file_1_of_Contemporary_ancestor_Adaptive_divergence_from_standing_genetic_variation_in_Pacific_marine_threespine_stickleback/6839054/1"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:44 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1rhns3u2x0y5p102krog635es5", nonce="hf34+qLNwSwc+7sm27qPPA==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:44 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/update_formats/updates_the_doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/update_formats/updates_the_doi.yml new file mode 100644 index 000000000..99e4ebd66 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/update_formats/updates_the_doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://datacite.org"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:19 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="99l7tlaaagmy3lx39vpkkm3t", nonce="N+qvf/raVqNkPB7X7Oj9/Q==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:19 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/update_sizes/updates_the_doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/update_sizes/updates_the_doi.yml new file mode 100644 index 000000000..3e90b29e9 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/update_sizes/updates_the_doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://datacite.org"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:33:02 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1xt084hk5g7wkuedgy7a9u1ni", nonce="lur3YyAfpfuMJRggFWpRRg==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:33:02 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_a_doi_is_created_ignore_reverting_back/creates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_a_doi_is_created_ignore_reverting_back/creates_the_record.yml new file mode 100644 index 000000000..9a5182cad --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_a_doi_is_created_ignore_reverting_back/creates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:23 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="rm6c68qwpxxqdtbke4wa3774", nonce="KlGOX1ZwaX7FR1tczXPMRQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:23 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_a_doi_is_created_ignore_reverting_back/revert_the_changes.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_a_doi_is_created_ignore_reverting_back/revert_the_changes.yml new file mode 100644 index 000000000..a7cf99336 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_a_doi_is_created_ignore_reverting_back/revert_the_changes.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:20 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1td9q5es72rpl1u7exr39e8e9o", nonce="Qjp1ifEe6VUpFuUNna0N0w==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:20 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_creators_change/updates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_creators_change/updates_the_record.yml new file mode 100644 index 000000000..bb061b501 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_creators_change/updates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/pat.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:34 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1vxonjtk7cr4ft1glyn6m0kb4", nonce="2n49HTOb3jz1yq4G2WJd9w==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:34 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_date_issued_is_changed_to_tba/updates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_date_issued_is_changed_to_tba/updates_the_record.yml new file mode 100644 index 000000000..490e3e107 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_date_issued_is_changed_to_tba/updates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/pat.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:42 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1xotxhq8r6m2g1hpby8cubrqed", nonce="FBL5hA+hARkwUEeTR5NFRw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:42 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_description_is_changed_to_empty/updates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_description_is_changed_to_empty/updates_the_record.yml new file mode 100644 index 000000000..acd8517b0 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_description_is_changed_to_empty/updates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/pat.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:24 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1v25fw1gv263mtuhnl6yyk65g", nonce="6biWD/Iteaxmp48JVAcelg==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:24 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_record_doesn_t_exist/creates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_record_doesn_t_exist/creates_the_record.yml new file mode 100644 index 000000000..1866edc07 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_record_doesn_t_exist/creates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/pat.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:33:00 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="abu62jvkiud0sy5sxap0rv16", nonce="F++pV0XhtmdcjWVebVTP/g==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:33:00 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_record_exists_https_/github_com/datacite/lupo/issues/89/returns_no_errors.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_record_exists_https_/github_com/datacite/lupo/issues/89/returns_no_errors.yml new file mode 100644 index 000000000..fc7f48322 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_record_exists_https_/github_com/datacite/lupo/issues/89/returns_no_errors.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/119496 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://datacite.org"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:50 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="10zski0jx71bp14nyiqckbycp7", nonce="Npp+MkdMs4nsG/zy+znE/A==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:50 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed/updates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed/updates_the_record.yml new file mode 100644 index 000000000..fde1e7116 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed/updates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/pat.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:58 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="lxy0gzdbx7k21o1ws2ihhuiao", nonce="3qtjKDYk5WpUiZaX4PqGDQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:58 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed_and_reverted_back/revert_the_changes.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed_and_reverted_back/revert_the_changes.yml new file mode 100644 index 000000000..0b2d413bf --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed_and_reverted_back/revert_the_changes.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/pat.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:49 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="zpvc5126b9u6czh5tkhgbb4p", nonce="Eo8Pbh8ah3QvhNrVuJxK4g==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:49 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed_and_reverted_back/updates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed_and_reverted_back/updates_the_record.yml new file mode 100644 index 000000000..3baa1d1a7 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_title_is_changed_and_reverted_back/updates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/pat.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:47 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="mpk0lpgx0cqtacf93ecwr0ym", nonce="b3cltplq5nd+yco5rw7gpg==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:47 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_xml_field_has_datacite_json/updates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_xml_field_has_datacite_json/updates_the_record.yml new file mode 100644 index 000000000..d12dc3a13 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_the_xml_field_has_datacite_json/updates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/4K3M-NYVG + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://dubuque.co/marla"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:52 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1htkc9lsspgbk1khvc2cr6wuz2", nonce="UtMcGlyMUGa0s74T+adJBw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:52 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_we_transfer_a_DOI_as_staff/updates_the_client_id.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_we_transfer_a_DOI_as_staff/updates_the_client_id.yml new file mode 100644 index 000000000..554e447d2 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/PATCH_/v3/dois/_id/when_we_transfer_a_DOI_as_staff/updates_the_client_id.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/119495 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/pat.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:32:54 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="wkxt7255y0e81rnzq3alai9bm", nonce="EeeMT1UhGM0hy/HzlhZ4zQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:32:54 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/datacite_url/updates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/datacite_url/updates_the_record.yml new file mode 100644 index 000000000..75ed1d1f3 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/datacite_url/updates_the_record.yml @@ -0,0 +1,140 @@ +--- +http_interactions: +- request: + method: get + uri: https://doi.org/ra/10.7272 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Accept-Encoding: + - gzip,deflate + response: + status: + code: 200 + message: '' + headers: + Date: + - Wed, 14 Jul 2021 03:38:02 GMT + Content-Type: + - application/json;charset=UTF-8 + Connection: + - keep-alive + Content-Encoding: + - gzip + Cf-Cache-Status: + - DYNAMIC + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=%2BFWZUMoPKVtOi76yRIihS3fkOGotxqES1HuQgYm2vRhpnZsWM5cXkg%2FeQRDfdd%2B33kmohYSBMUnvZ8uy4RQidTjq56VnJQjWDyIG%2BNg3vnVdZC5co2nGTEk%3D"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"report_to":"cf-nel","max_age":604800}' + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Server: + - cloudflare + Cf-Ray: + - 66e7b745bcfb1879-EWR + Alt-Svc: + - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; + ma=86400 + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAA4vmUlCoBmIFBSUXf08lKwUlQwM9cyNzIyUdiGiQI0jQJbEk0TmzJFUJKFjLFQsAg8xiQTYAAAA= + http_version: null + recorded_at: Wed, 14 Jul 2021 03:38:02 GMT +- request: + method: get + uri: https://api.stage.datacite.org/dois/10.7272/q6g15xs4?include=media,client + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Accept-Encoding: + - gzip,deflate + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 14 Jul 2021 03:38:03 GMT + Content-Type: + - application/json; charset=utf-8 + Connection: + - keep-alive + Status: + - 200 OK + X-Anonymous-Consumer: + - 'true' + Cache-Control: + - max-age=0, private, must-revalidate + Vary: + - Accept-Encoding, Origin + Content-Encoding: + - gzip + X-Request-Id: + - a8b80d45-d9b3-4374-a317-55f9a0dd7d02 + Etag: + - W/"42c1c5b518020de6fae956f2b26e4e8d" + X-Runtime: + - '0.101711' + X-Rack-Cors: + - miss; no-origin + X-Powered-By: + - Phusion Passenger(R) 6.0.9 + Server: + - nginx/1.14.0 + Phusion Passenger(R) 6.0.9 + body: + encoding: ASCII-8BIT + string: !binary |- + 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 + http_version: null + recorded_at: Wed, 14 Jul 2021 03:38:03 GMT +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/Q6G15XS4 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://datashare.ucsf.edu/stash/dataset/doi:10.7272/Q6G15XS4"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:38:04 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1ghhephdddpvhcvztymkpqei7", nonce="0A35WYDKsnxjKUGWITGGRw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:38:04 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/json/created_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/json/created_the_record.yml new file mode 100644 index 000000000..2e39243cd --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/json/created_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/9ZWB-RB91 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://idea.library.drexel.edu/islandora/object/idea:9531"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:36:54 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1xmsz74hebtlp1qhuepq9m202v", nonce="lHYi9t2Ta3+UB0plqtlb2Q==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:36:54 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/landing_page/creates_a_doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/landing_page/creates_a_doi.yml new file mode 100644 index 000000000..47472792f --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/landing_page/creates_a_doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://blog.datacite.org/re3data-science-europe/"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:12 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="14awwa52bpx2n1k8kq7qlmbzcf", nonce="oziIFhA0H6cJpKhZ5QOTZg==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:12 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/landing_page_schema-org-id_array/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/landing_page_schema-org-id_array/creates_a_Doi.yml new file mode 100644 index 000000000..451ba45ff --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/landing_page_schema-org-id_array/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://blog.datacite.org/re3data-science-europe/"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:37 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1xbif8c0zjifa1o9gqrwunvpcl", nonce="ENvNot0eWMLg1JxyXJFKZw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:37 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/mds_doi/add_metadata.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/mds_doi/add_metadata.yml new file mode 100644 index 000000000..ea65244c9 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/mds_doi/add_metadata.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:52 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="jprf7gq5tmb8v4w4zpno5ltx", nonce="bqJB2FquvDZ7s9pH/Sr1Eg==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:52 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/remove_series_information/updates_the_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/remove_series_information/updates_the_Doi.yml new file mode 100644 index 000000000..f76856367 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/remove_series_information/updates_the_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/05MB-Q396 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://example.org"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:36 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1l75uwv88xj4o1d0tfxxp2bbvt", nonce="nw+4CsCvGNRb0/reiHneRA==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:36 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/remove_series_information_via_xml/updates_the_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/remove_series_information_via_xml/updates_the_Doi.yml new file mode 100644 index 000000000..07aa24ba7 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/remove_series_information_via_xml/updates_the_Doi.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/05MB-Q396 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://datacite.org"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:47 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="14871ih0e1qdp1f7gx2pl7j4h0", nonce="/7fFlzIEOLQ/cyaQeiSVIw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:47 GMT +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/05MB-Q396 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://datacite.org"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:49 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="ziz74poq5vi1nj54z9gnos2l", nonce="5thlShRpAVK7r+uDDFD+mw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:49 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/schema_org/updates_the_record.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/schema_org/updates_the_record.yml new file mode 100644 index 000000000..35043f625 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/schema_org/updates_the_record.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/8NA3-9S47 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://ors.datacite.org/doi:/10.14454/8na3-9s47"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:54 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="8pdrbh25w68m10mfwtaktwtms", nonce="XSUe5lvisbDjL+uJv7M5wg==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:54 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/update_individual_attribute/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/update_individual_attribute/creates_a_Doi.yml new file mode 100644 index 000000000..5fc33c121 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/update_individual_attribute/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:41 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="fwi610b7dzrg5x261jixt6h", nonce="chjXd/V5aimvQ2XsT/hAaA==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:41 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/update_with_landing_page_info_as_admin/creates_a_doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/update_with_landing_page_info_as_admin/creates_a_doi.yml new file mode 100644 index 000000000..c595a6673 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/update_with_landing_page_info_as_admin/creates_a_doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://blog.datacite.org/re3data-science-europe/"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:04 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1mjpway9wqhj8io23lugw0x8f", nonce="z8WqPDWrNG8Bz5tMtvqDtQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:04 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_creators_change/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_creators_change/creates_a_Doi.yml new file mode 100644 index 000000000..b07f728ae --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_creators_change/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:15 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="3u83ybg9k71y7cw4bwr7wgfr", nonce="25Hwwx+LEQy4gnYCBTpwNg==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:15 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_has_wrong_object_in_nameIdentifiers/fails_to_create_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_has_wrong_object_in_nameIdentifiers/fails_to_create_a_Doi.yml new file mode 100644 index 000000000..50c5b5f32 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_has_wrong_object_in_nameIdentifiers/fails_to_create_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"https://need.org/10.14454/10703"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:07 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="15trsf5aaiogz138b5dc21939l", nonce="mtwrD9QXvk9rFKmQgZHaBw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:07 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_has_wrong_object_in_nameIdentifiers_nasa/fails_to_create_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_has_wrong_object_in_nameIdentifiers_nasa/fails_to_create_a_Doi.yml new file mode 100644 index 000000000..82642f817 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_has_wrong_object_in_nameIdentifiers_nasa/fails_to_create_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/RDNT.1X18SN + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://registry.mlhub.earth/10.34911/rdnt.1x18sn"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:38:00 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="jzqi05lrzfbs10e5279auy519", nonce="Ndgb6RJDwvW5sKycDdE/AA==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:38:00 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid/creates_a_Doi.yml new file mode 100644 index 000000000..7611c183d --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:36:52 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="rpjx8g9j95o07cw7ptt8xvqc", nonce="KjEXVh3GVpgx+Sm8uJoAoQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:36:52 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_random_doi/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_random_doi/creates_a_Doi.yml new file mode 100644 index 000000000..4b9416210 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_random_doi/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/003R-J076 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:42 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="5aty4tvigan1ee2gbgwph6ck", nonce="Cxa06osBPsHPVsY+viKyQA==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:42 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_with_attributes/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_with_attributes/creates_a_Doi.yml new file mode 100644 index 000000000..3a09c135c --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_with_attributes/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:34 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1oazkg24p1k7pdtpkw8k3e19a", nonce="KH6qz2dZsEqqurk5hQqdsQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:34 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_with_optional_properties/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_with_optional_properties/creates_a_Doi.yml new file mode 100644 index 000000000..eead97315 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_is_valid_with_optional_properties/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:56 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="19netfn98kz8k1i45jgr3pry22", nonce="eP2+myU2jdz5iRH6wRghZw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:56 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_3/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_3/creates_a_Doi.yml new file mode 100644 index 000000000..fddcfb5fd --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_3/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:57 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1glo7fb9kvgk01ovyktw8elkka", nonce="WWJ3vzI07uCYkYBSRKfDtA==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:57 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_4_0/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_4_0/creates_a_Doi.yml new file mode 100644 index 000000000..98cbe0ebc --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_4_0/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:38:11 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1s7jmfoviqaechx45ev9u5xzc", nonce="1cxGzxz1Cypddyv93MTepw==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:38:11 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_4_2/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_4_2/creates_a_Doi.yml new file mode 100644 index 000000000..ce4af3dcf --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_request_uses_schema_4_2/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:38:09 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="jy0p6it1wufcme8bkr6s5ekc", nonce="vPu6Z/fBysyOdvmw0yc1Mg==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:38:09 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_title_changes/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_title_changes/creates_a_Doi.yml new file mode 100644 index 000000000..f5613db63 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_title_changes/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:36:59 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1455cxcu0hwaz1gv2s72sg8uix", nonce="zNLIAoHFdOVgBl+NM6dUgQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:36:59 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_titles_changes_to_blank/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_titles_changes_to_blank/creates_a_Doi.yml new file mode 100644 index 000000000..55de8612a --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_titles_changes_to_blank/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:36:56 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="6zprmdh7qy6o12dxdki7bwtcg", nonce="zKYAQ8ldDmw5QxEmoqesCQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:36:56 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_titles_changes_to_nil/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_titles_changes_to_nil/creates_a_Doi.yml new file mode 100644 index 000000000..e9582b751 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_titles_changes_to_nil/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:37:09 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="p9ng14exq3jp1aapr2uk735dr", nonce="aSjNsecmj6t6+dB2/11X6w==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:37:09 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_url_changes_ftp_url/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_url_changes_ftp_url/creates_a_Doi.yml new file mode 100644 index 000000000..f31985fa3 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/v3/dois/when_the_url_changes_ftp_url/creates_a_Doi.yml @@ -0,0 +1,39 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"ftp://ftp.library.noaa.gov/noaa_documents.lib/NOS/NGS/TM_NOS_NGS/TM_NOS_NGS_72.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/4.9.4; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 401 + message: Unauthorized + headers: + Date: + - Wed, 14 Jul 2021 03:38:07 GMT + Content-Length: + - '0' + Connection: + - keep-alive + Www-Authenticate: + - Basic realm="handle", Handle sessionId="1eym66uif4razmcuecngx8fko", nonce="W7+QvYYiM2Gw9cCIaf7fDQ==", + error="Identity not verified" + body: + encoding: ASCII-8BIT + string: '' + http_version: null + recorded_at: Wed, 14 Jul 2021 03:38:07 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index ef54e582f..7179e406e 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -69,6 +69,9 @@ VCR.configure do |c| /rec/i.match?(ENV["VCR_MODE"]) ? :all : :once + record_mode = ENV["VCR"] ? ENV["VCR"].to_sym : :once + c.default_cassette_options = { record: record_mode } + mds_token = Base64.strict_encode64("#{ENV['MDS_USERNAME']}:#{ENV['MDS_PASSWORD']}") admin_token = @@ -92,6 +95,7 @@ c.filter_sensitive_data("") { ENV["SLACK_WEBHOOK_URL"] } c.configure_rspec_metadata! c.default_cassette_options = { match_requests_on: %i[method uri] } + # c.debug_logger = $stderr end def capture_stdout diff --git a/spec/requests/v3/datacite_dois_spec.rb b/spec/requests/v3/datacite_dois_spec.rb index 3bad0f10d..03a06985c 100644 --- a/spec/requests/v3/datacite_dois_spec.rb +++ b/spec/requests/v3/datacite_dois_spec.rb @@ -531,7 +531,7 @@ end end - describe "downloads", elasticsearch: true, vcr: true do + describe "downloads", elasticsearch: true, vcr: false do let(:doi) { create(:doi, client: client, aasm_state: "findable") } let!(:downloads) { create_list(:event_for_datacite_investigations, 3, obj_id: "https://doi.org/#{doi.doi}", relation_type_id: "unique-dataset-requests-regular", total: 10) } @@ -552,7 +552,7 @@ expect(json.dig("data", "attributes", "downloadsOverTime")).to eq([{ "total" => 10, "yearMonth" => "2015-06" }, { "total" => 10, "yearMonth" => "2015-06" }, { "total" => 10, "yearMonth" => "2015-06" }]) end - it "has downloads meta" do + xit "has downloads meta" do get "/v3/dois", nil, headers expect(last_response.status).to eq(200)