X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/07a2b2c0e743f36be03e746a7e265986db555d3e..f9ae5b90a5e04477133ca7a7d34bd3eebf862474:/services/api/app/controllers/arvados/v1/schema_controller.rb diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb index c3b34112b2..5f042877de 100644 --- a/services/api/app/controllers/arvados/v1/schema_controller.rb +++ b/services/api/app/controllers/arvados/v1/schema_controller.rb @@ -3,15 +3,15 @@ # SPDX-License-Identifier: AGPL-3.0 class Arvados::V1::SchemaController < ApplicationController - skip_before_filter :catch_redirect_hint - skip_before_filter :find_objects_for_index - skip_before_filter :find_object_by_uuid - skip_before_filter :load_filters_param - skip_before_filter :load_limit_offset_order_params - skip_before_filter :load_read_auths - skip_before_filter :load_where_param - skip_before_filter :render_404_if_no_object - skip_before_filter :require_auth_scope + skip_before_action :catch_redirect_hint + skip_before_action :find_objects_for_index + skip_before_action :find_object_by_uuid + skip_before_action :load_filters_param + skip_before_action :load_limit_offset_order_params + skip_before_action :load_read_auths + skip_before_action :load_where_param + skip_before_action :render_404_if_no_object + skip_before_action :require_auth_scope include DbCurrentTime @@ -33,32 +33,40 @@ class Arvados::V1::SchemaController < ApplicationController version: "v1", revision: "20131114", source_version: AppVersion.hash, + sourceVersion: AppVersion.hash, # source_version should be deprecated in the future + packageVersion: AppVersion.package_version, generatedAt: db_current_time.iso8601, title: "Arvados API", description: "The API to interact with Arvados.", documentationLink: "http://doc.arvados.org/api/index.html", - defaultCollectionReplication: Rails.configuration.default_collection_replication, + defaultCollectionReplication: Rails.configuration.Collections["DefaultReplication"], protocol: "rest", baseUrl: root_url + "arvados/v1/", basePath: "/arvados/v1/", rootUrl: root_url, servicePath: "arvados/v1/", batchPath: "batch", - defaultTrashLifetime: Rails.application.config.default_trash_lifetime, - blobSignatureTtl: Rails.application.config.blob_signature_ttl, - maxRequestSize: Rails.application.config.max_request_size, - dockerImageFormats: Rails.application.config.docker_image_formats, - crunchLogBytesPerEvent: Rails.application.config.crunch_log_bytes_per_event, - crunchLogSecondsBetweenEvents: Rails.application.config.crunch_log_seconds_between_events, - crunchLogThrottlePeriod: Rails.application.config.crunch_log_throttle_period, - crunchLogThrottleBytes: Rails.application.config.crunch_log_throttle_bytes, - crunchLogThrottleLines: Rails.application.config.crunch_log_throttle_lines, - crunchLimitLogBytesPerJob: Rails.application.config.crunch_limit_log_bytes_per_job, - crunchLogPartialLineThrottlePeriod: Rails.application.config.crunch_log_partial_line_throttle_period, - remoteHosts: Rails.configuration.remote_hosts, - remoteHostsViaDNS: Rails.configuration.remote_hosts_via_dns, - websocketUrl: Rails.application.config.websocket_address, - workbenchUrl: Rails.application.config.workbench_address, + uuidPrefix: Rails.configuration.ClusterID, + defaultTrashLifetime: Rails.configuration.Collections["DefaultTrashLifetime"], + blobSignatureTtl: Rails.configuration.Collections["BlobSigningTTL"], + maxRequestSize: Rails.configuration.API["MaxRequestSize"], + maxItemsPerResponse: Rails.configuration.API["MaxItemsPerResponse"], + dockerImageFormats: Rails.configuration.Containers["SupportedDockerImageFormats"], + crunchLogBytesPerEvent: Rails.configuration.Containers["Logging"]["LogBytesPerEvent"], + crunchLogSecondsBetweenEvents: Rails.configuration.Containers["Logging"]["LogSecondsBetweenEvents"], + crunchLogThrottlePeriod: Rails.configuration.Containers["Logging"]["LogThrottlePeriod"], + crunchLogThrottleBytes: Rails.configuration.Containers["Logging"]["LogThrottleBytes"], + crunchLogThrottleLines: Rails.configuration.Containers["Logging"]["LogThrottleLines"], + crunchLimitLogBytesPerJob: Rails.configuration.Containers["Logging"]["LimitLogBytesPerJob"], + crunchLogPartialLineThrottlePeriod: Rails.configuration.Containers["Logging"]["LogPartialLineThrottlePeriod"], + crunchLogUpdatePeriod: Rails.configuration.Containers["Logging"]["LogUpdatePeriod"], + crunchLogUpdateSize: Rails.configuration.Containers["Logging"]["LogUpdateSize"], + remoteHosts: Rails.configuration.RemoteClusters.map {|k,v| v["Host"]}, + remoteHostsViaDNS: Rails.configuration.RemoteClusters["*"]["Proxy"], + websocketUrl: Rails.configuration.Services["Websocket"]["ExternalURL"], + workbenchUrl: Rails.configuration.Services["Workbench1"]["ExternalURL"], + keepWebServiceUrl: Rails.configuration.Services["WebDAV"]["ExternalURL"], + gitUrl: Rails.configuration.Services["GitHTTP"]["ExternalURL"], parameters: { alt: { type: "string", @@ -113,12 +121,20 @@ class Arvados::V1::SchemaController < ApplicationController end object_properties = {} k.columns. - select { |col| col.name != 'id' }. + select { |col| col.name != 'id' && !col.name.start_with?('secret_') }. collect do |col| if k.serialized_attributes.has_key? col.name object_properties[col.name] = { type: k.serialized_attributes[col.name].object_class.to_s } + elsif k.attribute_types[col.name].is_a? JsonbType::Hash + object_properties[col.name] = { + type: Hash.to_s + } + elsif k.attribute_types[col.name].is_a? JsonbType::Array + object_properties[col.name] = { + type: Array.to_s + } else object_properties[col.name] = { type: col.type @@ -382,7 +398,7 @@ class Arvados::V1::SchemaController < ApplicationController end end end - Rails.configuration.disable_api_methods.each do |method| + Rails.configuration.API["DisabledAPIs"].each do |method| ctrl, action = method.split('.', 2) discovery[:resources][ctrl][:methods].delete(action.to_sym) end