blacklight-access_controls 6.0.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42bc79d32ffb74382743a9369ccb54bd68a57791e9df8f48c6448b22d6bf1577
4
- data.tar.gz: cfad8e539c0dad24339828d70f5da920e110fc6fa8da631eaaca7cdfb8a0ae3f
3
+ metadata.gz: 3b9fce315e1dd04f42137f6638ba01c3fd88db2c5abf5fcd81015c03ecf73889
4
+ data.tar.gz: c0537bab02b3b95c80841c4617eda10fe03acab1debd578d28b0dbb8b9468a42
5
5
  SHA512:
6
- metadata.gz: 64885571fb3a23d9cd11d9a0c4f5b6303bc0cd7e1eda451a03b932abad4f519475716dcf4db53f7dc63fa889f026ec12e6a1ff593552391253b4fdf04415d360
7
- data.tar.gz: a52e7d5aaf059cc904928a6b7ae7887d5cb009036de6acd3462f50157399221ed9574fa392786c5b9e1e1fa22ca5892d98ca24eb3552556830448fe5e8546ac0
6
+ metadata.gz: 5c7484ef418484e7e91f26237eb35cd56d2fc04282deea8998b77db0747f5283634d5e0e0ece7eea55a35a421c9b07a8f6dbb8ed24cb24b86367a90623f95b2b
7
+ data.tar.gz: 708e32e0d761ad496750390e45dc17d70dac0748644310645972f8625e9007b5cc880134960ba7f682a895322bc4673c5991f8ed412eed8f5fb26b3ef3e51110
@@ -0,0 +1,31 @@
1
+ on:
2
+ push:
3
+ branches: [ "main" ]
4
+ pull_request:
5
+ branches: [ "main" ]
6
+
7
+ jobs:
8
+ test:
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby_version: ['3.4.4', '3.3.8', '3.2.8']
13
+ rails_version: ['8.0.1', '7.2.2.1', '7.1.5.1']
14
+
15
+ runs-on: ubuntu-latest
16
+ name: ruby ${{ matrix.ruby_version }} | rails ${{ matrix.rails_version }}
17
+ env:
18
+ RAILS_VERSION: ${{ matrix.rails_version }}
19
+ ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-kamal --skip-solid --skip-coffee --skip-test --skip-assets"
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v4
23
+ - name: Set up Ruby
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ bundler: "latest"
27
+ ruby-version: ${{ matrix.ruby_version }}
28
+ - name: Install dependencies
29
+ run: bundle install
30
+ - name: Run tests
31
+ run: bundle exec rake ci
data/.rubocop.yml CHANGED
@@ -16,7 +16,7 @@ Metrics/BlockLength:
16
16
  Exclude:
17
17
  - 'spec/**/*'
18
18
 
19
- Metrics/LineLength:
19
+ Layout/LineLength:
20
20
  Max: 185
21
21
 
22
22
  Naming/FileName:
@@ -25,9 +25,6 @@ Naming/FileName:
25
25
  - 'blacklight-access_controls.gemspec'
26
26
  - 'lib/blacklight-access_controls.rb'
27
27
 
28
- Rails:
29
- Enabled: true
30
-
31
28
  RSpec/MessageSpies:
32
29
  Enabled: false
33
30
 
data/.rubocop_todo.yml CHANGED
@@ -32,7 +32,7 @@ RSpec/ExampleLength:
32
32
 
33
33
  # Offense count: 3
34
34
  # Configuration parameters: CustomTransform, IgnoreMethods.
35
- RSpec/FilePath:
35
+ RSpec/SpecFilePathFormat:
36
36
  Exclude:
37
37
  - 'spec/unit/catalog_spec.rb'
38
38
  - 'spec/unit/config_spec.rb'
data/.solr_wrapper.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  # Place any default configuration for solr_wrapper here
2
2
  # port: 8983
3
+ env:
4
+ SOLR_MODULES: analysis-extras
3
5
  collection:
4
6
  dir: solr_conf/conf/
5
7
  name: blacklight-core
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'bundler/setup'
3
5
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.0.1
1
+ 6.1.0
@@ -3,7 +3,7 @@ version = File.read(File.expand_path('../VERSION', __FILE__)).strip
3
3
  module Blacklight
4
4
  module AccessControls
5
5
  def self.bl_version
6
- ENV['BLACKLIGHT_VERSION'] ? [ENV['BLACKLIGHT_VERSION']] : ['> 6.0', '< 8']
6
+ ENV['BLACKLIGHT_VERSION'] ? [ENV['BLACKLIGHT_VERSION']] : ['> 6.0', '< 9']
7
7
  end
8
8
  end
9
9
  end
@@ -31,10 +31,10 @@ Gem::Specification.new do |gem|
31
31
 
32
32
  gem.add_development_dependency 'database_cleaner'
33
33
  gem.add_development_dependency 'engine_cart', '~> 2.2'
34
- gem.add_development_dependency 'factory_bot_rails', '~> 4.8'
34
+ gem.add_development_dependency 'factory_bot_rails', '>= 4.8'
35
35
  gem.add_development_dependency 'rake', '~> 12.3'
36
36
  gem.add_development_dependency 'rspec', '~> 3.1'
37
- gem.add_development_dependency 'rubocop', '~> 0.52.1'
37
+ gem.add_development_dependency 'rubocop', '~> 1.29'
38
38
  gem.add_development_dependency 'rubocop-rspec'
39
39
  gem.add_development_dependency 'solr_wrapper'
40
40
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require 'deprecation'
2
3
 
3
4
  module Blacklight
4
5
  module AccessControls
@@ -15,11 +16,11 @@ module Blacklight
15
16
  extend ActiveSupport::Concern
16
17
 
17
18
  included do
18
- extend Deprecation
19
+ extend ::Deprecation
19
20
  attr_writer :current_ability, :discovery_permissions
20
21
  deprecation_deprecate :current_ability=
21
22
 
22
- Deprecation.warn(self, 'Blacklight::AccessControls::Enforcement is deprecated and will be removed in 1.0')
23
+ ::Deprecation.warn(self, 'Blacklight::AccessControls::Enforcement is deprecated and will be removed in 1.0')
23
24
  class_attribute :solr_access_filters_logic
24
25
  alias_method :add_access_controls_to_solr_params, :apply_gated_discovery
25
26
 
@@ -16,7 +16,8 @@
16
16
  </updateLog>
17
17
  </updateHandler>
18
18
 
19
- <!-- solr lib dirs -->
19
+ <!-- solr lib dirs, which are needed for Solr 8 compatibility but ignored in solr 9.8 and above -->
20
+ <lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
20
21
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
21
22
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
22
23
 
@@ -46,9 +47,75 @@
46
47
  full_title_tsim
47
48
  short_title_tsim
48
49
  alternative_title_tsim
49
- active_fedora_model_ssi
50
50
  title_tsim
51
- author_tsimesim
51
+ author_tsim
52
+ subject_tsim
53
+ all_text_timv
54
+ </str>
55
+ <str name="pf">
56
+ all_text_timv^10
57
+ </str>
58
+
59
+ <str name="author_qf">
60
+ author_tsim
61
+ </str>
62
+ <str name="author_pf">
63
+ </str>
64
+ <str name="title_qf">
65
+ title_tsim
66
+ full_title_tsim
67
+ short_title_tsim
68
+ alternative_title_tsim
69
+ </str>
70
+ <str name="title_pf">
71
+ </str>
72
+ <str name="subject_qf">
73
+ subject_tsim
74
+ </str>
75
+ <str name="subject_pf">
76
+ </str>
77
+
78
+ <str name="fl">
79
+ *,
80
+ score
81
+ </str>
82
+
83
+ <str name="facet">true</str>
84
+ <str name="facet.mincount">1</str>
85
+ <str name="facet.limit">10</str>
86
+ <str name="facet.field">subject_ssim</str>
87
+
88
+ <str name="spellcheck">true</str>
89
+ <str name="spellcheck.dictionary">default</str>
90
+ <str name="spellcheck.onlyMorePopular">true</str>
91
+ <str name="spellcheck.extendedResults">true</str>
92
+ <str name="spellcheck.collate">false</str>
93
+ <str name="spellcheck.count">5</str>
94
+
95
+ </lst>
96
+ <arr name="last-components">
97
+ <str>spellcheck</str>
98
+ </arr>
99
+ </requestHandler>
100
+
101
+ <requestHandler name="/advanced" class="solr.SearchHandler">
102
+ <!-- a lucene request handler for using the JSON Query DSL,
103
+ specifically for advanced search.
104
+ Using a separate requestHandler is a workaround to
105
+ https://issues.apache.org/jira/browse/SOLR-16916, although
106
+ it could be desirable for other reasons as well.
107
+ -->
108
+ <lst name="defaults">
109
+ <str name="defType">lucene</str>
110
+ <str name="echoParams">explicit</str>
111
+ <str name="df">title_tsim</str>
112
+ <str name="qf">
113
+ id
114
+ full_title_tsim
115
+ short_title_tsim
116
+ alternative_title_tsim
117
+ title_tsim
118
+ author_tsim
52
119
  subject_tsim
53
120
  all_text_timv
54
121
  </str>
@@ -83,7 +150,6 @@
83
150
  <str name="facet">true</str>
84
151
  <str name="facet.mincount">1</str>
85
152
  <str name="facet.limit">10</str>
86
- <str name="facet.field">active_fedora_model_ssi</str>
87
153
  <str name="facet.field">subject_ssim</str>
88
154
 
89
155
  <str name="spellcheck">true</str>
@@ -3,6 +3,6 @@
3
3
  FactoryBot.define do
4
4
  factory :user do
5
5
  sequence(:email) { |n| "user_#{n}@example.com" }
6
- password 'password'
6
+ password { 'password' }
7
7
  end
8
8
  end
@@ -11,7 +11,7 @@ class TestAppGenerator < Rails::Generators::Base
11
11
 
12
12
  def generate_blacklight
13
13
  say_status('status', 'GENERATING BLACKLIGHT', :yellow)
14
- generate 'blacklight:install', '--devise'
14
+ generate 'blacklight:install', '--devise --skip-assets'
15
15
  end
16
16
 
17
17
  def configure_blacklight
@@ -1,12 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  RSpec.describe Blacklight::AccessControls::SearchBuilder do
4
- subject { search_builder }
4
+ subject(:search_builder) { described_class.new scope, ability: ability }
5
5
 
6
- let(:search_builder) do
7
- described_class.new(controller, ability: ability)
8
- end
9
- let(:controller) { double }
6
+ let(:blacklight_config) { Blacklight::Configuration.new }
7
+ let(:scope) { double blacklight_config: blacklight_config, search_state_class: nil }
10
8
  let(:user) { User.new }
11
9
  let(:ability) { Ability.new(user) }
12
10
 
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-access_controls
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  - Justin Coyne
9
9
  - Matt Zumwalt
10
10
  - Valerie Maher
11
- autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2022-03-16 00:00:00.000000000 Z
13
+ date: 1980-01-02 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: blacklight
@@ -22,7 +21,7 @@ dependencies:
22
21
  version: '6.0'
23
22
  - - "<"
24
23
  - !ruby/object:Gem::Version
25
- version: '8'
24
+ version: '9'
26
25
  type: :runtime
27
26
  prerelease: false
28
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -32,7 +31,7 @@ dependencies:
32
31
  version: '6.0'
33
32
  - - "<"
34
33
  - !ruby/object:Gem::Version
35
- version: '8'
34
+ version: '9'
36
35
  - !ruby/object:Gem::Dependency
37
36
  name: cancancan
38
37
  requirement: !ruby/object:Gem::Requirement
@@ -93,14 +92,14 @@ dependencies:
93
92
  name: factory_bot_rails
94
93
  requirement: !ruby/object:Gem::Requirement
95
94
  requirements:
96
- - - "~>"
95
+ - - ">="
97
96
  - !ruby/object:Gem::Version
98
97
  version: '4.8'
99
98
  type: :development
100
99
  prerelease: false
101
100
  version_requirements: !ruby/object:Gem::Requirement
102
101
  requirements:
103
- - - "~>"
102
+ - - ">="
104
103
  - !ruby/object:Gem::Version
105
104
  version: '4.8'
106
105
  - !ruby/object:Gem::Dependency
@@ -137,14 +136,14 @@ dependencies:
137
136
  requirements:
138
137
  - - "~>"
139
138
  - !ruby/object:Gem::Version
140
- version: 0.52.1
139
+ version: '1.29'
141
140
  type: :development
142
141
  prerelease: false
143
142
  version_requirements: !ruby/object:Gem::Requirement
144
143
  requirements:
145
144
  - - "~>"
146
145
  - !ruby/object:Gem::Version
147
- version: 0.52.1
146
+ version: '1.29'
148
147
  - !ruby/object:Gem::Dependency
149
148
  name: rubocop-rspec
150
149
  requirement: !ruby/object:Gem::Requirement
@@ -180,12 +179,12 @@ executables: []
180
179
  extensions: []
181
180
  extra_rdoc_files: []
182
181
  files:
182
+ - ".github/workflows/main.yml"
183
183
  - ".gitignore"
184
184
  - ".rspec"
185
185
  - ".rubocop.yml"
186
186
  - ".rubocop_todo.yml"
187
187
  - ".solr_wrapper.yml"
188
- - ".travis.yml"
189
188
  - Gemfile
190
189
  - README.textile
191
190
  - Rakefile
@@ -234,7 +233,6 @@ homepage: https://github.com/projectblacklight/blacklight-access_controls
234
233
  licenses:
235
234
  - APACHE2
236
235
  metadata: {}
237
- post_install_message:
238
236
  rdoc_options: []
239
237
  require_paths:
240
238
  - lib
@@ -249,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
247
  - !ruby/object:Gem::Version
250
248
  version: '0'
251
249
  requirements: []
252
- rubygems_version: 3.1.6
253
- signing_key:
250
+ rubygems_version: 3.6.9
254
251
  specification_version: 4
255
252
  summary: Access controls for blacklight-based applications
256
253
  test_files:
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- language: ruby
2
- sudo: false
3
-
4
- notifications:
5
- email: false
6
-
7
- rvm:
8
- - 2.5.1
9
-
10
- env:
11
- - "BLACKLIGHT_VERSION='~>7.0' RAILS_VERSION=5.2.2"
12
- - "BLACKLIGHT_VERSION='~>6.0' RAILS_VERSION=5.2.2"
13
- - "RAILS_VERSION=5.1.6"
14
-
15
- global_env:
16
- - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
17
- before_script:
18
- - jdk_switcher use oraclejdk8