to_spotlight 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4deb28ad3713576341e26dda6fe4d04c035125f8d7787afab0887344175b02d4
4
- data.tar.gz: 3481e5a52599293ab4462e5ec47bb0f80f0e9ae51e0921360c58537640f76a98
3
+ metadata.gz: 41d9f884bff14e5cc820925183917eec062d99d9171bc06b382262b25272adde
4
+ data.tar.gz: bb56c9ea7d058a2a788ee68b34a93af767c4d3aacf47fb5583d47db615a3f8c4
5
5
  SHA512:
6
- metadata.gz: d200aad7d3b7a82795c7629655397bc6345406246e863e98d5a3c34a7b5c7aefbc7ae337a325b13690d1888f33aa9408a78a0273e1b48a7bf94939ddca319680
7
- data.tar.gz: a3f955886e4d0d015011b7af44b19c8a1507a0c38e09fe77f9841c8673d90ca8470a1188f6128c6a100c768a124b528ff47b117186535a5d048de7e2e7f2dc00
6
+ metadata.gz: e8e1ba2bdf08dabc8c3af5cc9b45c8f6b1ff60da1485a29f632ede1f20d93528fa2e4d62fef2bb24ea50e00a4cfe165a0b4937ab5b814b0b0b7ee0b1e2749929
7
+ data.tar.gz: 37fea3ff7597b052a60785775239fdbdab410c827a1e3ba16f70d68c04245f72bacb294dad148474c29f6a4f955cedfb2331a6ce211d6919e547e95319380732
@@ -1,7 +1,10 @@
1
1
  module ToSpotlight
2
2
  class SpotlightTransferController < ActionController::Base
3
3
  protect_from_forgery with: :exception
4
+ before_action :authenticate_user!
4
5
  skip_before_action :verify_authenticity_token, only: :receive
6
+ layout 'hyrax/dashboard' if Hyrax
7
+ before_action :authenticate, except: :index
5
8
  require 'json'
6
9
  require 'net/http'
7
10
 
@@ -20,7 +23,7 @@ module ToSpotlight
20
23
  end
21
24
 
22
25
  def receive
23
- return unless params[:token]
26
+ return unless params[:token] == token
24
27
  @transfer = ToSpotlight::SpotlightTransfer.new get_transfer_attributes
25
28
  @transfer.mappings = params[:mappings]
26
29
  if @transfer.save
@@ -50,6 +53,10 @@ module ToSpotlight
50
53
 
51
54
  private
52
55
 
56
+ def token
57
+ ToSpotlight::Engine.config['hyrax_instances']
58
+ end
59
+
53
60
  def mapping_invert(hash)
54
61
  result = []
55
62
  test = hash.map { |h| {h['hyrax'] => h['spotlight'].values} }
@@ -1,5 +1,3 @@
1
- <h1>ToSpotlight#approve</h1>
2
- <p>Find me in app/views/to_spotlight/to_spotlight/approve.html.erb</p>
3
1
  <%= params.inspect %>
4
2
 
5
3
  <br/>
@@ -0,0 +1,7 @@
1
+ class CdmMigrator::InstallGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../templates', __FILE__)
3
+
4
+ def inject_content_dm_yml
5
+ copy_file('config/to_spotlight.yml', 'config/to_spotlight.yml') unless File.file?('config/to_spotlight.yml')
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ secret_token: 'rftvgyuhwefhcgyvuryweudijxoschdufygvebhqwdijloschvugbeiofhqdijlcnhqeljcmjioeql328r9hdfec3h'
@@ -1,3 +1,3 @@
1
1
  module ToSpotlight
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sephirothkod
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-04 00:00:00.000000000 Z
11
+ date: 2020-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -72,6 +72,8 @@ files:
72
72
  - config/application.rb
73
73
  - config/routes.rb
74
74
  - db/migrate/20200310153953_create_to_spotlight_spotlight_transfers.rb
75
+ - lib/generators/install/install_generator.rb
76
+ - lib/generators/install/templates/config/to_spotlight.yml
75
77
  - lib/tasks/to_spotlight_tasks.rake
76
78
  - lib/to_spotlight.rb
77
79
  - lib/to_spotlight/engine.rb