rails-auth 1.3.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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