rails-auth 1.3.0 → 2.0.1
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 +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGES.md +30 -0
- data/README.md +27 -485
- data/lib/rails/auth.rb +3 -0
- data/lib/rails/auth/acl.rb +20 -15
- data/lib/rails/auth/acl/matchers/allow_all.rb +1 -1
- data/lib/rails/auth/acl/middleware.rb +6 -1
- data/lib/rails/auth/acl/resource.rb +12 -11
- data/lib/rails/auth/config_builder.rb +83 -0
- data/lib/rails/auth/credentials.rb +17 -32
- data/lib/rails/auth/credentials/injector_middleware.rb +2 -2
- data/lib/rails/auth/env.rb +64 -0
- data/lib/rails/auth/error_page/debug_page.html.erb +2 -2
- data/lib/rails/auth/exceptions.rb +8 -2
- data/lib/rails/auth/helpers.rb +64 -0
- data/lib/rails/auth/monitor/middleware.rb +28 -0
- data/lib/rails/auth/rack.rb +4 -2
- data/lib/rails/auth/rspec/helper_methods.rb +20 -2
- data/lib/rails/auth/version.rb +1 -1
- data/lib/rails/auth/x509/matcher.rb +1 -1
- data/spec/rails/auth/acl/middleware_spec.rb +2 -1
- data/spec/rails/auth/acl/resource_spec.rb +17 -17
- data/spec/rails/auth/acl_spec.rb +3 -3
- data/spec/rails/auth/credentials/injector_middleware_spec.rb +1 -1
- data/spec/rails/auth/credentials_spec.rb +20 -41
- data/spec/rails/auth/env_spec.rb +31 -0
- data/spec/rails/auth/monitor/middleware_spec.rb +39 -0
- data/spec/rails/auth/rspec/helper_methods_spec.rb +26 -0
- data/spec/rails/auth/rspec/matchers/acl_matchers_spec.rb +2 -2
- data/spec/rails/auth/x509/matcher_spec.rb +1 -1
- metadata +8 -3
- data/lib/rails/auth/override.rb +0 -29
data/lib/rails/auth/override.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
module Rails
|
2
|
-
# Modular resource-based authentication and authorization for Rails/Rack
|
3
|
-
module Auth
|
4
|
-
# Rack environment key for marking external authorization
|
5
|
-
AUTHORIZED_ENV_KEY = "rails-auth.authorized".freeze
|
6
|
-
|
7
|
-
# Functionality allowing external middleware to override our ACL check process
|
8
|
-
module Override
|
9
|
-
# Mark a request as externally authorized. Causes ACL checks to be skipped.
|
10
|
-
#
|
11
|
-
# @param [Hash] :env Rack environment
|
12
|
-
#
|
13
|
-
def authorized!(env)
|
14
|
-
env[AUTHORIZED_ENV_KEY] = true
|
15
|
-
end
|
16
|
-
|
17
|
-
# Check whether a request has been externally authorized? Used to bypass
|
18
|
-
# ACL check.
|
19
|
-
#
|
20
|
-
# @param [Hash] :env Rack environment
|
21
|
-
#
|
22
|
-
def authorized?(env)
|
23
|
-
env.fetch(AUTHORIZED_ENV_KEY, false)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
extend Override
|
28
|
-
end
|
29
|
-
end
|