workarea-basic_auth 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintrc.json +35 -0
- data/.github/workflows/ci.yml +57 -0
- data/.rubocop.yml +3 -0
- data/.stylelintrc.json +8 -0
- data/CHANGELOG.md +14 -0
- data/config/initializers/access_control.rb +3 -1
- data/lib/workarea/basic_auth/middleware.rb +1 -1
- data/lib/workarea/basic_auth/version.rb +1 -1
- data/test/lib/workarea/basic_auth/middleware_test.rb +6 -4
- data/workarea-basic_auth.gemspec +1 -1
- metadata +7 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3327a98acb6ee3bc11f51399de7d3c2351444bc9a8623d34b7eb543c4166f502
|
4
|
+
data.tar.gz: b8dd4dde7239e58edaed513f69266f81e5423a8ca2fc2a6829ad12aca18e1835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c0b0dd04ae486fe1661dad7970ca91e3ad7219d167b46d65cfae78ff0bf24f688e03027ef6d72e53828f52ed8e81a40d4e9a7ceb6d5a949c839d89356d802d0
|
7
|
+
data.tar.gz: ae09651da39fd61d5c704f76ca22f874248ba3dd42a603fb45539aac1e84ab3fd8e3805af269f97c8d5afd14cf463c32eb964d81ae003672e08938b7335a0892
|
data/.eslintrc.json
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"extends": "eslint:recommended",
|
3
|
+
"rules": {
|
4
|
+
"semi": ["error", "always"],
|
5
|
+
"eqeqeq": ["error", "always"]
|
6
|
+
},
|
7
|
+
"globals": {
|
8
|
+
"window": true,
|
9
|
+
"document": true,
|
10
|
+
"WORKAREA": true,
|
11
|
+
"$": true,
|
12
|
+
"jQuery": true,
|
13
|
+
"_": true,
|
14
|
+
"feature": true,
|
15
|
+
"JST": true,
|
16
|
+
"Turbolinks": true,
|
17
|
+
"I18n": true,
|
18
|
+
"Chart": true,
|
19
|
+
"Dropzone": true,
|
20
|
+
"strftime": true,
|
21
|
+
"Waypoint": true,
|
22
|
+
"wysihtml": true,
|
23
|
+
"LocalTime": true,
|
24
|
+
"describe": true,
|
25
|
+
"after": true,
|
26
|
+
"afterEach": true,
|
27
|
+
"before": true,
|
28
|
+
"beforeEach": true,
|
29
|
+
"it": true,
|
30
|
+
"expect": true,
|
31
|
+
"sinon": true,
|
32
|
+
"fixture": true,
|
33
|
+
"chai": true
|
34
|
+
}
|
35
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push]
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
static_analysis:
|
6
|
+
runs-on: ubuntu-latest
|
7
|
+
steps:
|
8
|
+
- uses: actions/checkout@v1
|
9
|
+
- uses: workarea-commerce/ci/bundler-audit@v1
|
10
|
+
- uses: workarea-commerce/ci/rubocop@v1
|
11
|
+
- uses: workarea-commerce/ci/eslint@v1
|
12
|
+
with:
|
13
|
+
args: '**/*.js'
|
14
|
+
|
15
|
+
admin_tests:
|
16
|
+
runs-on: ubuntu-latest
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v1
|
19
|
+
- uses: actions/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: 2.6.x
|
22
|
+
- uses: workarea-commerce/ci/test@v1
|
23
|
+
with:
|
24
|
+
command: bin/rails app:workarea:test:admin
|
25
|
+
|
26
|
+
core_tests:
|
27
|
+
runs-on: ubuntu-latest
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v1
|
30
|
+
- uses: actions/setup-ruby@v1
|
31
|
+
with:
|
32
|
+
ruby-version: 2.6.x
|
33
|
+
- uses: workarea-commerce/ci/test@v1
|
34
|
+
with:
|
35
|
+
command: bin/rails app:workarea:test:core
|
36
|
+
|
37
|
+
storefront_tests:
|
38
|
+
runs-on: ubuntu-latest
|
39
|
+
steps:
|
40
|
+
- uses: actions/checkout@v1
|
41
|
+
- uses: actions/setup-ruby@v1
|
42
|
+
with:
|
43
|
+
ruby-version: 2.6.x
|
44
|
+
- uses: workarea-commerce/ci/test@v1
|
45
|
+
with:
|
46
|
+
command: bin/rails app:workarea:test:storefront
|
47
|
+
|
48
|
+
plugins_tests:
|
49
|
+
runs-on: ubuntu-latest
|
50
|
+
steps:
|
51
|
+
- uses: actions/checkout@v1
|
52
|
+
- uses: actions/setup-ruby@v1
|
53
|
+
with:
|
54
|
+
ruby-version: 2.6.x
|
55
|
+
- uses: workarea-commerce/ci/test@v1
|
56
|
+
with:
|
57
|
+
command: bin/rails app:workarea:test:plugins
|
data/.rubocop.yml
ADDED
data/.stylelintrc.json
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
Workarea Basic Auth 1.1.2 (2019-09-17)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Fix for whitelisted IPs being blank
|
5
|
+
|
6
|
+
* Fix Error on App Initialization
|
7
|
+
|
8
|
+
This plugin causes an error on init with the latest Workarea version
|
9
|
+
because the `Rack::Attack::ALERT_LOGIC_IP_ADDRESSES` constant was
|
10
|
+
replaced with the more generic `Rack::Attack::IGNORED_IP_ADDRESSES`,
|
11
|
+
when it is defined. Since Basic Auth uses this constant for its own
|
12
|
+
whitelist, app initialization errors out.
|
13
|
+
|
14
|
+
|
1
15
|
Workarea Basic Auth 1.1.1 (2019-08-21)
|
2
16
|
--------------------------------------------------------------------------------
|
3
17
|
|
@@ -15,7 +15,9 @@ Workarea.configure do |config|
|
|
15
15
|
basic_auth.exclude_routes.add("/media/*")
|
16
16
|
basic_auth.exclude_routes.add("/product_images/*")
|
17
17
|
|
18
|
-
|
18
|
+
if Rack::Attack.const_defined? :IGNORED_IP_ADDRESSES
|
19
|
+
basic_auth.whitelisted_ips = Rack::Attack::IGNORED_IP_ADDRESSES
|
20
|
+
end
|
19
21
|
|
20
22
|
Workarea.config.basic_auth = basic_auth
|
21
23
|
|
@@ -41,11 +41,13 @@ module Workarea
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_unauthorized_users_returns_200_if_ip_is_whitelisted
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
Workarea.with_config do |config|
|
45
|
+
config.basic_auth.whitelisted_ips = ['192.168.0.1']
|
46
|
+
env = Rack::MockRequest.env_for("/login", 'REMOTE_ADDR' => '192.168.0.1')
|
47
|
+
get_login = Rack::Response.new(middleware.call(env))
|
47
48
|
|
48
|
-
|
49
|
+
assert_equal(200, get_login.status)
|
50
|
+
end
|
49
51
|
end
|
50
52
|
|
51
53
|
def test_unathorized_users_returns_401_for_all_http_methods_on_a_path_by_default
|
data/workarea-basic_auth.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.description = "HTTP basic authentication Rack middleware for the Workarea Commerce Platform"
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.license = 'Business Software License'
|
17
|
-
s.test_files
|
17
|
+
s.test_files = Dir["test/**/*"]
|
18
18
|
|
19
19
|
s.required_ruby_version = ">= 2.0.0"
|
20
20
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-basic_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Vendetta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: workarea
|
@@ -52,10 +52,14 @@ extensions: []
|
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
54
|
- ".editorconfig"
|
55
|
+
- ".eslintrc.json"
|
55
56
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
56
57
|
- ".github/ISSUE_TEMPLATE/documentation-request.md"
|
57
58
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
59
|
+
- ".github/workflows/ci.yml"
|
58
60
|
- ".gitignore"
|
61
|
+
- ".rubocop.yml"
|
62
|
+
- ".stylelintrc.json"
|
59
63
|
- CHANGELOG.md
|
60
64
|
- CODE_OF_CONDUCT.md
|
61
65
|
- CONTRIBUTING.md
|
@@ -120,12 +124,6 @@ files:
|
|
120
124
|
- test/dummy/lib/assets/.keep
|
121
125
|
- test/dummy/log/.keep
|
122
126
|
- test/dummy/log/sidekiq.log
|
123
|
-
- test/dummy/public/404.html
|
124
|
-
- test/dummy/public/422.html
|
125
|
-
- test/dummy/public/500.html
|
126
|
-
- test/dummy/public/apple-touch-icon-precomposed.png
|
127
|
-
- test/dummy/public/apple-touch-icon.png
|
128
|
-
- test/dummy/public/favicon.ico
|
129
127
|
- test/factories/workarea/testing/basic_auth_helper.rb
|
130
128
|
- test/lib/workarea/basic_auth/middleware_test.rb
|
131
129
|
- test/lib/workarea/basic_auth/path_test.rb
|
@@ -165,18 +163,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
163
|
- !ruby/object:Gem::Version
|
166
164
|
version: '0'
|
167
165
|
requirements: []
|
168
|
-
rubygems_version: 3.0.
|
166
|
+
rubygems_version: 3.0.6
|
169
167
|
signing_key:
|
170
168
|
specification_version: 4
|
171
169
|
summary: HTTP basic authentication Rack middleware for the Workarea Commerce Platform
|
172
170
|
test_files:
|
173
171
|
- test/test_helper.rb
|
174
|
-
- test/dummy/public/apple-touch-icon-precomposed.png
|
175
|
-
- test/dummy/public/404.html
|
176
|
-
- test/dummy/public/422.html
|
177
|
-
- test/dummy/public/500.html
|
178
|
-
- test/dummy/public/favicon.ico
|
179
|
-
- test/dummy/public/apple-touch-icon.png
|
180
172
|
- test/dummy/Rakefile
|
181
173
|
- test/dummy/config/initializers/workarea.rb
|
182
174
|
- test/dummy/config/initializers/assets.rb
|