From 9adc22422e27eebc4d3e3aa9c7ccf1fc4b9de74a Mon Sep 17 00:00:00 2001 From: Mike Bennett <93522067+digitaldogsbody@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:59:30 +0100 Subject: [PATCH] Revert "Openapi-schema" --- app/controllers/application_controller.rb | 24 ----------------------- config/routes.rb | 5 ----- 2 files changed, 29 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4da39eeec..d20c676fa 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "open-uri" - class ApplicationController < ActionController::API include ActionController::HttpAuthentication::Basic::ControllerMethods include Authenticable @@ -166,28 +164,6 @@ def skip_bullet Bullet.enable = previous_value end - def serve_manifest - url = ENV["PLUGIN_MANIFEST_URL"] || "https://api.datacite.org" - data = URI.open(url).read - - send_data( - data, - type: "application/json", - disposition: "inline" - ) - end - - def serve_openapi_spec - url = ENV["PLUGIN_OPENAPI_URL"] || "https://api.datacite.org" - data = URI.open(url).read - - send_data( - data, - type: "text/yaml", - disposition: "inline" - ) - end - protected def is_admin_or_staff? current_user&.is_admin_or_staff? ? 1 : 0 diff --git a/config/routes.rb b/config/routes.rb index 84da67052..f1b42826f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,10 +18,6 @@ # send reset link post "reset", to: "sessions#reset" - ## to route when requesting .well-known/ai-plugin.json to route to that file - get "/.well-known/ai-plugin.json", to: "application#serve_manifest" - get "/graphql-openapi.yaml", to: "application#serve_openapi_spec" - # content negotiation via index path get "/application/vnd.datacite.datacite+xml/:id", to: "index#show", @@ -248,7 +244,6 @@ constraints: { id: /.+/ }, format: false - root to: "index#index" # rescue routing errors